From: Paul Gilliam <pgilliam@us.ibm.com>
To: gdb@sources.redhat.com
Subject: looking for ppc64 breakpoint address details
Date: Tue, 10 May 2005 20:38:00 -0000 [thread overview]
Message-ID: <200505101343.28903.pgilliam@us.ibm.com> (raw)
GDB gets it right, but ltrace gets it wrong.
After attaching to a process, ltrace sets breakpoints at the beginning of library funcitons.
It finds the address of where to stick a breakpoint as follows:
* Using /proc, find executable for the process.
* From the plt relocations, find the address of plt's.
* If the runtime loader has not initialized the plt, it's first word is 0.
* If it has, then the first word is the address of the function.
This seems to work most of the time, but a user came up with a situation where it doesn't.
The user wants to use ltrace to track all the 'memcpy' calls. When he attaches to his process
with ltrace, he sees lots of library calls, but not memcpy. When he attaches to the process with
GDB and sets a breakpoint at memcpy, the breakpoint is hit.
Here's the problem: ltrace came up with one address for memcpy and GDB came up with a
different address.
How does GDB get the address to set the breakpoint at?
I have been going through the source for GDB, starting with elfread.c, ppc-linux-nat.c and others.
Any help would be appreciated.
-=# Paul #=-
next reply other threads:[~2005-05-10 20:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-10 20:38 Paul Gilliam [this message]
2005-05-10 21:27 ` Andreas Schwab
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=200505101343.28903.pgilliam@us.ibm.com \
--to=pgilliam@us.ibm.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