From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,dd8385cbf9e09a72 X-Google-Attributes: gidf678f,public X-Google-Thread: fee84,dd8385cbf9e09a72 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-01-04 07:04:58 PST Path: nntp.gmd.de!newsserver.jvnc.net!news.cac.psu.edu!news.pop.psu.edu!psuvax1!uwm.edu!spool.mu.edu!bloom-beacon.mit.edu!crl.dec.com!crl.dec.com!nntpd.lkg.dec.com!pa.dec.com!virrus.zko.dec.com!diewald From: diewald@virrus.zko.dec.com (Jeff Diewald) Newsgroups: comp.unix.osf.misc,comp.unix.osf.osf1 Subject: Re: Need help at extracting debug line info from executable. Date: 4 Jan 1995 14:25:08 GMT Organization: Digital Equipment Corporation Distribution: world Message-ID: <3eeb44$c3f$1@usenet.pa.dec.com> References: Reply-To: diewald@virrus.zko.dec.com (Jeff Diewald) NNTP-Posting-Host: virrus.zko.dec.com X-Newsreader: mxrn 6.18-9 Xref: nntp.gmd.de comp.unix.osf.misc:2235 comp.unix.osf.osf1:7088 In article , mark@ncgrafix.demon.co.uk (Mark Wassell) writes: |> |>In article 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.