Android / GDB – 头痛 – 无法找到调试符号

GDB开始让我头疼. GDB的工作方式似乎有些奇怪.

obj / local / armeabi /包含项目中使用的所有.so文件的列表,这些文件未被剥离,以及一个名为objs-debug的目录,其中包含一堆.o和.od文件.

在启动ndk-gdb时,似乎没有任何.so文件被加载.

我试图手动更改gdb.setup文件,但显然当启动gdbserver时,文件被替换为自己的版本;)

libmylibary上的nm -a -C显示了大量的符号.

它似乎没有加载任何.so文件,甚至没有在objs-debug文件夹中查找.啊!

任何帮助总是非常感激.

[root@xyz SviCore]# /Android/ndk/ndk-gdb --start --force --verbose
Android NDK installation path: /Android/ndk
Using default adb command: /Android/sdk/platform-tools/adb
ADB version found: Android Debug Bridge version 1.0.26
Using final ADB command: '/Android/sdk/platform-tools/adb'
Using auto-detected project path: .
Found package name: com.svi.core
ABIs targetted by application: armeabi
Device API Level: 10
Device CPU ABIs: armeabi-v7a armeabi
Compatible device ABI: armeabi
Found debuggable flag: true
Found device gdbserver: /data/data/com.svi.core/lib/gdbserver
Using gdb setup init: /root/XXXX/YYYY/ZZZZ/android/SviCore/libs/armeabi/gdb.setup
Using toolchain prefix: /Android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
Using app out directory: /root/XXXX/YYYY/ZZZZ/android/SviCore/obj/local/armeabi
Found data directory: '/data/data/com.svi.core'
Found first launchable activity: .SviCore
Launching activity: com.svi.core/.SviCore
## COMMAND: /Android/sdk/platform-tools/adb shell am start -n com.svi.core/.SviCore
## COMMAND: /Android/sdk/platform-tools/adb shell sleep 2
Found running PID: 2351
Launched gdbserver succesfully.
Setup network redirection
## COMMAND: /Android/sdk/platform-tools/adb forward tcp:5039 localfilesystem:/data/data/com.svi.core/debug-socket
## COMMAND: /Android/sdk/platform-tools/adb shell run-as com.svi.core lib/gdbserver +debug-socket --attach 2351
## COMMAND: /Android/sdk/platform-tools/adb pull /system/bin/app_process /root/XXXX/YYYY/ZZZZ/android/SviCore/obj/local/armeabi/app_process
Attached; pid = 2351
Listening on sockaddr socket debug-socket
65 KB/s (5720 bytes in 0.085s)
Pulled app_process from device/emulator.
## COMMAND: /Android/sdk/platform-tools/adb pull /system/lib/libc.so /root/XXXX/YYYY/ZZZZ/android/SviCore/obj/local/armeabi/libc.so
917 KB/s (273940 bytes in 0.291s)
Pulled libc.so from device/emulator.
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-elf-linux".
(no debugging symbols found)

最佳答案 似乎错误消息符号并不重要.在这种情况下,请确保使用-O0或-O1和-g -ggdb编译共享库,以帮助gdb在编译共享库后拾取这些调试符号.

如果你遇到问题(在gdb命令行上)’info sharedLibrary’,’where’或’backtrace’来帮助确定gdb是否真的能够找到它的位置.

点赞