From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id CC4E63870905 for ; Wed, 22 Apr 2020 11:18:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CC4E63870905 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 55E2FABAD for ; Wed, 22 Apr 2020 11:18:11 +0000 (UTC) Date: Wed, 22 Apr 2020 13:18:10 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix .debug_aranges in gdb.dlang/watch-loc.c Message-ID: <20200422111808.GA12538@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-29.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2020 11:18:13 -0000 Hi, While investigating PR25862 (an assertion failure with target board cc-with-debug-names), I noticed that the .debug_aranges section in gdb.dlang/watch-loc.c contains a hardcoded 0x1000: ... " .4byte _Dmain \n" // Address " .4byte 0x1000 \n" // Length ... Fix this by using the actual length of _Dmain, along the lines of how that is done in gdb.mi/dw2-ref-missing-frame-func.c: ... " .4byte _Dmain_end - _Dmain \n" // Length ... such that the .debug_aranges entry: ... Address Length 004004a7 0000000b 00000000 00000000 ... matches the addresses found in the corresponding CU: ... <2>: Abbrev Number: 6 (DW_TAG_subprogram) DW_AT_name : _Dmain <105> DW_AT_low_pc : 0x4004a7 <10d> DW_AT_high_pc : 0x4004b2 ... With this fix the assertion failure is no longer triggered for gdb.dlang/watch-loc.exp. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix .debug_aranges in gdb.dlang/watch-loc.c gdb/testsuite/ChangeLog: 2020-04-22 Tom de Vries * gdb.dlang/watch-loc.c (.debug_aranges): Fix _Dmain length. --- gdb/testsuite/gdb.dlang/watch-loc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.dlang/watch-loc.c b/gdb/testsuite/gdb.dlang/watch-loc.c index c3159ce1079..de594f35ae6 100644 --- a/gdb/testsuite/gdb.dlang/watch-loc.c +++ b/gdb/testsuite/gdb.dlang/watch-loc.c @@ -28,6 +28,8 @@ int _Dmain (void) return 0; } +asm ("_Dmain_end: .globl _Dmain_end"); + int main (void) { @@ -51,7 +53,7 @@ asm ( " .2byte 0 \n" // Pad to 16 byte boundary " .2byte 0 \n" " .4byte _Dmain \n" // Address -" .4byte 0x1000 \n" // Length +" .4byte _Dmain_end - _Dmain \n" // Length " .4byte 0 \n" " .4byte 0 \n" ".Laranges_end: \n"