From 7fe25d9bd274089557e2947f7ba09b6e333533cd Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 8 Mar 2012 19:37:08 +0000 Subject: gdb/ Fix CU relative vs. absolute DIE offsets. * dwarf2loc.h (dwarf2_fetch_die_location_block): Rename parameter offset to offset_in_cu. * dwarf2read.c (process_enumeration_scope): Add CU offset to TYPE_OFFSET. (dwarf2_fetch_die_location_block): Rename parameter offset to offset_in_cu. New variable offset, add CU offset to OFFSET_IN_CU. gdb/testsuite/ Fix CU relative vs. absolute DIE offsets. * gdb.dwarf2/dw2-op-call.S: New compilation unit preceding the existing one. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.dwarf2/dw2-op-call.S | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'gdb/testsuite') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a5b57f5..22b3849 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2012-03-08 Jan Kratochvil + Fix CU relative vs. absolute DIE offsets. + * gdb.dwarf2/dw2-op-call.S: New compilation unit preceding the existing + one. + +2012-03-08 Jan Kratochvil + Fix false FAIL on distros with relro linkage as default. * gdb.reverse/solib-precsave.exp: Try to compile the test using -Wl,-z,norelro first. diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-call.S b/gdb/testsuite/gdb.dwarf2/dw2-op-call.S index c369966..39345b9 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-op-call.S +++ b/gdb/testsuite/gdb.dwarf2/dw2-op-call.S @@ -23,6 +23,23 @@ array2: .2byte 2 array3: .2byte 3 .section .debug_info +.Lcu0_begin: + /* CU header */ + .4byte .Lcu0_end - .Lcu0_start /* Length of Compilation Unit */ +.Lcu0_start: + .2byte 2 /* DWARF Version */ + .4byte .Labbrev1_begin /* Offset into abbrev section */ + .byte 4 /* Pointer size */ + + /* CU die */ + .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ + .ascii "file0.txt\0" /* DW_AT_name */ + .ascii "GNU C 3.3.3\0" /* DW_AT_producer */ + .byte 2 /* DW_LANG_C (C) */ + + .byte 0 /* End of children of CU */ +.Lcu0_end: + .Lcu1_begin: /* CU header */ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ -- cgit v1.1