1#!/usr/local/bin/bash
2# Copyright (C) 2013, 2018 Red Hat, Inc.
3# This file is part of elfutils.
4#
5# This file is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# elfutils is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18. $srcdir/test-subr.sh
19
20# Tests readelf --debug-dump=line and --debug-dump=decodedline
21# See run-readelf-aranges for testfiles.
22
23testfiles testfilefoobarbaz
24
25testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=line testfilefoobarbaz <<EOF
26
27DWARF section [30] '.debug_line' at offset 0x15f6:
28
29Table at offset 0:
30
31 Length:                         83
32 DWARF version:                  2
33 Prologue length:                43
34 Address size:                   4
35 Segment selector size:          0
36 Min instruction length:         1
37 Max operations per instruction: 1
38 Initial value if 'is_stmt':     1
39 Line base:                      -5
40 Line range:                     14
41 Opcode base:                    13
42
43Opcodes:
44  [ 1]  0 arguments
45  [ 2]  1 argument
46  [ 3]  1 argument
47  [ 4]  1 argument
48  [ 5]  1 argument
49  [ 6]  0 arguments
50  [ 7]  0 arguments
51  [ 8]  0 arguments
52  [ 9]  1 argument
53  [10]  0 arguments
54  [11]  0 arguments
55  [12]  1 argument
56
57Directory table:
58
59File name table:
60 Entry Dir   Time      Size      Name
61 1     0     0         0         foo.c
62 2     0     0         0         foobarbaz.h
63
64Line number statements:
65 [    35] extended opcode 2:  set address to 0x80482f0 <main>
66 [    3c] advance line by constant 15 to 16
67 [    3e] copy
68 [    3f] special opcode 159: address+10 = 0x80482fa <main+0xa>, line+1 = 17
69 [    40] special opcode 117: address+7 = 0x8048301 <main+0x11>, line+1 = 18
70 [    41] advance line by constant -9 to 9
71 [    43] special opcode 200: address+13 = 0x804830e <main+0x1e>, line+0 = 9
72 [    44] special opcode 48: address+2 = 0x8048310 <main+0x20>, line+2 = 11
73 [    45] special opcode 58: address+3 = 0x8048313 <main+0x23>, line-2 = 9
74 [    46] special opcode 48: address+2 = 0x8048315 <main+0x25>, line+2 = 11
75 [    47] special opcode 44: address+2 = 0x8048317 <main+0x27>, line-2 = 9
76 [    48] advance line by constant 13 to 22
77 [    4a] special opcode 46: address+2 = 0x8048319 <main+0x29>, line+0 = 22
78 [    4b] advance line by constant -13 to 9
79 [    4d] special opcode 60: address+3 = 0x804831c <main+0x2c>, line+0 = 9
80 [    4e] advance line by constant 12 to 21
81 [    50] special opcode 60: address+3 = 0x804831f <main+0x2f>, line+0 = 21
82 [    51] special opcode 61: address+3 = 0x8048322 <main+0x32>, line+1 = 22
83 [    52] advance address by 2 to 0x8048324
84 [    54] extended opcode 1:  end of sequence
85
86Table at offset 87:
87
88 Length:                         72
89 DWARF version:                  2
90 Prologue length:                28
91 Address size:                   4
92 Segment selector size:          0
93 Min instruction length:         1
94 Max operations per instruction: 1
95 Initial value if 'is_stmt':     1
96 Line base:                      -5
97 Line range:                     14
98 Opcode base:                    13
99
100Opcodes:
101  [ 1]  0 arguments
102  [ 2]  1 argument
103  [ 3]  1 argument
104  [ 4]  1 argument
105  [ 5]  1 argument
106  [ 6]  0 arguments
107  [ 7]  0 arguments
108  [ 8]  0 arguments
109  [ 9]  1 argument
110  [10]  0 arguments
111  [11]  0 arguments
112  [12]  1 argument
113
114Directory table:
115
116File name table:
117 Entry Dir   Time      Size      Name
118 1     0     0         0         bar.c
119
120Line number statements:
121 [    7d] extended opcode 2:  set address to 0x8048330 <nobar>
122 [    84] advance line by constant 12 to 13
123 [    86] copy
124 [    87] special opcode 19: address+0 = 0x8048330 <nobar>, line+1 = 14
125 [    88] advance address by 11 to 0x804833b
126 [    8a] extended opcode 1:  end of sequence
127 [    8d] extended opcode 2:  set address to 0x8048440 <bar>
128 [    94] advance line by constant 18 to 19
129 [    96] copy
130 [    97] special opcode 19: address+0 = 0x8048440 <bar>, line+1 = 20
131 [    98] advance line by constant -12 to 8
132 [    9a] special opcode 200: address+13 = 0x804844d <bar+0xd>, line+0 = 8
133 [    9b] advance line by constant 14 to 22
134 [    9d] special opcode 74: address+4 = 0x8048451 <bar+0x11>, line+0 = 22
135 [    9e] advance address by 1 to 0x8048452
136 [    a0] extended opcode 1:  end of sequence
137
138Table at offset 163:
139
140 Length:                         106
141 DWARF version:                  2
142 Prologue length:                43
143 Address size:                   4
144 Segment selector size:          0
145 Min instruction length:         1
146 Max operations per instruction: 1
147 Initial value if 'is_stmt':     1
148 Line base:                      -5
149 Line range:                     14
150 Opcode base:                    13
151
152Opcodes:
153  [ 1]  0 arguments
154  [ 2]  1 argument
155  [ 3]  1 argument
156  [ 4]  1 argument
157  [ 5]  1 argument
158  [ 6]  0 arguments
159  [ 7]  0 arguments
160  [ 8]  0 arguments
161  [ 9]  1 argument
162  [10]  0 arguments
163  [11]  0 arguments
164  [12]  1 argument
165
166Directory table:
167
168File name table:
169 Entry Dir   Time      Size      Name
170 1     0     0         0         baz.c
171 2     0     0         0         foobarbaz.h
172
173Line number statements:
174 [    d8] extended opcode 2:  set address to 0x8048340 <nobaz>
175 [    df] advance line by constant 12 to 13
176 [    e1] copy
177 [    e2] special opcode 19: address+0 = 0x8048340 <nobaz>, line+1 = 14
178 [    e3] advance address by 11 to 0x804834b
179 [    e5] extended opcode 1:  end of sequence
180 [    e8] extended opcode 2:  set address to 0x8048460 <baz>
181 [    ef] advance line by constant 18 to 19
182 [    f1] copy
183 [    f2] special opcode 74: address+4 = 0x8048464 <baz+0x4>, line+0 = 19
184 [    f3] special opcode 75: address+4 = 0x8048468 <baz+0x8>, line+1 = 20
185 [    f4] extended opcode 4:  set discriminator to 1
186 [    f8] special opcode 78: address+4 = 0x804846c <baz+0xc>, line+4 = 24
187 [    f9] special opcode 187: address+12 = 0x8048478 <baz+0x18>, line+1 = 25
188 [    fa] special opcode 87: address+5 = 0x804847d <baz+0x1d>, line-1 = 24
189 [    fb] special opcode 61: address+3 = 0x8048480 <baz+0x20>, line+1 = 25
190 [    fc] special opcode 101: address+6 = 0x8048486 <baz+0x26>, line-1 = 24
191 [    fd] special opcode 61: address+3 = 0x8048489 <baz+0x29>, line+1 = 25
192 [    fe] special opcode 87: address+5 = 0x804848e <baz+0x2e>, line-1 = 24
193 [    ff] advance line by constant -16 to 8
194 [   101] special opcode 46: address+2 = 0x8048490 <baz+0x30>, line+0 = 8
195 [   102] advance line by constant 20 to 28
196 [   104] special opcode 186: address+12 = 0x804849c <baz+0x3c>, line+0 = 28
197 [   105] advance line by constant -20 to 8
198 [   107] special opcode 88: address+5 = 0x80484a1 <baz+0x41>, line+0 = 8
199 [   108] advance line by constant 13 to 21
200 [   10a] advance address by constant 17 to 0x80484b2 <baz+0x52>
201 [   10b] special opcode 32: address+1 = 0x80484b3 <baz+0x53>, line+0 = 21
202 [   10c] advance address by 9 to 0x80484bc
203 [   10e] extended opcode 1:  end of sequence
204EOF
205
206testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=decodedline testfilefoobarbaz <<\EOF
207
208DWARF section [30] '.debug_line' at offset 0x15f6:
209
210 CU [b] foo.c
211  line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
212  /home/mark/src/tests/foobarbaz/foo.c (mtime: 0, length: 0)
213    16:0   S        0   0  0 0x080482f0 <main>
214    17:0   S        0   0  0 0x080482fa <main+0xa>
215    18:0   S        0   0  0 0x08048301 <main+0x11>
216     9:0   S        0   0  0 0x0804830e <main+0x1e>
217    11:0   S        0   0  0 0x08048310 <main+0x20>
218     9:0   S        0   0  0 0x08048313 <main+0x23>
219    11:0   S        0   0  0 0x08048315 <main+0x25>
220     9:0   S        0   0  0 0x08048317 <main+0x27>
221    22:0   S        0   0  0 0x08048319 <main+0x29>
222     9:0   S        0   0  0 0x0804831c <main+0x2c>
223    21:0   S        0   0  0 0x0804831f <main+0x2f>
224    22:0   S        0   0  0 0x08048322 <main+0x32>
225    22:0   S   *    0   0  0 0x08048323 <main+0x33>
226
227 CU [141] bar.c
228  line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
229  /home/mark/src/tests/foobarbaz/bar.c (mtime: 0, length: 0)
230    13:0   S        0   0  0 0x08048330 <nobar>
231    14:0   S        0   0  0 0x08048330 <nobar>
232    14:0   S   *    0   0  0 0x0804833a <nobar+0xa>
233
234    19:0   S        0   0  0 0x08048440 <bar>
235    20:0   S        0   0  0 0x08048440 <bar>
236     8:0   S        0   0  0 0x0804844d <bar+0xd>
237    22:0   S        0   0  0 0x08048451 <bar+0x11>
238    22:0   S   *    0   0  0 0x08048451 <bar+0x11>
239
240 CU [1dc] baz.c
241  line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
242  /home/mark/src/tests/foobarbaz/baz.c (mtime: 0, length: 0)
243    13:0   S        0   0  0 0x08048340 <nobaz>
244    14:0   S        0   0  0 0x08048340 <nobaz>
245    14:0   S   *    0   0  0 0x0804834a <nobaz+0xa>
246
247    19:0   S        0   0  0 0x08048460 <baz>
248    19:0   S        0   0  0 0x08048464 <baz+0x4>
249    20:0   S        0   0  0 0x08048468 <baz+0x8>
250    24:0   S        1   0  0 0x0804846c <baz+0xc>
251    25:0   S        0   0  0 0x08048478 <baz+0x18>
252    24:0   S        0   0  0 0x0804847d <baz+0x1d>
253    25:0   S        0   0  0 0x08048480 <baz+0x20>
254    24:0   S        0   0  0 0x08048486 <baz+0x26>
255    25:0   S        0   0  0 0x08048489 <baz+0x29>
256    24:0   S        0   0  0 0x0804848e <baz+0x2e>
257     8:0   S        0   0  0 0x08048490 <baz+0x30>
258    28:0   S        0   0  0 0x0804849c <baz+0x3c>
259     8:0   S        0   0  0 0x080484a1 <baz+0x41>
260    21:0   S        0   0  0 0x080484b3 <baz+0x53>
261    21:0   S   *    0   0  0 0x080484bb <baz+0x5b>
262
263EOF
264
265# A .debug_line table with mininum instruction length > 1.
266#
267# = hello.c
268# #include <stdio.h>
269#
270# int
271# main (int argc, char **argv)
272# {
273#   printf ("Hello, %s\n", (argc > 0
274# 			  ? argv[1]: "World"));
275#   return 0;
276# }
277#
278# clang version 5.0.1 (tags/RELEASE_501/final)
279# Target: powerpc64-unknown-linux-gnu
280# clang -g -O2 -o testfile-ppc64-min-instr hello.c
281testfiles testfile-ppc64-min-instr
282
283testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=line testfile-ppc64-min-instr <<\EOF
284
285DWARF section [29] '.debug_line' at offset 0xdf6:
286
287Table at offset 0:
288
289 Length:                         69
290 DWARF version:                  2
291 Prologue length:                30
292 Address size:                   8
293 Segment selector size:          0
294 Min instruction length:         4
295 Max operations per instruction: 1
296 Initial value if 'is_stmt':     1
297 Line base:                      -5
298 Line range:                     14
299 Opcode base:                    13
300
301Opcodes:
302  [ 1]  0 arguments
303  [ 2]  1 argument
304  [ 3]  1 argument
305  [ 4]  1 argument
306  [ 5]  1 argument
307  [ 6]  0 arguments
308  [ 7]  0 arguments
309  [ 8]  0 arguments
310  [ 9]  1 argument
311  [10]  0 arguments
312  [11]  0 arguments
313  [12]  1 argument
314
315Directory table:
316
317File name table:
318 Entry Dir   Time      Size      Name
319 1     0     0         0         hello.c
320
321Line number statements:
322 [    28] extended opcode 2:  set address to 0x100005a4 <main>
323 [    33] special opcode 22: address+0 = 0x100005a4 <main>, line+4 = 5
324 [    34] set column to 27
325 [    36] set prologue end flag
326 [    37] special opcode 19: address+0 = 0x100005a4 <main>, line+1 = 6
327 [    38] set column to 8
328 [    3a] special opcode 47: address+8 = 0x100005ac <main+0x8>, line+1 = 7
329 [    3b] set 'is_stmt' to 0
330 [    3c] advance line by constant -7 to 0
331 [    3e] special opcode 32: address+4 = 0x100005b0 <main+0xc>, line+0 = 0
332 [    3f] set column to 3
333 [    41] set 'is_stmt' to 1
334 [    42] special opcode 108: address+24 = 0x100005c8 <main+0x24>, line+6 = 6
335 [    43] special opcode 76: address+16 = 0x100005d8 <main+0x34>, line+2 = 8
336 [    44] advance address by 32 to 0x100005f8
337 [    46] extended opcode 1:  end of sequence
338EOF
339
340testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=decodedline testfile-ppc64-min-instr <<\EOF
341
342DWARF section [29] '.debug_line' at offset 0xdf6:
343
344 CU [b] hello.c
345  line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
346  /home/fedora/mjw/hello.c (mtime: 0, length: 0)
347     5:0   S        0   0  0 0x00000000100005a4 <main>
348     6:27  S P      0   0  0 0x00000000100005a4 <main>
349     7:8   S        0   0  0 0x00000000100005ac <main+0x8>
350     0:8            0   0  0 0x00000000100005b0 <main+0xc>
351     6:3   S        0   0  0 0x00000000100005c8 <main+0x24>
352     8:3   S        0   0  0 0x00000000100005d8 <main+0x34>
353     8:3   S   *    0   0  0 0x00000000100005f7 <main+0x53>
354
355EOF
356
357# Two tests for the same code but encoded using DWARF4 or DWARF5.
358# Output is identical except for the section offset and CU numbers.
359# See tests/testfile-dwarf-45.source.
360
361testfiles testfile-dwarf-4 testfile-dwarf-5
362
363testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=decodedline testfile-dwarf-4 << \EOF
364
365DWARF section [29] '.debug_line' at offset 0x1734:
366
367 CU [b] hello.c
368  line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
369  /var/tmp/hello/hello.c (mtime: 0, length: 0)
370    21:0   S        0   0  0 0x0000000000400510 <foo>
371    22:1   S        0   0  0 0x0000000000400510 <foo>
372    22:3            0   0  0 0x0000000000400510 <foo>
373    25:6            0   0  0 0x0000000000400514 <foo+0x4>
374    25:34  S        0   0  0 0x000000000040051a <foo+0xa>
375    25:3            0   0  0 0x000000000040051a <foo+0xa>
376    26:34           0   0  0 0x000000000040051e <foo+0xe>
377    25:1            1   0  0 0x0000000000400528 <foo+0x18>
378  /var/tmp/hello/hello.h (mtime: 0, length: 0)
379     7:18  S        0   0  0 0x000000000040052b <foo+0x1b>
380     9:3   S        0   0  0 0x000000000040052b <foo+0x1b>
381     9:3            0   0  0 0x000000000040052b <foo+0x1b>
382    10:6   S        0   0  0 0x000000000040052f <foo+0x1f>
383    10:5            0   0  0 0x000000000040052f <foo+0x1f>
384    12:7   S        0   0  0 0x0000000000400531 <foo+0x21>
385  /var/tmp/hello/hello.c (mtime: 0, length: 0)
386    10:3   S        0   0  0 0x0000000000400531 <foo+0x21>
387    12:3   S        0   0  0 0x0000000000400531 <foo+0x21>
388    12:3            0   0  0 0x0000000000400531 <foo+0x21>
389    13:6   S        0   0  0 0x0000000000400535 <foo+0x25>
390    13:5            0   0  0 0x0000000000400535 <foo+0x25>
391    15:7   S        0   0  0 0x0000000000400539 <foo+0x29>
392    22:3   S        0   0  0 0x0000000000400539 <foo+0x29>
393    22:3            0   0  0 0x0000000000400539 <foo+0x29>
394    23:6   S        0   0  0 0x000000000040053d <foo+0x2d>
395    23:5            0   0  0 0x000000000040053d <foo+0x2d>
396     9:12  S        0   0  0 0x0000000000400550 <baz>
397    10:1   S        0   0  0 0x0000000000400550 <baz>
398    12:3   S        0   0  0 0x0000000000400550 <baz>
399    12:3            0   0  0 0x0000000000400550 <baz>
400    13:9            0   0  0 0x0000000000400556 <baz+0x6>
401    15:7   S        0   0  0 0x000000000040055f <baz+0xf>
402    15:3            0   0  0 0x000000000040055f <baz+0xf>
403    15:7       *    0   0  0 0x0000000000400560 <baz+0x10>
404
405 CU [21c] world.c
406  line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
407  /var/tmp/hello/world.c (mtime: 0, length: 0)
408    15:0   S        0   0  0 0x0000000000400410 <main>
409    16:1   S        0   0  0 0x0000000000400410 <main>
410    17:3   S        0   0  0 0x0000000000400410 <main>
411    15:3            0   0  0 0x0000000000400410 <main>
412    17:1            0   0  0 0x0000000000400419 <main+0x9>
413    18:6   S        0   0  0 0x000000000040041e <main+0xe>
414    18:5            0   0  0 0x000000000040041e <main+0xe>
415    22:7   S        0   0  0 0x0000000000400421 <main+0x11>
416    22:3   S   *    0   0  0 0x000000000040042f <main+0x1f>
417
418     6:0   S        0   0  0 0x0000000000400570 <calc>
419     7:1   S        0   0  0 0x0000000000400570 <calc>
420     7:3            0   0  0 0x0000000000400570 <calc>
421     7:6            1   0  0 0x0000000000400575 <calc+0x5>
422     7:24           0   0  0 0x0000000000400578 <calc+0x8>
423    10:17  S        0   0  0 0x000000000040057d <calc+0xd>
424    10:3            0   0  0 0x000000000040057d <calc+0xd>
425  /var/tmp/hello/hello.h (mtime: 0, length: 0)
426    10:10           0   0  0 0x0000000000400583 <calc+0x13>
427  /var/tmp/hello/world.c (mtime: 0, length: 0)
428    10:7            0   0  0 0x0000000000400585 <calc+0x15>
429  /var/tmp/hello/hello.h (mtime: 0, length: 0)
430     7:10  S        0   0  0 0x0000000000400588 <calc+0x18>
431     9:3   S        0   0  0 0x0000000000400588 <calc+0x18>
432    10:3            0   0  0 0x0000000000400588 <calc+0x18>
433    12:7   S        0   0  0 0x000000000040058f <calc+0x1f>
434    12:3            0   0  0 0x000000000040058f <calc+0x1f>
435  /var/tmp/hello/world.c (mtime: 0, length: 0)
436    11:10           0   0  0 0x0000000000400598 <calc+0x28>
437    11:1       *    0   0  0 0x000000000040059a <calc+0x2a>
438
439EOF
440
441testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=decodedline testfile-dwarf-5 << \EOF
442
443DWARF section [29] '.debug_line' at offset 0x171f:
444
445 CU [c] hello.c
446  line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
447  /var/tmp/hello/hello.c (mtime: 0, length: 0)
448    21:0   S        0   0  0 0x0000000000400510 <foo>
449    22:1   S        0   0  0 0x0000000000400510 <foo>
450    22:3            0   0  0 0x0000000000400510 <foo>
451    25:6            0   0  0 0x0000000000400514 <foo+0x4>
452    25:34  S        0   0  0 0x000000000040051a <foo+0xa>
453    25:3            0   0  0 0x000000000040051a <foo+0xa>
454    26:34           0   0  0 0x000000000040051e <foo+0xe>
455    25:1            1   0  0 0x0000000000400528 <foo+0x18>
456  /var/tmp/hello/hello.h (mtime: 0, length: 0)
457     7:18  S        0   0  0 0x000000000040052b <foo+0x1b>
458     9:3   S        0   0  0 0x000000000040052b <foo+0x1b>
459     9:3            0   0  0 0x000000000040052b <foo+0x1b>
460    10:6   S        0   0  0 0x000000000040052f <foo+0x1f>
461    10:5            0   0  0 0x000000000040052f <foo+0x1f>
462    12:7   S        0   0  0 0x0000000000400531 <foo+0x21>
463  /var/tmp/hello/hello.c (mtime: 0, length: 0)
464    10:3   S        0   0  0 0x0000000000400531 <foo+0x21>
465    12:3   S        0   0  0 0x0000000000400531 <foo+0x21>
466    12:3            0   0  0 0x0000000000400531 <foo+0x21>
467    13:6   S        0   0  0 0x0000000000400535 <foo+0x25>
468    13:5            0   0  0 0x0000000000400535 <foo+0x25>
469    15:7   S        0   0  0 0x0000000000400539 <foo+0x29>
470    22:3   S        0   0  0 0x0000000000400539 <foo+0x29>
471    22:3            0   0  0 0x0000000000400539 <foo+0x29>
472    23:6   S        0   0  0 0x000000000040053d <foo+0x2d>
473    23:5            0   0  0 0x000000000040053d <foo+0x2d>
474     9:12  S        0   0  0 0x0000000000400550 <baz>
475    10:1   S        0   0  0 0x0000000000400550 <baz>
476    12:3   S        0   0  0 0x0000000000400550 <baz>
477    12:3            0   0  0 0x0000000000400550 <baz>
478    13:9            0   0  0 0x0000000000400556 <baz+0x6>
479    15:7   S        0   0  0 0x000000000040055f <baz+0xf>
480    15:3            0   0  0 0x000000000040055f <baz+0xf>
481    15:7       *    0   0  0 0x0000000000400560 <baz+0x10>
482
483 CU [218] world.c
484  line:col SBPE* disc isa op address (Statement Block Prologue Epilogue *End)
485  /var/tmp/hello/world.c (mtime: 0, length: 0)
486    15:0   S        0   0  0 0x0000000000400410 <main>
487    16:1   S        0   0  0 0x0000000000400410 <main>
488    17:3   S        0   0  0 0x0000000000400410 <main>
489    15:3            0   0  0 0x0000000000400410 <main>
490    17:1            0   0  0 0x0000000000400419 <main+0x9>
491    18:6   S        0   0  0 0x000000000040041e <main+0xe>
492    18:5            0   0  0 0x000000000040041e <main+0xe>
493    22:7   S        0   0  0 0x0000000000400421 <main+0x11>
494    22:3   S   *    0   0  0 0x000000000040042f <main+0x1f>
495
496     6:0   S        0   0  0 0x0000000000400570 <calc>
497     7:1   S        0   0  0 0x0000000000400570 <calc>
498     7:3            0   0  0 0x0000000000400570 <calc>
499     7:6            1   0  0 0x0000000000400575 <calc+0x5>
500     7:24           0   0  0 0x0000000000400578 <calc+0x8>
501    10:17  S        0   0  0 0x000000000040057d <calc+0xd>
502    10:3            0   0  0 0x000000000040057d <calc+0xd>
503  /var/tmp/hello/hello.h (mtime: 0, length: 0)
504    10:10           0   0  0 0x0000000000400583 <calc+0x13>
505  /var/tmp/hello/world.c (mtime: 0, length: 0)
506    10:7            0   0  0 0x0000000000400585 <calc+0x15>
507  /var/tmp/hello/hello.h (mtime: 0, length: 0)
508     7:10  S        0   0  0 0x0000000000400588 <calc+0x18>
509     9:3   S        0   0  0 0x0000000000400588 <calc+0x18>
510    10:3            0   0  0 0x0000000000400588 <calc+0x18>
511    12:7   S        0   0  0 0x000000000040058f <calc+0x1f>
512    12:3            0   0  0 0x000000000040058f <calc+0x1f>
513  /var/tmp/hello/world.c (mtime: 0, length: 0)
514    11:10           0   0  0 0x0000000000400598 <calc+0x28>
515    11:1       *    0   0  0 0x000000000040059a <calc+0x2a>
516
517EOF
518
519# After discarding the different offsets in the line number statements,
520# the remaining difference between 4 and 5 is (besides the header/length)
521# Just the representation of the directory and line tables:
522
523#  Directory table:
524# - /opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include
525# +      [path(line_strp)]
526# + 0     /var/tmp/hello (90)
527# + 1     /opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include (17)
528#
529#  File name table:
530# - Entry Dir   Time      Size      Name
531# - 1     0     0         0         hello.c
532# - 2     0     0         0         hello.h
533# - 3     1     0         0         stddef.h
534# +      [path(line_strp), directory_index(data1)]
535# + 0     hello.c (9),  0
536# + 1     hello.c (9),  0
537# + 2     hello.h (82),  0
538# + 3     stddef.h (0),  1
539#
540#  Directory table:
541# - /usr/include
542# +      [path(line_strp)]
543# + 0     /var/tmp/hello (90)
544# + 1     /usr/include (122)
545#
546#  File name table:
547# - Entry Dir   Time      Size      Name
548# - 1     0     0         0         world.c
549# - 2     0     0         0         hello.h
550# - 3     1     0         0         stdlib.h
551# +      [path(line_strp), directory_index(data1)]
552# + 0     world.c (114),  0
553# + 1     world.c (114),  0
554# + 2     hello.h (82),  0
555# + 3     stdlib.h (105),  1
556
557testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=line testfile-dwarf-4 << \EOF
558
559DWARF section [29] '.debug_line' at offset 0x1734:
560
561Table at offset 0:
562
563 Length:                         608
564 DWARF version:                  4
565 Prologue length:                119
566 Address size:                   8
567 Segment selector size:          0
568 Min instruction length:         1
569 Max operations per instruction: 1
570 Initial value if 'is_stmt':     1
571 Line base:                      -10
572 Line range:                     242
573 Opcode base:                    13
574
575Opcodes:
576  [ 1]  0 arguments
577  [ 2]  1 argument
578  [ 3]  1 argument
579  [ 4]  1 argument
580  [ 5]  1 argument
581  [ 6]  0 arguments
582  [ 7]  0 arguments
583  [ 8]  0 arguments
584  [ 9]  1 argument
585  [10]  0 arguments
586  [11]  0 arguments
587  [12]  1 argument
588
589Directory table:
590 /opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include
591
592File name table:
593 Entry Dir   Time      Size      Name
594 1     0     0         0         hello.c
595 2     0     0         0         hello.h
596 3     1     0         0         stddef.h
597
598Line number statements:
599 [    81] extended opcode 2:  set address to 0x400510 <foo>
600 [    8c] special opcode 43: address+0 = 0x400510 <foo>, line+20 = 21
601 [    8d] set column to 1
602 [    8f] extended opcode 2:  set address to 0x400510 <foo>
603 [    9a] special opcode 24: address+0 = 0x400510 <foo>, line+1 = 22
604 [    9b] set column to 3
605 [    9d] extended opcode 2:  set address to 0x400510 <foo>
606 [    a8] set 'is_stmt' to 0
607 [    a9] copy
608 [    aa] set column to 6
609 [    ac] extended opcode 2:  set address to 0x400514 <foo+0x4>
610 [    b7] special opcode 26: address+0 = 0x400514 <foo+0x4>, line+3 = 25
611 [    b8] set column to 34
612 [    ba] extended opcode 2:  set address to 0x40051a <foo+0xa>
613 [    c5] set 'is_stmt' to 1
614 [    c6] copy
615 [    c7] set column to 3
616 [    c9] extended opcode 2:  set address to 0x40051a <foo+0xa>
617 [    d4] set 'is_stmt' to 0
618 [    d5] copy
619 [    d6] set column to 34
620 [    d8] extended opcode 2:  set address to 0x40051e <foo+0xe>
621 [    e3] special opcode 24: address+0 = 0x40051e <foo+0xe>, line+1 = 26
622 [    e4] set column to 1
623 [    e6] extended opcode 2:  set address to 0x400528 <foo+0x18>
624 [    f1] extended opcode 4:  set discriminator to 1
625 [    f5] special opcode 22: address+0 = 0x400528 <foo+0x18>, line-1 = 25
626 [    f6] set column to 18
627 [    f8] extended opcode 2:  set address to 0x40052b <foo+0x1b>
628 [   103] set file to 2
629 [   105] set 'is_stmt' to 1
630 [   106] advance line by constant -18 to 7
631 [   108] copy
632 [   109] set column to 3
633 [   10b] extended opcode 2:  set address to 0x40052b <foo+0x1b>
634 [   116] special opcode 25: address+0 = 0x40052b <foo+0x1b>, line+2 = 9
635 [   117] set column to 3
636 [   119] extended opcode 2:  set address to 0x40052b <foo+0x1b>
637 [   124] set 'is_stmt' to 0
638 [   125] copy
639 [   126] set column to 6
640 [   128] extended opcode 2:  set address to 0x40052f <foo+0x1f>
641 [   133] extended opcode 4:  set discriminator to 0
642 [   137] set 'is_stmt' to 1
643 [   138] special opcode 24: address+0 = 0x40052f <foo+0x1f>, line+1 = 10
644 [   139] set column to 5
645 [   13b] extended opcode 2:  set address to 0x40052f <foo+0x1f>
646 [   146] set 'is_stmt' to 0
647 [   147] copy
648 [   148] set column to 7
649 [   14a] extended opcode 2:  set address to 0x400531 <foo+0x21>
650 [   155] set 'is_stmt' to 1
651 [   156] special opcode 25: address+0 = 0x400531 <foo+0x21>, line+2 = 12
652 [   157] set column to 3
653 [   159] extended opcode 2:  set address to 0x400531 <foo+0x21>
654 [   164] set file to 1
655 [   166] special opcode 21: address+0 = 0x400531 <foo+0x21>, line-2 = 10
656 [   167] set column to 3
657 [   169] extended opcode 2:  set address to 0x400531 <foo+0x21>
658 [   174] special opcode 25: address+0 = 0x400531 <foo+0x21>, line+2 = 12
659 [   175] set column to 3
660 [   177] extended opcode 2:  set address to 0x400531 <foo+0x21>
661 [   182] set 'is_stmt' to 0
662 [   183] copy
663 [   184] set column to 6
664 [   186] extended opcode 2:  set address to 0x400535 <foo+0x25>
665 [   191] set 'is_stmt' to 1
666 [   192] special opcode 24: address+0 = 0x400535 <foo+0x25>, line+1 = 13
667 [   193] set column to 5
668 [   195] extended opcode 2:  set address to 0x400535 <foo+0x25>
669 [   1a0] set 'is_stmt' to 0
670 [   1a1] copy
671 [   1a2] set column to 7
672 [   1a4] extended opcode 2:  set address to 0x400539 <foo+0x29>
673 [   1af] set 'is_stmt' to 1
674 [   1b0] special opcode 25: address+0 = 0x400539 <foo+0x29>, line+2 = 15
675 [   1b1] set column to 3
676 [   1b3] extended opcode 2:  set address to 0x400539 <foo+0x29>
677 [   1be] special opcode 30: address+0 = 0x400539 <foo+0x29>, line+7 = 22
678 [   1bf] set column to 3
679 [   1c1] extended opcode 2:  set address to 0x400539 <foo+0x29>
680 [   1cc] set 'is_stmt' to 0
681 [   1cd] copy
682 [   1ce] set column to 6
683 [   1d0] extended opcode 2:  set address to 0x40053d <foo+0x2d>
684 [   1db] set 'is_stmt' to 1
685 [   1dc] special opcode 24: address+0 = 0x40053d <foo+0x2d>, line+1 = 23
686 [   1dd] set column to 5
687 [   1df] extended opcode 2:  set address to 0x40053d <foo+0x2d>
688 [   1ea] set 'is_stmt' to 0
689 [   1eb] copy
690 [   1ec] set column to 12
691 [   1ee] extended opcode 2:  set address to 0x400550 <baz>
692 [   1f9] set 'is_stmt' to 1
693 [   1fa] advance line by constant -14 to 9
694 [   1fc] copy
695 [   1fd] set column to 1
696 [   1ff] extended opcode 2:  set address to 0x400550 <baz>
697 [   20a] special opcode 24: address+0 = 0x400550 <baz>, line+1 = 10
698 [   20b] set column to 3
699 [   20d] extended opcode 2:  set address to 0x400550 <baz>
700 [   218] special opcode 25: address+0 = 0x400550 <baz>, line+2 = 12
701 [   219] set column to 3
702 [   21b] extended opcode 2:  set address to 0x400550 <baz>
703 [   226] set 'is_stmt' to 0
704 [   227] copy
705 [   228] set column to 9
706 [   22a] extended opcode 2:  set address to 0x400556 <baz+0x6>
707 [   235] special opcode 24: address+0 = 0x400556 <baz+0x6>, line+1 = 13
708 [   236] set column to 7
709 [   238] extended opcode 2:  set address to 0x40055f <baz+0xf>
710 [   243] set 'is_stmt' to 1
711 [   244] special opcode 25: address+0 = 0x40055f <baz+0xf>, line+2 = 15
712 [   245] set column to 3
713 [   247] extended opcode 2:  set address to 0x40055f <baz+0xf>
714 [   252] set 'is_stmt' to 0
715 [   253] copy
716 [   254] set column to 7
717 [   256] extended opcode 2:  set address to 0x400561
718 [   261] extended opcode 1:  end of sequence
719
720Table at offset 612:
721
722 Length:                         450
723 DWARF version:                  4
724 Prologue length:                67
725 Address size:                   8
726 Segment selector size:          0
727 Min instruction length:         1
728 Max operations per instruction: 1
729 Initial value if 'is_stmt':     1
730 Line base:                      -10
731 Line range:                     242
732 Opcode base:                    13
733
734Opcodes:
735  [ 1]  0 arguments
736  [ 2]  1 argument
737  [ 3]  1 argument
738  [ 4]  1 argument
739  [ 5]  1 argument
740  [ 6]  0 arguments
741  [ 7]  0 arguments
742  [ 8]  0 arguments
743  [ 9]  1 argument
744  [10]  0 arguments
745  [11]  0 arguments
746  [12]  1 argument
747
748Directory table:
749 /usr/include
750
751File name table:
752 Entry Dir   Time      Size      Name
753 1     0     0         0         world.c
754 2     0     0         0         hello.h
755 3     1     0         0         stdlib.h
756
757Line number statements:
758 [   2b1] extended opcode 2:  set address to 0x400410 <main>
759 [   2bc] special opcode 37: address+0 = 0x400410 <main>, line+14 = 15
760 [   2bd] set column to 1
761 [   2bf] extended opcode 2:  set address to 0x400410 <main>
762 [   2ca] special opcode 24: address+0 = 0x400410 <main>, line+1 = 16
763 [   2cb] set column to 3
764 [   2cd] extended opcode 2:  set address to 0x400410 <main>
765 [   2d8] special opcode 24: address+0 = 0x400410 <main>, line+1 = 17
766 [   2d9] set column to 3
767 [   2db] extended opcode 2:  set address to 0x400410 <main>
768 [   2e6] set 'is_stmt' to 0
769 [   2e7] special opcode 21: address+0 = 0x400410 <main>, line-2 = 15
770 [   2e8] set column to 1
771 [   2ea] extended opcode 2:  set address to 0x400419 <main+0x9>
772 [   2f5] special opcode 25: address+0 = 0x400419 <main+0x9>, line+2 = 17
773 [   2f6] set column to 6
774 [   2f8] extended opcode 2:  set address to 0x40041e <main+0xe>
775 [   303] set 'is_stmt' to 1
776 [   304] special opcode 24: address+0 = 0x40041e <main+0xe>, line+1 = 18
777 [   305] set column to 5
778 [   307] extended opcode 2:  set address to 0x40041e <main+0xe>
779 [   312] set 'is_stmt' to 0
780 [   313] copy
781 [   314] set column to 7
782 [   316] extended opcode 2:  set address to 0x400421 <main+0x11>
783 [   321] set 'is_stmt' to 1
784 [   322] special opcode 27: address+0 = 0x400421 <main+0x11>, line+4 = 22
785 [   323] set column to 3
786 [   325] extended opcode 2:  set address to 0x400430 <_start>
787 [   330] extended opcode 1:  end of sequence
788 [   333] extended opcode 2:  set address to 0x400570 <calc>
789 [   33e] special opcode 28: address+0 = 0x400570 <calc>, line+5 = 6
790 [   33f] set column to 1
791 [   341] extended opcode 2:  set address to 0x400570 <calc>
792 [   34c] special opcode 24: address+0 = 0x400570 <calc>, line+1 = 7
793 [   34d] set column to 3
794 [   34f] extended opcode 2:  set address to 0x400570 <calc>
795 [   35a] set 'is_stmt' to 0
796 [   35b] copy
797 [   35c] set column to 6
798 [   35e] extended opcode 2:  set address to 0x400575 <calc+0x5>
799 [   369] extended opcode 4:  set discriminator to 1
800 [   36d] copy
801 [   36e] set column to 24
802 [   370] extended opcode 2:  set address to 0x400578 <calc+0x8>
803 [   37b] copy
804 [   37c] set column to 17
805 [   37e] extended opcode 2:  set address to 0x40057d <calc+0xd>
806 [   389] extended opcode 4:  set discriminator to 0
807 [   38d] set 'is_stmt' to 1
808 [   38e] special opcode 26: address+0 = 0x40057d <calc+0xd>, line+3 = 10
809 [   38f] set column to 3
810 [   391] extended opcode 2:  set address to 0x40057d <calc+0xd>
811 [   39c] set 'is_stmt' to 0
812 [   39d] copy
813 [   39e] set column to 10
814 [   3a0] extended opcode 2:  set address to 0x400583 <calc+0x13>
815 [   3ab] set file to 2
816 [   3ad] copy
817 [   3ae] set column to 7
818 [   3b0] extended opcode 2:  set address to 0x400585 <calc+0x15>
819 [   3bb] set file to 1
820 [   3bd] copy
821 [   3be] set column to 10
822 [   3c0] extended opcode 2:  set address to 0x400588 <calc+0x18>
823 [   3cb] set file to 2
824 [   3cd] set 'is_stmt' to 1
825 [   3ce] special opcode 20: address+0 = 0x400588 <calc+0x18>, line-3 = 7
826 [   3cf] set column to 3
827 [   3d1] extended opcode 2:  set address to 0x400588 <calc+0x18>
828 [   3dc] special opcode 25: address+0 = 0x400588 <calc+0x18>, line+2 = 9
829 [   3dd] set column to 3
830 [   3df] extended opcode 2:  set address to 0x400588 <calc+0x18>
831 [   3ea] set 'is_stmt' to 0
832 [   3eb] special opcode 24: address+0 = 0x400588 <calc+0x18>, line+1 = 10
833 [   3ec] set column to 7
834 [   3ee] extended opcode 2:  set address to 0x40058f <calc+0x1f>
835 [   3f9] set 'is_stmt' to 1
836 [   3fa] special opcode 25: address+0 = 0x40058f <calc+0x1f>, line+2 = 12
837 [   3fb] set column to 3
838 [   3fd] extended opcode 2:  set address to 0x40058f <calc+0x1f>
839 [   408] set 'is_stmt' to 0
840 [   409] copy
841 [   40a] set column to 10
842 [   40c] extended opcode 2:  set address to 0x400598 <calc+0x28>
843 [   417] set file to 1
844 [   419] special opcode 22: address+0 = 0x400598 <calc+0x28>, line-1 = 11
845 [   41a] set column to 1
846 [   41c] extended opcode 2:  set address to 0x40059b
847 [   427] extended opcode 1:  end of sequence
848EOF
849
850testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=line testfile-dwarf-5 << \EOF
851
852DWARF section [29] '.debug_line' at offset 0x171f:
853
854Table at offset 0:
855
856 Length:                         547
857 DWARF version:                  5
858 Prologue length:                56
859 Address size:                   8
860 Segment selector size:          0
861 Min instruction length:         1
862 Max operations per instruction: 1
863 Initial value if 'is_stmt':     1
864 Line base:                      -10
865 Line range:                     242
866 Opcode base:                    13
867
868Opcodes:
869  [ 1]  0 arguments
870  [ 2]  1 argument
871  [ 3]  1 argument
872  [ 4]  1 argument
873  [ 5]  1 argument
874  [ 6]  0 arguments
875  [ 7]  0 arguments
876  [ 8]  0 arguments
877  [ 9]  1 argument
878  [10]  0 arguments
879  [11]  0 arguments
880  [12]  1 argument
881
882Directory table:
883      [path(line_strp)]
884 0     /var/tmp/hello (90)
885 1     /opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include (17)
886
887File name table:
888      [path(line_strp), directory_index(data1)]
889 0     hello.c (9),  0
890 1     hello.c (9),  0
891 2     hello.h (82),  0
892 3     stddef.h (0),  1
893
894Line number statements:
895 [    44] extended opcode 2:  set address to 0x400510 <foo>
896 [    4f] special opcode 43: address+0 = 0x400510 <foo>, line+20 = 21
897 [    50] set column to 1
898 [    52] extended opcode 2:  set address to 0x400510 <foo>
899 [    5d] special opcode 24: address+0 = 0x400510 <foo>, line+1 = 22
900 [    5e] set column to 3
901 [    60] extended opcode 2:  set address to 0x400510 <foo>
902 [    6b] set 'is_stmt' to 0
903 [    6c] copy
904 [    6d] set column to 6
905 [    6f] extended opcode 2:  set address to 0x400514 <foo+0x4>
906 [    7a] special opcode 26: address+0 = 0x400514 <foo+0x4>, line+3 = 25
907 [    7b] set column to 34
908 [    7d] extended opcode 2:  set address to 0x40051a <foo+0xa>
909 [    88] set 'is_stmt' to 1
910 [    89] copy
911 [    8a] set column to 3
912 [    8c] extended opcode 2:  set address to 0x40051a <foo+0xa>
913 [    97] set 'is_stmt' to 0
914 [    98] copy
915 [    99] set column to 34
916 [    9b] extended opcode 2:  set address to 0x40051e <foo+0xe>
917 [    a6] special opcode 24: address+0 = 0x40051e <foo+0xe>, line+1 = 26
918 [    a7] set column to 1
919 [    a9] extended opcode 2:  set address to 0x400528 <foo+0x18>
920 [    b4] extended opcode 4:  set discriminator to 1
921 [    b8] special opcode 22: address+0 = 0x400528 <foo+0x18>, line-1 = 25
922 [    b9] set column to 18
923 [    bb] extended opcode 2:  set address to 0x40052b <foo+0x1b>
924 [    c6] set file to 2
925 [    c8] set 'is_stmt' to 1
926 [    c9] advance line by constant -18 to 7
927 [    cb] copy
928 [    cc] set column to 3
929 [    ce] extended opcode 2:  set address to 0x40052b <foo+0x1b>
930 [    d9] special opcode 25: address+0 = 0x40052b <foo+0x1b>, line+2 = 9
931 [    da] set column to 3
932 [    dc] extended opcode 2:  set address to 0x40052b <foo+0x1b>
933 [    e7] set 'is_stmt' to 0
934 [    e8] copy
935 [    e9] set column to 6
936 [    eb] extended opcode 2:  set address to 0x40052f <foo+0x1f>
937 [    f6] extended opcode 4:  set discriminator to 0
938 [    fa] set 'is_stmt' to 1
939 [    fb] special opcode 24: address+0 = 0x40052f <foo+0x1f>, line+1 = 10
940 [    fc] set column to 5
941 [    fe] extended opcode 2:  set address to 0x40052f <foo+0x1f>
942 [   109] set 'is_stmt' to 0
943 [   10a] copy
944 [   10b] set column to 7
945 [   10d] extended opcode 2:  set address to 0x400531 <foo+0x21>
946 [   118] set 'is_stmt' to 1
947 [   119] special opcode 25: address+0 = 0x400531 <foo+0x21>, line+2 = 12
948 [   11a] set column to 3
949 [   11c] extended opcode 2:  set address to 0x400531 <foo+0x21>
950 [   127] set file to 1
951 [   129] special opcode 21: address+0 = 0x400531 <foo+0x21>, line-2 = 10
952 [   12a] set column to 3
953 [   12c] extended opcode 2:  set address to 0x400531 <foo+0x21>
954 [   137] special opcode 25: address+0 = 0x400531 <foo+0x21>, line+2 = 12
955 [   138] set column to 3
956 [   13a] extended opcode 2:  set address to 0x400531 <foo+0x21>
957 [   145] set 'is_stmt' to 0
958 [   146] copy
959 [   147] set column to 6
960 [   149] extended opcode 2:  set address to 0x400535 <foo+0x25>
961 [   154] set 'is_stmt' to 1
962 [   155] special opcode 24: address+0 = 0x400535 <foo+0x25>, line+1 = 13
963 [   156] set column to 5
964 [   158] extended opcode 2:  set address to 0x400535 <foo+0x25>
965 [   163] set 'is_stmt' to 0
966 [   164] copy
967 [   165] set column to 7
968 [   167] extended opcode 2:  set address to 0x400539 <foo+0x29>
969 [   172] set 'is_stmt' to 1
970 [   173] special opcode 25: address+0 = 0x400539 <foo+0x29>, line+2 = 15
971 [   174] set column to 3
972 [   176] extended opcode 2:  set address to 0x400539 <foo+0x29>
973 [   181] special opcode 30: address+0 = 0x400539 <foo+0x29>, line+7 = 22
974 [   182] set column to 3
975 [   184] extended opcode 2:  set address to 0x400539 <foo+0x29>
976 [   18f] set 'is_stmt' to 0
977 [   190] copy
978 [   191] set column to 6
979 [   193] extended opcode 2:  set address to 0x40053d <foo+0x2d>
980 [   19e] set 'is_stmt' to 1
981 [   19f] special opcode 24: address+0 = 0x40053d <foo+0x2d>, line+1 = 23
982 [   1a0] set column to 5
983 [   1a2] extended opcode 2:  set address to 0x40053d <foo+0x2d>
984 [   1ad] set 'is_stmt' to 0
985 [   1ae] copy
986 [   1af] set column to 12
987 [   1b1] extended opcode 2:  set address to 0x400550 <baz>
988 [   1bc] set 'is_stmt' to 1
989 [   1bd] advance line by constant -14 to 9
990 [   1bf] copy
991 [   1c0] set column to 1
992 [   1c2] extended opcode 2:  set address to 0x400550 <baz>
993 [   1cd] special opcode 24: address+0 = 0x400550 <baz>, line+1 = 10
994 [   1ce] set column to 3
995 [   1d0] extended opcode 2:  set address to 0x400550 <baz>
996 [   1db] special opcode 25: address+0 = 0x400550 <baz>, line+2 = 12
997 [   1dc] set column to 3
998 [   1de] extended opcode 2:  set address to 0x400550 <baz>
999 [   1e9] set 'is_stmt' to 0
1000 [   1ea] copy
1001 [   1eb] set column to 9
1002 [   1ed] extended opcode 2:  set address to 0x400556 <baz+0x6>
1003 [   1f8] special opcode 24: address+0 = 0x400556 <baz+0x6>, line+1 = 13
1004 [   1f9] set column to 7
1005 [   1fb] extended opcode 2:  set address to 0x40055f <baz+0xf>
1006 [   206] set 'is_stmt' to 1
1007 [   207] special opcode 25: address+0 = 0x40055f <baz+0xf>, line+2 = 15
1008 [   208] set column to 3
1009 [   20a] extended opcode 2:  set address to 0x40055f <baz+0xf>
1010 [   215] set 'is_stmt' to 0
1011 [   216] copy
1012 [   217] set column to 7
1013 [   219] extended opcode 2:  set address to 0x400561
1014 [   224] extended opcode 1:  end of sequence
1015
1016Table at offset 551:
1017
1018 Length:                         441
1019 DWARF version:                  5
1020 Prologue length:                56
1021 Address size:                   8
1022 Segment selector size:          0
1023 Min instruction length:         1
1024 Max operations per instruction: 1
1025 Initial value if 'is_stmt':     1
1026 Line base:                      -10
1027 Line range:                     242
1028 Opcode base:                    13
1029
1030Opcodes:
1031  [ 1]  0 arguments
1032  [ 2]  1 argument
1033  [ 3]  1 argument
1034  [ 4]  1 argument
1035  [ 5]  1 argument
1036  [ 6]  0 arguments
1037  [ 7]  0 arguments
1038  [ 8]  0 arguments
1039  [ 9]  1 argument
1040  [10]  0 arguments
1041  [11]  0 arguments
1042  [12]  1 argument
1043
1044Directory table:
1045      [path(line_strp)]
1046 0     /var/tmp/hello (90)
1047 1     /usr/include (122)
1048
1049File name table:
1050      [path(line_strp), directory_index(data1)]
1051 0     world.c (114),  0
1052 1     world.c (114),  0
1053 2     hello.h (82),  0
1054 3     stdlib.h (105),  1
1055
1056Line number statements:
1057 [   26b] extended opcode 2:  set address to 0x400410 <main>
1058 [   276] special opcode 37: address+0 = 0x400410 <main>, line+14 = 15
1059 [   277] set column to 1
1060 [   279] extended opcode 2:  set address to 0x400410 <main>
1061 [   284] special opcode 24: address+0 = 0x400410 <main>, line+1 = 16
1062 [   285] set column to 3
1063 [   287] extended opcode 2:  set address to 0x400410 <main>
1064 [   292] special opcode 24: address+0 = 0x400410 <main>, line+1 = 17
1065 [   293] set column to 3
1066 [   295] extended opcode 2:  set address to 0x400410 <main>
1067 [   2a0] set 'is_stmt' to 0
1068 [   2a1] special opcode 21: address+0 = 0x400410 <main>, line-2 = 15
1069 [   2a2] set column to 1
1070 [   2a4] extended opcode 2:  set address to 0x400419 <main+0x9>
1071 [   2af] special opcode 25: address+0 = 0x400419 <main+0x9>, line+2 = 17
1072 [   2b0] set column to 6
1073 [   2b2] extended opcode 2:  set address to 0x40041e <main+0xe>
1074 [   2bd] set 'is_stmt' to 1
1075 [   2be] special opcode 24: address+0 = 0x40041e <main+0xe>, line+1 = 18
1076 [   2bf] set column to 5
1077 [   2c1] extended opcode 2:  set address to 0x40041e <main+0xe>
1078 [   2cc] set 'is_stmt' to 0
1079 [   2cd] copy
1080 [   2ce] set column to 7
1081 [   2d0] extended opcode 2:  set address to 0x400421 <main+0x11>
1082 [   2db] set 'is_stmt' to 1
1083 [   2dc] special opcode 27: address+0 = 0x400421 <main+0x11>, line+4 = 22
1084 [   2dd] set column to 3
1085 [   2df] extended opcode 2:  set address to 0x400430 <_start>
1086 [   2ea] extended opcode 1:  end of sequence
1087 [   2ed] extended opcode 2:  set address to 0x400570 <calc>
1088 [   2f8] special opcode 28: address+0 = 0x400570 <calc>, line+5 = 6
1089 [   2f9] set column to 1
1090 [   2fb] extended opcode 2:  set address to 0x400570 <calc>
1091 [   306] special opcode 24: address+0 = 0x400570 <calc>, line+1 = 7
1092 [   307] set column to 3
1093 [   309] extended opcode 2:  set address to 0x400570 <calc>
1094 [   314] set 'is_stmt' to 0
1095 [   315] copy
1096 [   316] set column to 6
1097 [   318] extended opcode 2:  set address to 0x400575 <calc+0x5>
1098 [   323] extended opcode 4:  set discriminator to 1
1099 [   327] copy
1100 [   328] set column to 24
1101 [   32a] extended opcode 2:  set address to 0x400578 <calc+0x8>
1102 [   335] copy
1103 [   336] set column to 17
1104 [   338] extended opcode 2:  set address to 0x40057d <calc+0xd>
1105 [   343] extended opcode 4:  set discriminator to 0
1106 [   347] set 'is_stmt' to 1
1107 [   348] special opcode 26: address+0 = 0x40057d <calc+0xd>, line+3 = 10
1108 [   349] set column to 3
1109 [   34b] extended opcode 2:  set address to 0x40057d <calc+0xd>
1110 [   356] set 'is_stmt' to 0
1111 [   357] copy
1112 [   358] set column to 10
1113 [   35a] extended opcode 2:  set address to 0x400583 <calc+0x13>
1114 [   365] set file to 2
1115 [   367] copy
1116 [   368] set column to 7
1117 [   36a] extended opcode 2:  set address to 0x400585 <calc+0x15>
1118 [   375] set file to 1
1119 [   377] copy
1120 [   378] set column to 10
1121 [   37a] extended opcode 2:  set address to 0x400588 <calc+0x18>
1122 [   385] set file to 2
1123 [   387] set 'is_stmt' to 1
1124 [   388] special opcode 20: address+0 = 0x400588 <calc+0x18>, line-3 = 7
1125 [   389] set column to 3
1126 [   38b] extended opcode 2:  set address to 0x400588 <calc+0x18>
1127 [   396] special opcode 25: address+0 = 0x400588 <calc+0x18>, line+2 = 9
1128 [   397] set column to 3
1129 [   399] extended opcode 2:  set address to 0x400588 <calc+0x18>
1130 [   3a4] set 'is_stmt' to 0
1131 [   3a5] special opcode 24: address+0 = 0x400588 <calc+0x18>, line+1 = 10
1132 [   3a6] set column to 7
1133 [   3a8] extended opcode 2:  set address to 0x40058f <calc+0x1f>
1134 [   3b3] set 'is_stmt' to 1
1135 [   3b4] special opcode 25: address+0 = 0x40058f <calc+0x1f>, line+2 = 12
1136 [   3b5] set column to 3
1137 [   3b7] extended opcode 2:  set address to 0x40058f <calc+0x1f>
1138 [   3c2] set 'is_stmt' to 0
1139 [   3c3] copy
1140 [   3c4] set column to 10
1141 [   3c6] extended opcode 2:  set address to 0x400598 <calc+0x28>
1142 [   3d1] set file to 1
1143 [   3d3] special opcode 22: address+0 = 0x400598 <calc+0x28>, line-1 = 11
1144 [   3d4] set column to 1
1145 [   3d6] extended opcode 2:  set address to 0x40059b
1146 [   3e1] extended opcode 1:  end of sequence
1147EOF
1148
1149exit 0
1150