[Dwarf-Discuss] Question about line number program

Magnus Sundell mankku86 at yahoo.se
Thu Jan 27 12:43:13 PST 2011


Hello all!

First post to this list.

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.

Thus, I would like to ask the following questions:

1) Could someone reveal to me, maybe through the below example, what the structure of the line program "entries" are?
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.


So, I thought that I'd try to avoid wasting time by posting to this list. I tried searching the net for a DWARF forum, but this was the closest that I got. I hope that no one will feel badly about me posting this kind of question here?

Thanks for reading the message,

// Magnus Sundell


Example follows:


=== Line Number Program Header ===
78 01 00 00 
02 00 
16 01 00 00 
02 
01 
fb 
0e 
0d 
00 01 01 01 01 00 00 00 01 00 00 01 
=== Include dirs ===
65 3a 2f 79 61 67 61 72 74 6f 2f 6c 69 62 2f 67 63 63 2f 2e 2e 2f 2e 2e 2f 61 72 6d 2d 6e 6f 6e 65 2d 65 61 62 69 2f 73 79 73 2d 69 6e 63 6c 75 64 65 00 
2e 2f 48 41 4c 00 
2e 2f 43 6f 6d 6d 6f 6e 00 
2e 2f 44 72 69 76 65 72 73 2f 4c 45 44 00 
2e 2f 52 54 4f 53 2f 46 72 65 65 52 54 4f 53 2f 69 6e 63 6c 75 64 65 00 
2e 2f 52 54 4f 53 2f 4f 53 41 62 73 74 72 61 63 74 69 6f 6e 00 
2e 2f 50 72 6f 74 6f 63 6f 6c 73 2f 55 54 50 00 
00 
=== File names ===
6d 61 69 6e 2e 63 00 00 00 00 
73 74 64 69 6e 74 2e 68 00 01 00 00 
73 74 6d 33 32 66 31 30 78 2e 68 00 02 00 00 
43 6f 6d 6d 6f 6e 54 79 70 65 73 2e 68 00 03 00 00 
4c 45 44 44 72 69 76 65 72 2e 68 00 04 00 00 
74 61 73 6b 2e 68 00 05 00 00 
4f 53 41 62 73 74 72 61 63 74 2e 68 00 06 00 00 
55 54 50 2e 68 00 07 00 00 
63 6f 72 65 5f 63 6d 33 2e 68 00 02 00 00 
00 
=== Line Number Program begins here ===
00 05 02 0c 01 00 
08 03 85 01 01 7a 59 68 00 
02 04 01 b8 7c 68 00 
02 04 01 80 7c 2f 85 2f 30 30 30 30 2f 4d 30 4d 30 4d 32 ae 32 ae 30 32 00 
02 04 01 4b 03 0f 2e 5a 5b 2f 5a 03 0d 2e 3f 3d 08 59 3f 00 
02 04 01 4d 00 
02 04 01 4c 5a 76 30 30 30 4b 67 5a 4c 4c 51 02 04 00 
01 01
=== End of LNP, the next octet belongs to next LNP header ===





More information about the Dwarf-Discuss mailing list