Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: diewald@virrus.zko.dec.com (Jeff Diewald)
Subject: Re: Need help at extracting debug line info from executable.
Date: 4 Jan 1995 14:25:08 GMT	[thread overview]
Message-ID: <3eeb44$c3f$1@usenet.pa.dec.com> (raw)
In-Reply-To: D1trMI.DDG@ncgrafix.demon.co.uk


In article <D1trMI.DDG@ncgrafix.demon.co.uk>, mark@ncgrafix.demon.co.uk (Mark Wassell) writes:
|>
|>In article <D1J1BD.2LF@world.std.com> steveo@world.std.com (Steven W Orr) 
|>wrote:
|>
|>>Running Alpha OSF1 and I need to access the debug line data in the
|>>ECOFF executable. Specifically, I need to perform the only two
|>>operations that are possible:
|>
|>I'm also trying to do something similar (see below) but haven't really got much
|>further but an idea I did have was to look at the source code for gdb (the GNU 
|>debugger) for some ideas on how to extract debug information.
|> 
|>> ..am left with that confused and empty 
|>Yes, I also have this confused and empty feeling when reading the documentation.

Trying to make sense of the debug symbol table information is a *much* bigger 
job than anyone ever expects.  There's no good, simple answer, even though
there should be.  I ought to know - I'm one of the DECladebug developers 
responsible for maintaining and improving the symbol table support in the
debugger.  The exact details of the information in the symbol table vary
from compiler to compiler and sometimes even from version of compiler to 
version of compiler.  Everyone interprets the "COFF standard" in different
ways.

You might ask yourself if there's another way to get the information you
want or need.  Can you pre/post-process the source to produce data that's
easier to access and use?  Why do you want this line information?  Is it
something you can get the compiler to tell you using __LINE__?

If you still think you need to get at this data, has someone already written
code you can use?  Does the FSF binutils package contain what you need?  
Do you need a class library that supports these features?  (DECladebug is
implemented as a class library.  There's a paper that was presented at
OOPSLA 93 entitled 'Experiences and Using an Object-Oriented Library for
Program Manipulation' by Tim Bingham, David Husson, and Nancy Hobbs that
you might find enlightening.)

|>
|>What I'm trying to do is to write some code that prints a calling trace of a 
|>running program on demand. Using the ld* man pages I have managed to
|>come up with something that converts a pc into a function and that can skip 
|>back through the stack to print a trace. However, if there are functions from
|>shared libraries in the way then it fails (as pc>function and frame 
|>information won't be stored in the executable file). 

Doing stack walks on Alpha is even more of a challenge, due the calling
standard.  Stack frames are not always full frames.  There are other 
complications; you've only discovered one of the cases.  Again - this is 
something best left to someone who has access to all the details.  
-----------------------------------------------------------------------------
	Jeff Diewald			EASYNET:   VIRRUS::DIEWALD
	DECladebug group		INTERNET:  diewald@virrus.zko.dec.com
	Digital Equipment Corp.

Note: I don't read every article in this group.  If you have debugger 
questions, I may be able to get you an answer.  You're much more likely to 
get an answer if you put "Debug" somewhere in your subject line.


  reply	other threads:[~1995-01-04 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-12-28 15:21 Need help at extracting debug line info from executable Steven W Orr
1995-01-03 10:25 ` Mark Wassell
1995-01-04 14:25   ` Jeff Diewald [this message]
1995-01-10 16:18   ` Tim Lucia
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox