agdb is a utility aims to ease the task of debugging android native application. Its working mechanism is similar to
ndk-gdb. But it's intended to assist debugging native applications in android source tree, not for application created with ndk.
It does following things for us automatically:
prerequirements
agdb must know the root directory of android source code. We can tell it by passing --android-src-root argument or setting ANDROID_SRC_ROOT environment variable.
agdb interacts with target device through adb, so the device must be accessible through adb.
gdb client communicates gdbserver through tcp protocol (tcp port 7890 by default). If using emulator, we need to forward or redir tcp ports in advance.
usage
After all prequirements are met, we can run "agdb.py process_name" to debug desired application. For example, if we want to debug mediaserver application, simply run agdb.py mediaserver.
If we want to debug code in native part of a dalvik (java) application, we can use:
agdb.py --dalvik [package_name (for example, com.android.launcher)]
Limitation
It doesn't work on Windows.
It starts gdbserver in network communication mode, serial port isn't supported.
It doesn't support dalvik application.
Reference
http://source.android.com/porting/debugging_gdb.html
It does following things for us automatically:
- find the binary that contains symbol data of target process
- attach gdbserver to the target process on device, or start the target process under gdbserver if the process isn't already running
- start gdb client and set correct symbol file search path
prerequirements
agdb must know the root directory of android source code. We can tell it by passing --android-src-root argument or setting ANDROID_SRC_ROOT environment variable.
agdb interacts with target device through adb, so the device must be accessible through adb.
gdb client communicates gdbserver through tcp protocol (tcp port 7890 by default). If using emulator, we need to forward or redir tcp ports in advance.
usage
After all prequirements are met, we can run "agdb.py process_name" to debug desired application. For example, if we want to debug mediaserver application, simply run agdb.py mediaserver.
If we want to debug code in native part of a dalvik (java) application, we can use:
agdb.py --dalvik [package_name (for example, com.android.launcher)]
Limitation
It doesn't work on Windows.
It starts gdbserver in network communication mode, serial port isn't supported.
Reference
http://source.android.com/porting/debugging_gdb.html

agdb是一款用于调试Android原生应用的实用工具,其工作原理类似于ndk-gdb,但主要针对Android源代码树中的原生应用程序而非使用NDK创建的应用。它能够自动找到目标进程中的符号数据,并连接目标设备上的gdbserver,同时还启动gdb客户端并设置正确的符号文件搜索路径。
20

被折叠的 条评论
为什么被折叠?



