Debug shared libraries remotely using gdb / gdbserver

My question is how to debug the application remotely on the embedded arm processor using gdb / gdbserver.

I can debug the application myself, but the application is dynamically linked to a shared library that implements its own communication protocol. I want to be able to set breakpoints in shared library functions, so try to figure out some issues with device discovery.

I made sure that the library is combined with debugging symbols and loaded by gdb on the host side, I can list the functions in the library and even set breakpoints, but as soon as I try to start the application, I get an error message:

Cannot insert breakpoint X.
Error accessing memory address : Input/output error.

where X is the breakpoint number in gdb and is an address that may be small in order to be valid. I use the new library on both the target and the host computer, but through mount -o bind newlib oldlibon the target side with mount nfs.
Does anyone have an idea of ​​what might be wrong? Thanks in advance.

+3
source share
4 answers

Wild hunch: you uploaded the shared library to the host GDBat the wrong address.

, GDB, "set stop-on-solib-event on", (info shared ), .

0

2009 , , :

@ stop-on-solib-event. ; NDK r8d solibs.

@Brent Piddy , stop-on-solib-event gdbserver. , r8c. , NDK GDB, .

+6

, .

set breakpoint pending on

, "set stop-on-solib-event on" gdbserver, gdbserver / solib. solib-search-path sysroot, gdb .

0

main, set solib-search-path .

, gdbserver , . main GDB.

More: Debugging shared libraries with gdbserver

0
source

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


All Articles