[Q] loading a shared library at a gdb breakpoint
Bharadwaj Yadavalli
bharadwaj.yadavalli@hp.com
Wed Dec 3 18:48:00 GMT 2003
Hi,
How can I do the following at a breakpoint in gdb (on Linux)?
- load a shared library (say libfoo.so) into the process
memory; libfoo.so is not loaded by the running
application being debugged.
- call a function defined in libfoo.so?
add-symbol-file file address doesn't seem to work.
info shared does not list the library (see below)
-------------
(gdb) info shared
>From To Syms Read Shared Object Library
0x40017800 0x40017b04 Yes ./libentry.so
0x42015380 0x421132e8 Yes /lib/tls/libc.so.6
0x40000bd0 0x40011acf Yes /lib/ld-linux.so.2
(gdb) add-shared-symbol-file libfoo.so
This command is not available in this configuration of GDB.
(gdb) add-symbol-file libfoo.so 0x40018000
add symbol table from file "libfoo.so" at
.text_addr = 0x40018000
(y or n) y
Reading symbols from libfoo.so...done.
Error in re-setting breakpoint 1:
Function "main" not defined.
(gdb) info shared
>From To Syms Read Shared Object Library
0x40017800 0x40017b04 Yes ./libentry.so
0x42015380 0x421132e8 Yes /lib/tls/libc.so.6
0x40000bd0 0x40011acf Yes /lib/ld-linux.so.2
-----------------
Thanks in advance for your help,
Bharadwaj
More information about the Gdb
mailing list