有没有一种方法可以使用gdb调试应用程序的共享库?

时间:2019-01-18 20:08:57

标签: debugging gdb gdbserver

我正在尝试调试应用程序调用的共享库,以便可以看到其中的过程。

这是我设置gdb调试的步骤:

adb forward tcp:6666 tcp:6666


gdbserver :6666 --attach 9750
Attached; pid = 9750
gdbserver: Unable to determine the number of hardware watchpoints . 
available.
gdbserver: Unable to determine the number of hardware breakpoints 
available.
Listening on port 8888

(gdb) target remote :8888
Remote debugging using :8888
Reading /system/bin/app_process32_xposed from remote target...
warning: File transfers from remote targets can be slow. Use "set 
sysroot" to access files locally instead.
Reading /system/bin/app_process32_xposed from remote target...
Reading symbols from target:/system/bin/app_process32_xposed...Reading /system/bin/.debug/app_process32_xposed from remote target...
(no debugging symbols found)...done.
Reading /system/bin/linker from remote target...
Reading /system/bin/linker from remote target...
Reading symbols from target:/system/bin/linker...Reading /system/bin/.debug/linker from remote target...
(no debugging symbols found)...done.
0xe61e1068 in ?? ()
(gdb) set solib-search-path /Users/User/App/App_lib/arm
Reading /system/bin/linker from remote target...
Reading /system/bin/linker from remote target...
Reading /system/bin/linker from remote target...
Reading symbols from target:/system/bin/linker...Reading /system/bin/.debug/linker from remote target...
(gdb) info sharedLibrary
From        To          Syms Read   Shared Object Library
0xe7ada440  0xe7b28bbc  Yes (*)     target:/system/bin/linker
(*): Shared library is missing debugging information.

当我继续操作时,会得到以下结果。

Thread 1 "APP" received signal SIGSEGV, Segmentation fault.
0x732b225a in ?? ()

调试应用程序时我做错了什么?

0 个答案:

没有答案