Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* [Q] loading a shared library at a gdb breakpoint
@ 2003-12-03 18:48 Bharadwaj Yadavalli
  2003-12-03 18:57 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Bharadwaj Yadavalli @ 2003-12-03 18:48 UTC (permalink / raw)
  To: gdb

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-12-03 18:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-03 18:48 [Q] loading a shared library at a gdb breakpoint Bharadwaj Yadavalli
2003-12-03 18:57 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox