Android环境下使用GDBgdb在android开发中的使用相信很多开发人员都很想掌握,今天我们就用gdb在Android Emulator中进行调试,让大家学习gdb调试。在Android手机开发平台的emulator里,有两种方式可以做Gdb调试:直接使用GdbServer或利用Gdb调试进行调试。 1、利用Gdb Server进行调试: A、从下面的链接中下载针对Android的Gdb Server B、把下载的Gdb Server安装到你的emulator 中 1)、 启动emulator 2)、下载Gdb Server到你的emulator 打开一个终端,运行: 在另外一个终端里运行: 这样通过Android自己的adb,把gdbserver 下载到emulator 中了。 C、运行gdbserver : D、回到另一终端,映射端口: E、在第三个终端中运行 gdb: 2、直接用本地Gdb进行调试 A、从下面的链接中下载Android调试包,它是用Android的toolchain编译好的二进制文件: B、解压调试包,然后把gdb下载到你的emulator 中,当然如果你有真的手机,也可以这样调试: C、利用adb连接到emulator 运行gdb,会出现下面的信息: dlopen failed on 'libthread_db.so.1' - libthread_db.so.1: cannot open shared object file: No such file or directory GDB will not be able to debug pthreads. GNU gdb 6.7 Copyright (C) 2007 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. and "show warranty" for details. This GDB was configured as "--host=arm-none-linux-gnueabi --target=". (gdb) D、 |