From: Bharadwaj Yadavalli <bharadwaj.yadavalli@hp.com>
To: gdb@sources.redhat.com
Subject: [Q] loading a shared library at a gdb breakpoint
Date: Wed, 03 Dec 2003 18:48:00 -0000 [thread overview]
Message-ID: <20031203184820.GC28869@java.zko.dec.com> (raw)
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
next reply other threads:[~2003-12-03 18:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-03 18:48 Bharadwaj Yadavalli [this message]
2003-12-03 18:57 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031203184820.GC28869@java.zko.dec.com \
--to=bharadwaj.yadavalli@hp.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox