简体   繁体   中英

GDB: Attaching source files belonging to a shared library

All,

I am running GDB remotely(client on host, gdbserver running on target). I want to set a break point in a shared library. The shared library is local to the path where i run GDB from. I see that the debugger is setting a break point:

#

No shared libraries loaded at this time. (gdb) b openapiClientRegister Breakpoint 1 at 0x100211d4 (gdb) c Continuing.

 Do you need "set solib-search-path" or "set sysroot"? Breakpoint 1, 0x100211d4 in openapiClientRegister@plt () (gdb) info shared From To Syms Read Shared Object Library No linux-vdso32.so.1 No /mnt/application/libproc_libs.so No **/mnt/application/libopenclt.so** 0x0ff46260 0x0ff51b54 Yes (*) /lib/libpthread.so.0 0x0ff1a8ac 0x0ff1ec70 Yes (*) /lib/librt.so.1 0x0fef5aa8 0x0fef6adc Yes (*) /lib/libdl.so.2 0x0fd90df4 0x0fe8b064 Yes (*) /lib/libc.so.6 No /lib/ld.so.1 (*): Shared library is missing debugging information. 
#

I can see that the library has debug information(shown in bold). When the program is run, the breakpoint is hit. But GDB is not able to step through the code as it does not find the file that contains the code. I tried adding the source directory containing the file through the "directory " command but still no luck.

Can you point me to the possible errors in my procedure? What may i be missing.

Thanks in advance.

Compile you code Debugging symbols like " gcc -g " -g option will include debugging info in your compiled file. then it will show you symbols.

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