This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
BFD for stack trace
- To: binutils at sourceware dot cygnus dot com
- Subject: BFD for stack trace
- From: David Greene <greened at eecs dot umich dot edu>
- Date: Wed, 12 Apr 2000 09:36:03 -0500 (EST)
- Reply-To: greened at eecs dot umich dot edu
I've been searching the sourceware archives of the
binutils and bfd mailing lists (is the bfd list even
active?), but I can't find an answer to my question.
The BFD documentation, as we all know, if far, far from
complete. Specifically, there is no information on
how to access the debugging symbols from a object
file. I am using Linux/egcs-1.1.1 (g++).
Here's what I want to do:
1. Read in the object file and get the address range
for every function - where it starts and ends.
2. Given a program counter, figure out the source file
and line number corresponding to the PC.
3. Read that source file and print the relavent lines.
I already have 1 implemented in a very crude fashion. I
think the debugging symbols contain the necessary information
to get a more accurate picture.
For 2, I am currently piping commands into gdb. This is
very wasteful, because all I want to do is print a stack
trace for the program.
Is there information I can read somewhere, or can someone
help me out?
Thanks!
-Dave
--
"Some little people have music in them, but Fats, he was all music,
and you know how big he was." -- James P. Johnson