This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


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

BFD for stack trace


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


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