简体   繁体   中英

Android / GDB - Headaches - cannot find debug symbols

GDB is starting to give me a headache. There seems to be something weird going on with the way GDB works.

obj/local/armeabi/ contains both a list of all the .so files used in the project which are NOT stripped as well as a directory called objs-debug which contains a bunch of .o and .od files.

Upon starting up ndk-gdb it seems none of the .so files are even loaded.

I've tried to manually change the gdb.setup file, but apparently when the gdbserver is launched the file is replaced with its own version of things ;)

nm -a -C on libmylibary.so reveals a ton of symbols.

It does NOT seem to be loading any .so files or even looking in the objs-debug folder. Ugh!

Any help is as always greatly appreciated.

[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)

尝试将以下内容添加到您的gdb.setup文件中:

 set solib-search-path ./obj/local/armeabi

It seems the error message symbols didn't really matter. In this case, make sure your shared libraries are compiled with -O0 or -O1 and -g -ggdb to help gdb pickup these debug symbols after your shared library is compiled.

If you are having issues run (on the gdb command line) 'info sharedLibrary', 'where' or 'backtrace' to help determine if gdb is actually able to find where it is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM