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]

Debugging a shared library through gdbserver


I am debugging a shared library made by myself through gdbserver. After
searching the mail list,
I think the gdb can be used to debug a shared library. However, when I debug
my shared library by
following steps, I got error to step through the source code
(user_str_to_id()) in my shared library.
Could anybody instruct me to do it?

Thank you very much
Dennis

# load my executable file
(gdb) add-symbol-file console
add symbol table from file "console" at
# load my shared library
(gdb) add-symbol-file lib/libmylib.so.1.0.1
add symbol table from file "lib/libmylib.so.1.0.1" at
(gdb) b clih_login
Breakpoint 1 at 0x10016238: file sysui.c, line 289.
(gdb) c

Breakpoint 1, clih_login (handle=268700768, argc=2, argv=0x10041840) at
sysui.c:289
(gdb) next
# set a breakpoint in my shared library
(gdb) b user_str_to_id
Breakpoint 2 at 0xb05c: file utility.c, line 418.
# then I got trouble here!!!
(gdb) step
Warning:
Cannot insert breakpoint 2.
Error accessing memory address 0xb05c: Input/output error.

(gdb)


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