summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2018-05-29 09:44:38 +0200
committerMark Wielaard <[email protected]>2018-05-31 14:20:25 +0200
commitc7fc54a27c0eac667f0060f277606df8208f05d7 (patch)
treef4f815614409709425eb7aafdea062ffa051a7ae /tests
parente9e64f6748499d458b951e0dcd46d6cc9d850886 (diff)
readelf: Fix regression with multiple files and implicit debug_info reading.
Commit 314e9d7d "readelf: Handle .debug_info first if any other debug section needs it" introduced a regression when handling multiple files. The implicit and explicit printing of debuginfo weren't reset and so the second file would not show (or scan) the .debug_info section when needed. Fix by resetting the implicit and explicit section printing flags. Add a testcase that prints the .debug_loc section for two files and check that the CUs are resolved. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog4
-rwxr-xr-xtests/run-readelf-twofiles.sh43
2 files changed, 46 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 4d69515b..682fffcd 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2018-05-29 Mark Wielaard <[email protected]>
+
+ * run-readelf-twofiles.sh: Add --debug-dump=loc testcase.
+
2018-05-28 Mark Wielaard <[email protected]>
* run-readelf-info-plus.sh: New test.
diff --git a/tests/run-readelf-twofiles.sh b/tests/run-readelf-twofiles.sh
index 46eec7b5..fc5f3e78 100755
--- a/tests/run-readelf-twofiles.sh
+++ b/tests/run-readelf-twofiles.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2011 Red Hat, Inc.
+# Copyright (C) 2011, 2018 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
@@ -21,4 +21,45 @@ testfiles testfile14
testrun >/dev/null ${abs_top_builddir}/src/readelf -w testfile14 testfile14
+testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=loc testfile14 testfile14 << EOF
+
+testfile14:
+
+
+DWARF section [33] '.debug_loc' at offset 0xca9:
+
+ CU [ b] base: 0x0000000000400468 <caller>
+ [ 0] range 34, 35
+ 0x000000000040049c <main>..
+ 0x000000000040049c <main>
+ [ 0] breg7 -8
+ range 35, 46
+ 0x000000000040049d <main+0x1>..
+ 0x00000000004004ad <main+0x11>
+ [ 0] breg7 0
+ range 46, 47
+ 0x00000000004004ae <main+0x12>..
+ 0x00000000004004ae <main+0x12>
+ [ 0] breg7 -8
+
+testfile14:
+
+
+DWARF section [33] '.debug_loc' at offset 0xca9:
+
+ CU [ b] base: 0x0000000000400468 <caller>
+ [ 0] range 34, 35
+ 0x000000000040049c <main>..
+ 0x000000000040049c <main>
+ [ 0] breg7 -8
+ range 35, 46
+ 0x000000000040049d <main+0x1>..
+ 0x00000000004004ad <main+0x11>
+ [ 0] breg7 0
+ range 46, 47
+ 0x00000000004004ae <main+0x12>..
+ 0x00000000004004ae <main+0x12>
+ [ 0] breg7 -8
+EOF
+
exit 0