BFD for stack trace
David Greene
greened@eecs.umich.edu
Wed Apr 12 07:36:00 GMT 2000
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
More information about the Binutils
mailing list