[Dwarf-Discuss] Question about line number program

Michael Eager eager@eagercon.com
Thu Jan 27 23:03:50 GMT 2011


Magnus Sundell wrote:
> Hello all!

Hi Magnus!

> When processing the DWARF information of an ELF file, I ran into a line number program as
> clarified below (hope it shows up nice without too lousy formatting). I have tried reading the
> DWARF2, 3 and 4 specifications and had a quick peek at the libdwarf source code, but could not
> really determine how to interpret the actual line number program.

To help understand what you are doing, please tell us a bit more:

   What processor are you using?
   What compiler are you using?
   What version of DWARF does it generate?
   What are you using to process the DWARF info?
   What are you trying to achieve?

> 1) Could someone reveal to me, maybe through the below example, what the structure of the line
> program "entries" are? 

My first suggestion is that you use a tool like readelf (in the GNU Binutils
package) or dwarfdump (in libdwarf).  (Why spend time trying to parse the
DWARF data when there are programs which do this for you?)

> 2) How should the first entry, beginning with 0x00 0x05 be interpreted?
> The page "http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=34445" would make me
> want to interpret the 0x00 as DW_OP_xxx and 0x05 as DW_LNS_set_column. However this does not seem
> to make sense. I also considered the 0x00 belonging to the end of the file list, however 0x05 as
> a DW_OP_xxx does not make sense, either.

The best aid to interpreting DWARF is the standard, available
at http://dwarfstd.org, not an email thread from 2005.  Take
a look at Chapter 7. Data Representation.

-- 
Michael Eager	 eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077





More information about the Dwarf-discuss mailing list