From patchwork Fri Nov 14 01:23:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 3727 Received: (qmail 16013 invoked by alias); 14 Nov 2014 01:23:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 16004 invoked by uid 89); 14 Nov 2014 01:23:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 14 Nov 2014 01:23:20 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAE1NJjt027657 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 13 Nov 2014 20:23:19 -0500 Received: from x201 (vpn-236-232.phx2.redhat.com [10.3.236.232]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sAE1NGbu015884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA256 bits=128 verify=NO) for ; Thu, 13 Nov 2014 20:23:18 -0500 From: Petr Machata To: gdb-patches@sourceware.org Subject: [PATCH] dwarf.exp: In 64-bit units, emit also abbrev offset as a 64-bit field Date: Fri, 14 Nov 2014 02:23:15 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Hi there, playing with dwarf.exp I noticed a problem in generating Dwarf compilation and type units with 64-bit offsets. This patch fixes the problem. "make check" reports no regressions. I don't have commit priviliges, so if this patch is acceptable, I'll need someone else to commit this for me. Thanks, Petr ----8<---------------------------------------------------------------- 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. 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}} {} } } Signed-off-by: Petr Machata --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/lib/dwarf.exp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1edfc93..7f714a9 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-11-14 Petr Machata + + * lib/dwarf.exp (Dwarf::cu, Dwarf::tu): In units with 64-bit + offsets, emit also abbrev offset as a 64-bit field. + 2013-10-21 Jose E. Marchesi PR gdb/15986 diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index c28b986..ba734ab 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -820,7 +820,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 { @@ -913,7 +913,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 != "" } {