android ndk的ndk-gdb与emacs的集成?

for*_*ope 20 emacs android gdb android-ndk

谁能告诉我如何使用gdb-mode在emacs中运行ndk-gdb?我目前正在shell缓冲区中运行它.我喜欢的是一种在我中断或步骤时自动将源文件缓冲区与gdb中的当前pc同步的方法.还有更多,比如从源设置中断,显示gdb本地等的缓冲区,以及gdb命令的关键快捷方式都很重要.

背景:我正在使用android-ndk-r5b在OSX 10.6.6上使用android-mode开发2010-12-15的GNU Emacs 23.1.90.1(i386-apple-darwin10.5.0,NS apple-appkit-1038.35)和目标的混合java/c/c ++代码.

emacs中的Android模式和shell(运行ndk-gdb)允许我查看我需要的所有内容,但是如果我可以获得与调试器同步的源缓冲区,或者获得相同的内容,我的设置会更方便在EmacsWiki描述这里.

仅供参考,我目前正在使用eclipse进行Java端调试和开发,但发现它不稳定且难以设置本地工作,尽管sequoyah可用,此外,eclipse不是emacs.

[追加]

使用ndk-gdb作为gdb命令运行Mx gdb(见下文)会产生一个名为gud的缓冲区,其中一个模式行说"(Debugger:run [initializing ...])".缓冲区不接受gdb命令,也不接受emacs gdb命令 - (Ms,Mn等导致<>

输出:

Current directory is /Users/jpschelter/
Android NDK installation path: /Developer/android-ndk-r5b
Using specific adb command: /Developer/android-sdk-mac_x86/platform-tools/adb
...
... ...
...
(no debugging symbols found)
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0xafd0e21c in nanosleep () from /Developer/Projects/ECS/DIGG/Projects/droid/obj/local/armeabi/libc.so
(gdb) Undefined command: "1-inferior-tty-set".  Try "help".
(gdb) Undefined command: "2-gdb-set".  Try "help".
(gdb) Undefined command: "3-gdb-set".  Try "help".
(gdb) Undefined command: "4-file-list-exec-source-files".  Try "help".
(gdb) Undefined command: "5-file-list-exec-source-file".  Try "help".
(gdb) Undefined command: "6-gdb-show".  Try "help".
(gdb) Undefined command: "7-stack-info-frame".  Try "help".
(gdb) Undefined command: "8-thread-info".  Try "help".
(gdb) Undefined command: "9-break-list".  Try "help".

缓冲区被调用*threads of*,*input/output of**breakpoints of*被创建,但是是空的.

浏览我的emacs的gdb-mi.el源,并与gdb-debug-log输出进行比较,看起来gdb-mi试图将这些参数发送到gdb可执行文件,但是gdb-server没有响应按预期命令?

请注意,使用ndk-gdb的命令行运行Mx gud-gdb似乎导致相当于在shell中运行ndk-gdb,因此问题似乎在emacs中的gdb-mode配置中.

Kaz*_*oto 3

你试过这个吗?

将 android-sdk-mac_x86/platform-tools 和 android-ndk-r5b 添加到 PATH 环境中。之后,使用 ndk-gdb 脚本启动 gdb 模式。

M-x gdb
Run gdb (like this): ndk-gdb --verbose --start --project=your_NDK_project_dir
Run Code Online (Sandbox Code Playgroud)