diff options
| author | Mark Wielaard <[email protected]> | 2017-11-29 16:37:50 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2017-11-29 16:47:26 +0100 |
| commit | fbb6c932e3ff74d4fb8bc54b72d9c9bdc4513f69 (patch) | |
| tree | 4f2d5422a9762e892e1e84f65bd05bce316691e9 /tests | |
| parent | 36eabdb739b16b934afe318c786a97c94b47bbf6 (diff) | |
readelf: Print CU, base address and unresolved .debug_loc entries.
Also adjust the formatting for the resolved addresses to print them
on separate lines so they nicely line up even when the addresses are
resolved to symbol+offset names. And print the operands starting on
a new line.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ChangeLog | 6 | ||||
| -rwxr-xr-x | tests/run-readelf-loc.sh | 51 | ||||
| -rwxr-xr-x | tests/run-readelf-zdebug-rel.sh | 17 | ||||
| -rwxr-xr-x | tests/run-readelf-zdebug.sh | 17 |
4 files changed, 70 insertions, 21 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index 4666dcc2..cb0c977f 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,11 @@ 2017-11-29 Mark Wielaard <[email protected]> + * run-readelf-loc.sh: Adjust expected loc list output. + * run-readelf-zdebug-rel.sh: Likewise. + * run-readelf-zdebug.sh: Likewise. + +2017-11-29 Mark Wielaard <[email protected]> + * run-readelf-loc.sh: Adjust expected range list output. * run-readelf-zdebug.sh: Likewise. diff --git a/tests/run-readelf-loc.sh b/tests/run-readelf-loc.sh index 4b666cfe..e5152df8 100755 --- a/tests/run-readelf-loc.sh +++ b/tests/run-readelf-loc.sh @@ -63,9 +63,22 @@ testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=loc --debug-dump=ra testfileloc<<\EOF DWARF section [33] '.debug_loc' at offset 0xd2a: - [ 0] 0x0000000000400480 <main>..0x000000000040048d <main+0xd> [ 0] reg5 - [ 23] 0x0000000000400485 <main+0x5>..0x000000000040048d <main+0xd> [ 0] reg5 - [ 46] 0x00000000004004b2 <say+0x12>..0x00000000004004ba <say+0x1a> [ 0] breg5 0 + + CU [ b] base: 0x0000000000400480 <main> + [ 0] range 0, d + 0x0000000000400480 <main>.. + 0x000000000040048c <main+0xc> + [ 0] reg5 + [ 23] range 5, d + 0x0000000000400485 <main+0x5>.. + 0x000000000040048c <main+0xc> + [ 0] reg5 + + CU [ e0] base: 0x00000000004004a0 <say> + [ 46] range 12, 1a + 0x00000000004004b2 <say+0x12>.. + 0x00000000004004b9 <say+0x19> + [ 0] breg5 0 DWARF section [34] '.debug_ranges' at offset 0xd94: @@ -91,9 +104,22 @@ testrun_compare ${abs_top_builddir}/src/readelf -N --debug-dump=loc --debug-dump testfileloc<<\EOF DWARF section [33] '.debug_loc' at offset 0xd2a: - [ 0] 0x0000000000400480..0x000000000040048d [ 0] reg5 - [ 23] 0x0000000000400485..0x000000000040048d [ 0] reg5 - [ 46] 0x00000000004004b2..0x00000000004004ba [ 0] breg5 0 + + CU [ b] base: 0x0000000000400480 + [ 0] range 0, d + 0x0000000000400480.. + 0x000000000040048c + [ 0] reg5 + [ 23] range 5, d + 0x0000000000400485.. + 0x000000000040048c + [ 0] reg5 + + CU [ e0] base: 0x00000000004004a0 + [ 46] range 12, 1a + 0x00000000004004b2.. + 0x00000000004004b9 + [ 0] breg5 0 DWARF section [34] '.debug_ranges' at offset 0xd94: @@ -119,9 +145,16 @@ testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=loc --debug-dump testfileloc<<\EOF DWARF section [33] '.debug_loc' at offset 0xd2a: - [ 0] 000000000000000000..0x000000000000000d [ 0] reg5 - [ 23] 0x0000000000000005..0x000000000000000d [ 0] reg5 - [ 46] 0x0000000000000012..0x000000000000001a [ 0] breg5 0 + + CU [ b] base: 0x0000000000400480 + [ 0] range 0, d + [ 0] reg5 + [ 23] range 5, d + [ 0] reg5 + + CU [ e0] base: 0x00000000004004a0 + [ 46] range 12, 1a + [ 0] breg5 0 DWARF section [34] '.debug_ranges' at offset 0xd94: diff --git a/tests/run-readelf-zdebug-rel.sh b/tests/run-readelf-zdebug-rel.sh index 2b57d058..ccccd82d 100755 --- a/tests/run-readelf-zdebug-rel.sh +++ b/tests/run-readelf-zdebug-rel.sh @@ -127,12 +127,17 @@ cat info.out | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=i cat > loc.out << \EOF DWARF section [ 7] '.debug_loc' at offset 0x185: - [ 0] 000000000000000000..0x0000000000000003 [ 0] reg5 - 0x0000000000000003..0x0000000000000010 [ 0] breg5 -42 - [ 2] stack_value - 0x0000000000000010..0x0000000000000018 [ 0] GNU_entry_value: - [ 0] reg5 - [ 3] stack_value + + CU [ b] base: 000000000000000000 + [ 0] range 0, 3 + [ 0] reg5 + range 3, 10 + [ 0] breg5 -42 + [ 2] stack_value + range 10, 18 + [ 0] GNU_entry_value: + [ 0] reg5 + [ 3] stack_value EOF cat loc.out | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=loc testfile-debug-rel.o diff --git a/tests/run-readelf-zdebug.sh b/tests/run-readelf-zdebug.sh index 7be9beee..28128ad9 100755 --- a/tests/run-readelf-zdebug.sh +++ b/tests/run-readelf-zdebug.sh @@ -46,12 +46,17 @@ tempfiles loc.out aranges.out ranges.out macro.out line.out frame.out cat > loc.out << \EOF DWARF section [30] '.debug_loc' at offset 0xa17: - [ 0] 0x00000000004003c0..0x00000000004003c3 [ 0] reg5 - 0x00000000004003c3..0x00000000004003d6 [ 0] breg5 -42 - [ 2] stack_value - 0x00000000004003d6..0x00000000004003d9 [ 0] GNU_entry_value: - [ 0] reg5 - [ 3] stack_value + + CU [ b] base: 000000000000000000 + [ 0] range 4003c0, 4003c3 + [ 0] reg5 + range 4003c3, 4003d6 + [ 0] breg5 -42 + [ 2] stack_value + range 4003d6, 4003d9 + [ 0] GNU_entry_value: + [ 0] reg5 + [ 3] stack_value EOF cat loc.out | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=loc testfile-debug |
