This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] dwarf.exp: In 64-bit units, emit also abbrev offset as a 64-bit field
- From: Yao Qi <yao at codesourcery dot com>
- To: Petr Machata <pmachata at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Mon, 17 Nov 2014 08:40:17 +0800
- Subject: Re: [PATCH] dwarf.exp: In 64-bit units, emit also abbrev offset as a 64-bit field
- Authentication-results: sourceware.org; auth=none
- References: <m2egt6h8xo dot fsf at redhat dot com> <87389kj0pr dot fsf at codesourcery dot com> <m2ioig8e0t dot fsf at redhat dot com>
Petr Machata <pmachata@redhat.com> writes:
>> I'll commit the patch for you if you are happy with the updated changelog.
>
> I am.
OK, patch below is what I pushed in.
--
Yao (éå)
From: Petr Machata <pmachata@redhat.com>
Date: Mon, 17 Nov 2014 08:31:47 +0800
Subject: [PATCH] dwarf.exp: In 64-bit units, emit also abbrev offset as a 64-bit field
Dwarf::tu and Dwarf::cu allow selection of units with 64-bit offsets
through an option. When selected, unit size is encoded properly, but
offset to abbreviation unit is still encoded in a 4-byte field. This
patch fixes the problem.
Reproducer:
Dwarf::assemble "blah.s" {
tu {is_64 1 version 4 addr_size 8} 0x1122334455667788 the_type {
type_unit {} { the_type: }
}
cu {is_64 1 version 4 addr_size 8} {
compile_unit {{language @DW_LANG_C}} {}
}
}
gdb/testsuite:
* lib/dwarf.exp (Dwarf::cu, Dwarf::tu): Emit
${_cu_offset_size} bytes abbrev offset.
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 65687c0..2a027d5 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-17 Petr Machata <pmachata@redhat.com>
+
+ * lib/dwarf.exp (Dwarf::cu, Dwarf::tu): Emit
+ ${_cu_offset_size} bytes abbrev offset.
+
2014-11-15 Doug Evans <xdje42@gmail.com>
PR symtab/17559
diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index cadda3e..778ad1c 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -954,7 +954,7 @@ namespace eval Dwarf {
}
define_label $start_label
_op .2byte $_cu_version Version
- _op .4byte $my_abbrevs Abbrevs
+ _op .${_cu_offset_size}byte $my_abbrevs Abbrevs
_op .byte $_cu_addr_size "Pointer size"
_defer_output $_abbrev_section {
@@ -1047,7 +1047,7 @@ namespace eval Dwarf {
}
define_label $start_label
_op .2byte $_cu_version Version
- _op .4byte $my_abbrevs Abbrevs
+ _op .${_cu_offset_size}byte $my_abbrevs Abbrevs
_op .byte $_cu_addr_size "Pointer size"
_op .8byte $signature Signature
if { $type_label != "" } {