summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2017-11-29 16:27:33 +0100
committerMark Wielaard <[email protected]>2017-11-29 16:46:45 +0100
commit36eabdb739b16b934afe318c786a97c94b47bbf6 (patch)
treeddb62e0439024b65c0b91f3d533d300e888fb4e2 /tests
parentd5b99ee3b4a2fd0ca989fe42f3ab6b3ac328a414 (diff)
readelf: Print CU, base address and unresolved .debug_range 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. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog5
-rwxr-xr-xtests/run-readelf-loc.sh52
-rwxr-xr-xtests/run-readelf-zdebug.sh4
3 files changed, 48 insertions, 13 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index c9fc53ab..4666dcc2 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,10 @@
2017-11-29 Mark Wielaard <[email protected]>
+ * run-readelf-loc.sh: Adjust expected range list output.
+ * run-readelf-zdebug.sh: Likewise.
+
+2017-11-29 Mark Wielaard <[email protected]>
+
* run-readelf-dwz-multi.sh: Add expected file names.
* run-readelf-zdebug-rel.sh: Likewise.
diff --git a/tests/run-readelf-loc.sh b/tests/run-readelf-loc.sh
index 3959d3d7..4b666cfe 100755
--- a/tests/run-readelf-loc.sh
+++ b/tests/run-readelf-loc.sh
@@ -68,10 +68,22 @@ DWARF section [33] '.debug_loc' at offset 0xd2a:
[ 46] 0x00000000004004b2 <say+0x12>..0x00000000004004ba <say+0x1a> [ 0] breg5 0
DWARF section [34] '.debug_ranges' at offset 0xd94:
- [ 0] 0x0000000000400480 <main>..0x0000000000400482 <main+0x2>
- 0x0000000000400485 <main+0x5>..0x000000000040048d <main+0xd>
- [ 30] 0x00000000004004ad <say+0xd>..0x00000000004004af <say+0xf>
- 0x00000000004004b2 <say+0x12>..0x00000000004004ba <say+0x1a>
+
+ CU [ b] base: 0x0000000000400480 <main>
+ [ 0] range 0, 2
+ 0x0000000000400480 <main>..
+ 0x0000000000400481 <main+0x1>
+ range 5, d
+ 0x0000000000400485 <main+0x5>..
+ 0x000000000040048c <main+0xc>
+
+ CU [ e0] base: 0x00000000004004a0 <say>
+ [ 30] range d, f
+ 0x00000000004004ad <say+0xd>..
+ 0x00000000004004ae <say+0xe>
+ range 12, 1a
+ 0x00000000004004b2 <say+0x12>..
+ 0x00000000004004b9 <say+0x19>
EOF
# Don't resolve addresses to symbols.
@@ -84,10 +96,22 @@ DWARF section [33] '.debug_loc' at offset 0xd2a:
[ 46] 0x00000000004004b2..0x00000000004004ba [ 0] breg5 0
DWARF section [34] '.debug_ranges' at offset 0xd94:
- [ 0] 0x0000000000400480..0x0000000000400482
- 0x0000000000400485..0x000000000040048d
- [ 30] 0x00000000004004ad..0x00000000004004af
- 0x00000000004004b2..0x00000000004004ba
+
+ CU [ b] base: 0x0000000000400480
+ [ 0] range 0, 2
+ 0x0000000000400480..
+ 0x0000000000400481
+ range 5, d
+ 0x0000000000400485..
+ 0x000000000040048c
+
+ CU [ e0] base: 0x00000000004004a0
+ [ 30] range d, f
+ 0x00000000004004ad..
+ 0x00000000004004ae
+ range 12, 1a
+ 0x00000000004004b2..
+ 0x00000000004004b9
EOF
# Produce "raw" unprocessed content.
@@ -100,10 +124,14 @@ DWARF section [33] '.debug_loc' at offset 0xd2a:
[ 46] 0x0000000000000012..0x000000000000001a [ 0] breg5 0
DWARF section [34] '.debug_ranges' at offset 0xd94:
- [ 0] 000000000000000000..0x0000000000000002
- 0x0000000000000005..0x000000000000000d
- [ 30] 0x000000000000000d..0x000000000000000f
- 0x0000000000000012..0x000000000000001a
+
+ CU [ b] base: 0x0000000000400480
+ [ 0] range 0, 2
+ range 5, d
+
+ CU [ e0] base: 0x00000000004004a0
+ [ 30] range d, f
+ range 12, 1a
EOF
exit 0
diff --git a/tests/run-readelf-zdebug.sh b/tests/run-readelf-zdebug.sh
index fc666fd1..7be9beee 100755
--- a/tests/run-readelf-zdebug.sh
+++ b/tests/run-readelf-zdebug.sh
@@ -80,7 +80,9 @@ cat aranges.out | sed -e "s/.debug_aranges' at offset 0xa65/.zdebug_aranges' at
cat > ranges.out << \EOF
DWARF section [32] '.debug_ranges' at offset 0xa95:
- [ 0] 0x00000000004003c0..0x00000000004003d9
+
+ CU [ b] base: 000000000000000000
+ [ 0] range 4003c0, 4003d9
EOF
cat ranges.out | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=ranges testfile-debug