Android / GDB - Headaches - Cannot Find Debug Symbols

GDB is starting to give me a headache. Something seems to be happening with the way GDB works.

obj / local / armeabi / contains as a list of all .so files used in the project that are NOT deleted, as well as a directory named objs-debug that contains a bunch of .o and .od files.

When you run ndk-gdb, it seems that none of the .so files are even loaded.

I tried to manually modify the gdb.setup file, but apparently when starting gdbserver the file is replaced with its version of things;)

nm -a -C on libmylibary.so shows a ton of characters.

It does not seem to download the .so files, or even look for the objs-debug folder. Ugh!

Any help is always 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) 
+4
source share
2 answers

It seems that the error message characters do not really matter. In this case, make sure your shared libraries are compiled with -O0 or -O1 and -g -ggdb to help gdb select these debug symbols after compiling the shared library.

If you are having problems (on the gdb command line), "info sharedLibrary", "where" or "backtrace" to determine if gdb can really find where it is.

+1
source

Try adding the following to the gdb.setup file:

  set solib-search-path ./obj/local/armeabi 
+1
source

Source: https://habr.com/ru/post/1369563/


All Articles