【问题标题】:Failed to execute MI command in debugging native C++ code in Android在Android中调试本机C++代码时执行MI命令失败
【发布时间】:2014-09-18 06:52:23
【问题描述】:

我正在尝试在 Android 中调试本机 cpp 文件并遵循此 link 中的讨论。我想我完成了所有步骤并进行了本机代码调试。首先调试Android 应用程序。然后启动ndk-gdb-py。当我启动 C++ 本地调试时,我得到了错误

Error in final launch sequence
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Don't know how to run.  Try "help target".
Don't know how to run.  Try "help target".

在 Eclipse 控制台中,我发现

No symbol table is loaded.  Use the "file" command.
No symbol table is loaded.  Use the "file" command.
Function "Java_com_MainActivity_StartCamera" not defined.

此错误可能有什么问题? 编辑1: 我可以通过保持清除错误 gdb2.setup 文件中的目标远程:5039。 因为我的eclipse JUNO没有连接标签。

然后当我再次进行调试时,在控制台中的进度状态为unable to attach to target VM 并且无法AssignProcesstoObject。请查看控制台中的状态报告。我不确定我的问题是否普遍,因为我还没有任何讨论。

Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
warning: Breakpoint address adjusted from 0xb00055e1 to 0xb00055e0.
0xafd0c738 in __futex_syscall3 () from C:/libc.so
(gdb) JDB :: java.io.IOException: handshake failed - connection prematurally clo
sed
JDB ::  at com.sun.tools.jdi.SocketTransportService.handshake(SocketTransportSer
vice.java:136)
JDB ::  at com.sun.tools.jdi.SocketTransportService.attach(SocketTransportServic
e.java:232)
JDB ::  at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingCo
nnector.java:116)
JDB ::  at com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConn
ector.java:90)
JDB ::  at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnectio
n.java:519)
JDB ::  at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:3
28)
JDB ::  at com.sun.tools.example.debug.tty.Env.init(Env.java:63)
JDB ::  at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1066)
JDB ::
JDB :: Fatal error:
JDB :: Unable to attach to target VM.

【问题讨论】:

    标签: android c++ eclipse android-ndk


    【解决方案1】:

    终于可以用 gdb 进行调试了。我犯的错误是我在调试中使用命令窗口。然后我换成cygwin,安装cygwin的gcc,一切正常。谢谢

    【讨论】:

      猜你喜欢
      • 2013-12-10
      • 2012-11-20
      • 2019-08-18
      • 1970-01-01
      • 1970-01-01
      • 2013-01-04
      • 1970-01-01
      • 2021-08-10
      • 1970-01-01
      相关资源
      最近更新 更多