This is the mail archive of the gdb@sources.redhat.com 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]

looking for ppc64 breakpoint address details


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 #=-


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