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 1384A385DC0B for ; Thu, 23 Apr 2020 12:50:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1384A385DC0B 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 87BBBAB5C for ; Thu, 23 Apr 2020 12:50:25 +0000 (UTC) Date: Thu, 23 Apr 2020 14:50:24 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [FTR][gdb/testsuite] Add missing .debug_aranges to dw2-ranges-func-{hi,lo}-cold.c Message-ID: <20200423125023.GA6207@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.1 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: Thu, 23 Apr 2020 12:50:28 -0000 Hi, I ran into these FAILs with test-case gdb.dwarf2/dw2-ranges-func.exp and target board cc-with-debug-names: ... FAIL: gdb.dwarf2/dw2-ranges-func.exp: lo-cold: disassemble foo (pattern 2) FAIL: gdb.dwarf2/dw2-ranges-func.exp: hi-cold: disassemble foo (pattern 2) ... My initial investigation pointed towards missing .debug_aranges info, so I wrote this patch that adds that, which indeed fixes the FAILs. However, that did not fix the same FAILs with target board readnow, which I fixed with commit ae3ab1f067b "[gdb/symtab] Fix disassembly of non-contiguous functions". After committing that fix, the FAILs with cc-with-debug-names no longer reproduce. So, I'm posting this for the record, for now. Thanks, - Tom [gdb/testsuite] Add missing .debug_aranges to dw2-ranges-func-{hi,lo}-cold.c --- gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c | 30 ++++++++++++++++++++++ gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c | 30 ++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c b/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c index 2e40e9668f5..032b3547a78 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-hi-cold.c @@ -41,6 +41,11 @@ void bar (void); void foo_cold (void); void baz (void); +asm ( +".text \n" +".Lcu_text_start: .globl .Lcu_text_start" +); + void foo (void) { /* foo prologue */ @@ -80,3 +85,28 @@ main (void) return 0; /* main return */ } /* main end */ +asm (".Lcu_text_end: .globl .Lcu_text_end"); + +/* The .debug_names-based index support depends on .debug_aranges + generated by GCC. (.gdb_index includes a gdb-generated map + instead.) */ +asm ( +" .pushsection .debug_info,\"\",%progbits \n" +".Lcu1_begin: \n" +" .popsection \n" +" .pushsection .debug_aranges,\"\",%progbits \n" +" .4byte .Laranges_end - .Laranges_start \n" // Length of Address Ranges Info +".Laranges_start: \n" +" .2byte 0x2 \n" // DWARF Version +" .4byte .Lcu1_begin\n" // .Ldebug_info0 - Offset of Compilation Unit Info +" .byte 4 \n" // Size of Address +" .byte 0 \n" // Size of Segment Descriptor +" .2byte 0 \n" // Pad to 16 byte boundary +" .2byte 0 \n" +" .4byte .Lcu_text_start \n" // Address +" .4byte .Lcu_text_end - .Lcu_text_start \n" // Length +" .4byte 0 \n" +" .4byte 0 \n" +".Laranges_end: \n" +" .popsection \n" +); diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c b/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c index 61ca3ac5fab..40be6578bac 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-func-lo-cold.c @@ -41,6 +41,11 @@ void bar (void); void foo_cold (void); void baz (void); +asm ( +".text \n" +".Lcu_text_start: .globl .Lcu_text_start" +); + void baz (void) { @@ -80,3 +85,28 @@ main (void) return 0; /* main return */ } /* main end */ +asm (".Lcu_text_end: .globl .Lcu_text_end"); + +/* The .debug_names-based index support depends on .debug_aranges + generated by GCC. (.gdb_index includes a gdb-generated map + instead.) */ +asm ( +" .pushsection .debug_info,\"\",%progbits \n" +".Lcu1_begin: \n" +" .popsection \n" +" .pushsection .debug_aranges,\"\",%progbits \n" +" .4byte .Laranges_end - .Laranges_start \n" // Length of Address Ranges Info +".Laranges_start: \n" +" .2byte 0x2 \n" // DWARF Version +" .4byte .Lcu1_begin\n" // .Ldebug_info0 - Offset of Compilation Unit Info +" .byte 4 \n" // Size of Address +" .byte 0 \n" // Size of Segment Descriptor +" .2byte 0 \n" // Pad to 16 byte boundary +" .2byte 0 \n" +" .4byte .Lcu_text_start \n" // Address +" .4byte .Lcu_text_end - .Lcu_text_start \n" // Length +" .4byte 0 \n" +" .4byte 0 \n" +".Laranges_end: \n" +" .popsection \n" +);