summaryrefslogtreecommitdiffstats
path: root/tests/run-readelf-dwz-multi.sh
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2013-02-15 22:45:22 +0100
committerMark Wielaard <[email protected]>2013-02-15 22:45:22 +0100
commit443304efce95d66ac089d95807a0002cf8558d13 (patch)
tree875184126e0c46a80524e88396222ba9f0c4fe3f /tests/run-readelf-dwz-multi.sh
parent40025813dc9e5f2524c3c1851a99efd43cb59894 (diff)
libdw: Handle FORM_GNU_strp_alt for files with string data only in dwz file.
dwarf_formstring should check that the dbg file from which we want the strp data actually has a IDX_debug_str section. Reported-By: Tom Tromey <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'tests/run-readelf-dwz-multi.sh')
-rwxr-xr-xtests/run-readelf-dwz-multi.sh73
1 files changed, 72 insertions, 1 deletions
diff --git a/tests/run-readelf-dwz-multi.sh b/tests/run-readelf-dwz-multi.sh
index aadbbbe1..20c00c5f 100755
--- a/tests/run-readelf-dwz-multi.sh
+++ b/tests/run-readelf-dwz-multi.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2012 Red Hat, Inc.
+# Copyright (C) 2012, 2013 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
@@ -56,7 +56,27 @@
# gcc -g -o testfile_multi_main -L. -ltestfile_multi_shared main.c -Wl,-rpath,.
# dwz -m testfile_multi.dwz testfile_multi_main libtestfile_multi_shared.so
+# main.c
+#
+# struct foobarbaz
+# {
+# int counter;
+# char *bookstore;
+# };
+#
+# int
+# main (int argc, char **argv)
+# {
+# struct foobarbaz fbb;
+# return 0;
+# }
+
+# gcc -g -o testfile-dwzstr main.c
+# cp testfile-dwzstr testfile-dwzstr.alt
+# dwz -m testfile-dwzstr.multi testfile-dwzstr testfile-dwzstr.alt
+
testfiles libtestfile_multi_shared.so testfile_multi_main testfile_multi.dwz
+testfiles testfile-dwzstr testfile-dwzstr.multi
testrun_compare ../src/readelf --debug-dump=info testfile_multi_main <<\EOF
@@ -153,4 +173,55 @@ DWARF section [25] '.debug_info' at offset 0x106c:
[ 0] fbreg -24
EOF
+testrun_compare ../src/readelf --debug-dump=info testfile-dwzstr <<\EOF
+
+DWARF section [28] '.debug_info' at offset 0x1088:
+ [Offset]
+ Compilation unit at offset 0:
+ Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
+ [ b] compile_unit
+ producer (GNU_strp_alt) "GNU C 4.7.2 20121109 (Red Hat 4.7.2-8) -mtune=generic -march=x86-64 -g"
+ language (data1) C89 (1)
+ name (GNU_strp_alt) "main.c"
+ comp_dir (GNU_strp_alt) "/home/mark/src/tests"
+ low_pc (addr) 0x00000000004004ec <main>
+ high_pc (udata) 18
+ stmt_list (sec_offset) 0
+ [ 26] imported_unit
+ import (GNU_ref_alt) [ b]
+ [ 2b] subprogram
+ external (flag_present)
+ name (GNU_strp_alt) "main"
+ decl_file (data1) 1
+ decl_line (data1) 8
+ prototyped (flag_present)
+ type (GNU_ref_alt) [ 30]
+ low_pc (addr) 0x00000000004004ec <main>
+ high_pc (udata) 18
+ frame_base (exprloc)
+ [ 0] call_frame_cfa
+ GNU_all_call_sites (flag_present)
+ [ 41] formal_parameter
+ name (GNU_strp_alt) "argc"
+ decl_file (data1) 1
+ decl_line (data1) 8
+ type (GNU_ref_alt) [ 30]
+ location (exprloc)
+ [ 0] fbreg -36
+ [ 4f] formal_parameter
+ name (GNU_strp_alt) "argv"
+ decl_file (data1) 1
+ decl_line (data1) 8
+ type (GNU_ref_alt) [ 41]
+ location (exprloc)
+ [ 0] fbreg -48
+ [ 5d] variable
+ name (string) "fbb"
+ decl_file (data1) 1
+ decl_line (data1) 10
+ type (GNU_ref_alt) [ 14]
+ location (exprloc)
+ [ 0] fbreg -32
+EOF
+
exit 0