diff options
Diffstat (limited to 'tests/run-readelf-zdebug-rel.sh')
-rwxr-xr-x | tests/run-readelf-zdebug-rel.sh | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/tests/run-readelf-zdebug-rel.sh b/tests/run-readelf-zdebug-rel.sh index 3f20078c..53fa42a2 100755 --- a/tests/run-readelf-zdebug-rel.sh +++ b/tests/run-readelf-zdebug-rel.sh @@ -146,4 +146,110 @@ cat loc.out | sed -e "s/'.debug_loc' at offset 0x185/'.zdebug_loc' at offset 0x1 cat loc.out | sed -e "s/at offset 0x185/at offset 0x150/" | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=loc testfile-debug-rel-z.o +# Same as above, but on ppc64 +testfiles testfile-debug-rel-ppc64.o +testfiles testfile-debug-rel-ppc64-g.o testfile-debug-rel-ppc64-z.o + +cat > info.out << \EOF + +DWARF section [ 6] '.debug_info' at offset 0x80: + [Offset] + Compilation unit at offset 0: + Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4 + [ b] compile_unit abbrev: 1 + producer (strp) "GNU C11 7.3.1 20180712 (Red Hat 7.3.1-6) -Asystem=linux -Asystem=unix -Asystem=posix -msecure-plt -g -Og" + language (data1) C99 (12) + name (strp) "testfile-zdebug-rel.c" + comp_dir (strp) "/home/mjw" + low_pc (addr) 000000000000000000 + high_pc (data8) 44 (0x000000000000002c) + stmt_list (sec_offset) 0 + [ 2d] subprogram abbrev: 2 + external (flag_present) yes + name (strp) "main" + decl_file (data1) testfile-zdebug-rel.c (1) + decl_line (data1) 4 + prototyped (flag_present) yes + type (ref4) [ 82] + low_pc (addr) 000000000000000000 + high_pc (data8) 44 (0x000000000000002c) + frame_base (exprloc) + [ 0] call_frame_cfa + GNU_all_call_sites (flag_present) yes + sibling (ref4) [ 82] + [ 4e] formal_parameter abbrev: 3 + name (strp) "argc" + decl_file (data1) testfile-zdebug-rel.c (1) + decl_line (data1) 4 + type (ref4) [ 82] + location (sec_offset) location list [ 0] + [ 5d] formal_parameter abbrev: 4 + name (strp) "argv" + decl_file (data1) testfile-zdebug-rel.c (1) + decl_line (data1) 4 + type (ref4) [ 89] + location (exprloc) + [ 0] reg4 + [ 6a] variable abbrev: 5 + name (string) "a" + decl_file (data1) testfile-zdebug-rel.c (1) + decl_line (data1) 6 + type (ref4) [ 9c] + const_value (sdata) 18446744073709551607 (-9) + [ 74] variable abbrev: 6 + name (string) "b" + decl_file (data1) testfile-zdebug-rel.c (1) + decl_line (data1) 7 + type (ref4) [ 9c] + location (sec_offset) location list [ 4e] + [ 82] base_type abbrev: 7 + byte_size (data1) 4 + encoding (data1) signed (5) + name (string) "int" + [ 89] pointer_type abbrev: 8 + byte_size (data1) 8 + type (ref4) [ 8f] + [ 8f] pointer_type abbrev: 8 + byte_size (data1) 8 + type (ref4) [ 95] + [ 95] base_type abbrev: 9 + byte_size (data1) 1 + encoding (data1) unsigned_char (8) + name (strp) "char" + [ 9c] base_type abbrev: 9 + byte_size (data1) 8 + encoding (data1) unsigned (7) + name (strp) "long unsigned int" +EOF + +cat info.out | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=info testfile-debug-rel-ppc64.o + +cat info.out | sed -e "s/'.debug_info'/'.zdebug_info'/" | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=info testfile-debug-rel-ppc64-g.o + +cat info.out | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=info testfile-debug-rel-ppc64-z.o + +cat > loc.out << \EOF + +DWARF section [ 9] '.debug_loc' at offset 0x1af: + + CU [ b] base: 000000000000000000 + [ 0] range 0, 4 + [ 0] reg3 + range 4, 14 + [ 0] breg3 -42 + [ 2] stack_value + range 14, 2c + [ 0] GNU_entry_value: + [ 0] reg3 + [ 3] stack_value + [ 4e] range 8, 18 + [ 0] reg3 +EOF + +cat loc.out | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=loc testfile-debug-rel-ppc64.o + +cat loc.out | sed -e "s/'.debug_loc' at offset 0x1af/'.zdebug_loc' at offset 0x15f/" | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=loc testfile-debug-rel-ppc64-g.o + +cat loc.out | sed -e "s/at offset 0x1af/at offset 0x177/" | testrun_compare ${abs_top_builddir}/src/readelf -U --debug-dump=loc testfile-debug-rel-ppc64-z.o + exit 0 |