This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Debugging a shared library through gdbserver


>
> Why are you doing any of this?  Please tell us where you saw
> suggestions to use add-symbol-file in this way, so that we can correct
> them.
>
> Please take a look at "set solib-absolute-prefix".  Use that, and
> the "file" command, before connecting to gdbserver and everything
> should work automatically.
>
> -- 
> Daniel Jacobowitz
> CodeSourcery
>
>
Hi Daniel

Nobody told me to do this. I just learned add-symbol-file from u-boot
document to relocate
program base. I tried some commands in gdb user's manual then I think this
command has result most
close to my expectation. Anyway, this is totally my fault.

I tried to follow your hint, shown as blow. Now, I can set a breakpoint in
the shared library and make
the program stop there. However, I still can not see the source code. (I am
using DDD with gdb.)
Am I still doing something wrong?

Thank you
Dennis

# my shared library is in lib/
(gdb) set solib-absolute-prefix lib
(gdb) file console
(gdb) target remote 10.0.2.3:2001
0x0fd39fac in ?? ()
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
(gdb) b user_str_to_id
Breakpoint 1 at 0x10040040
(gdb) c

Breakpoint 1, 0x10040040 in ?? ()
# the program stop here without displaying source code on screen.
(gdb)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]