diff options
author | Mark Wielaard <mjw@redhat.com> | 2014-05-01 14:48:27 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2014-05-02 17:00:48 +0200 |
commit | df85bf99021119fcbb2ced66dd69f1cceafb180c (patch) | |
tree | a0ee033052e69b9b00e87ee31bf4962dac3cec17 /tests/run-readelf-dwz-multi.sh | |
parent | d81d32d2a4f92355e4c677b578147dfe819251b9 (diff) | |
download | elfutils-df85bf99021119fcbb2ced66dd69f1cceafb180c.tar.gz |
libdwfl: Move dwz alt multi file searching to find_debuginfo callback.
Don't hard code the Dwarf dwz alt multi file search but allow the user
to override it through the standard Dwfl_Callbacks. Also move ownership
completely to the user of dwarf_setalt by removing free_alt from Dwarf
and adding alt, fd and elf fields to Dwfl_Module. Add a relative .dwz
file test case.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'tests/run-readelf-dwz-multi.sh')
-rwxr-xr-x | tests/run-readelf-dwz-multi.sh | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/tests/run-readelf-dwz-multi.sh b/tests/run-readelf-dwz-multi.sh index 44d24758..27e0f38c 100755 --- a/tests/run-readelf-dwz-multi.sh +++ b/tests/run-readelf-dwz-multi.sh @@ -136,6 +136,109 @@ DWARF section [28] '.debug_info' at offset 0x1078: type (ref_udata) [ 2b] EOF +# Same as above, but find alt debug file in a .dwz subdir. +mkdir .dwz +mv testfile_multi.dwz .dwz +testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=info testfile_multi_main <<\EOF + +DWARF section [28] '.debug_info' at offset 0x1078: + [Offset] + Compilation unit at offset 0: + Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4 + [ b] compile_unit + producer (strp) "GNU C 4.7.0 20120507 (Red Hat 4.7.0-5) -mtune=generic -march=x86-64 -g" + language (data1) C89 (1) + name (strp) "main.c" + comp_dir (GNU_strp_alt) "/home/mark/src/tests/dwz" + low_pc (addr) 0x00000000004006ac <main> + high_pc (udata) 44 (0x00000000004006d8) + stmt_list (sec_offset) 0 + [ 26] imported_unit + import (GNU_ref_alt) [ b] + [ 2b] pointer_type + byte_size (data1) 8 + type (GNU_ref_alt) [ 53] + [ 31] subprogram + external (flag_present) + name (strp) "main" + decl_file (data1) 1 + decl_line (data1) 3 + prototyped (flag_present) + type (GNU_ref_alt) [ 3e] + low_pc (addr) 0x00000000004006ac <main> + high_pc (udata) 44 (0x00000000004006d8) + frame_base (exprloc) + [ 0] call_frame_cfa + GNU_all_tail_call_sites (flag_present) + sibling (ref_udata) [ 6e] + [ 48] formal_parameter + name (strp) "argc" + decl_file (data1) 1 + decl_line (data1) 3 + type (GNU_ref_alt) [ 3e] + location (exprloc) + [ 0] fbreg -36 + [ 56] formal_parameter + name (strp) "argv" + decl_file (data1) 1 + decl_line (data1) 3 + type (ref_udata) [ 6e] + location (exprloc) + [ 0] fbreg -48 + [ 61] variable + name (string) "b" + decl_file (data1) 1 + decl_line (data1) 5 + type (GNU_ref_alt) [ 5a] + location (exprloc) + [ 0] fbreg -32 + [ 6e] pointer_type + byte_size (data1) 8 + type (ref_udata) [ 2b] +EOF +mv .dwz/testfile_multi.dwz . +rmdir .dwz + +testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=info libtestfile_multi_shared.so <<\EOF + +DWARF section [25] '.debug_info' at offset 0x106c: + [Offset] + Compilation unit at offset 0: + Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4 + [ b] compile_unit + producer (strp) "GNU C 4.7.0 20120507 (Red Hat 4.7.0-5) -fpreprocessed -mtune=generic -march=x86-64 -g -fPIC" + language (data1) C89 (1) + name (strp) "shared.c" + comp_dir (GNU_strp_alt) "/home/mark/src/tests/dwz" + low_pc (addr) +0x0000000000000670 <call_foo> + high_pc (udata) 23 (+0x0000000000000687) + stmt_list (sec_offset) 0 + [ 26] imported_unit + import (GNU_ref_alt) [ b] + [ 2b] subprogram + external (flag_present) + name (strp) "call_foo" + decl_file (data1) 1 + decl_line (data1) 3 + prototyped (flag_present) + type (GNU_ref_alt) [ 3e] + low_pc (addr) +0x0000000000000670 <call_foo> + high_pc (udata) 23 (+0x0000000000000687) + frame_base (exprloc) + [ 0] call_frame_cfa + GNU_all_call_sites (flag_present) + [ 41] formal_parameter + name (string) "fb" + decl_file (data1) 1 + decl_line (data1) 3 + type (GNU_ref_alt) [ 76] + location (exprloc) + [ 0] fbreg -24 +EOF + +# Same as above, but find alt debug file in a .dwz subdir. +mkdir .dwz +mv testfile_multi.dwz .dwz testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=info libtestfile_multi_shared.so <<\EOF DWARF section [25] '.debug_info' at offset 0x106c: @@ -172,6 +275,8 @@ DWARF section [25] '.debug_info' at offset 0x106c: location (exprloc) [ 0] fbreg -24 EOF +mv .dwz/testfile_multi.dwz . +rmdir .dwz testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=info testfile-dwzstr <<\EOF |