I am trying to remotely debug a clean C program on an Android device. The Android device (target) is connected via USB to the host machine.
What I did: The following files were copied from target : /system/lib , /vendor/lib , /system/bin/app_process and /system/bin/linker .
Goal:
- Copied
gdbserver from the NDK to the target device. - Submitted by
exe I want to debug - running gdb server in target mode using
./gdbserver :5039 exec- it basically executes this process and gets a
pid
Leading:
- enabled
adb forward tcp:5039 tcp:5039 - runned:
arm-eabi-gcc exec . - Then in gdb:
set solib-search-path ... , with libraries that I pulled earlier from targettarget remote :5039
arm-eabi-gcc can connect to a remote process and even continue ( C ) execution. However, I cannot set breakpoints. If so, then I get the following error: Cannot access memory at address xxx .
Did I miss something?
Thanks.
source share