1
votes

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.

1
I further figured out that the problem is that the GDB is not reading the symbols at all as is evident from the output of "info shared" in the above post. I overlooked this. I am currently looking into "why GDB is not loading the symbols inspite of the shared library having it"isud

1 Answers

-2
votes

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