From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 95mgN/s4GWBUKAAAWB0awg (envelope-from ) for ; Tue, 02 Feb 2021 06:35:23 -0500 Received: by simark.ca (Postfix, from userid 112) id ADA271EF80; Tue, 2 Feb 2021 06:35:23 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3D06D1E940 for ; Tue, 2 Feb 2021 06:35:21 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C6C5D3854809; Tue, 2 Feb 2021 11:35:20 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 8BA3F3851C33 for ; Tue, 2 Feb 2021 11:35:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8BA3F3851C33 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.221.27]) by mx2.suse.de (Postfix) with ESMTP id A65A4AD87 for ; Tue, 2 Feb 2021 11:35:16 +0000 (UTC) Date: Tue, 2 Feb 2021 12:35:14 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list Message-ID: <20210202113513.GA10112@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-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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Hi, When running test-case gdb.dwarf2/clang-debug-names.exp, I run into the following warning: ... (gdb) file clang-debug-names^M Reading symbols from clang-debug-names...^M warning: Section .debug_aranges in clang-debug-names has duplicate \ debug_info_offset 0xc7, ignoring .debug_aranges.^M ... This is caused by a missing return in commit 3ee6bb113af "[gdb/symtab] Fix incomplete CU list assert in .debug_names". Fix this by adding the missing return, such that we have instead this warning: ... (gdb) file clang-debug-names^M Reading symbols from clang-debug-names...^M warning: Section .debug_aranges in clang-debug-names \ entry at offset 0 debug_info_offset 0 does not exists, \ ignoring .debug_aranges.^M ... which is a known problem filed as PR25969 - "Ignoring .debug_aranges with clang .debug_names". Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list gdb/ChangeLog: 2021-02-02 Tom de Vries PR symtab/27307 * dwarf2/read.c (create_cus_from_debug_names_list): Add missing return. gdb/testsuite/ChangeLog: 2021-02-02 Tom de Vries PR symtab/27307 * gdb.dwarf2/clang-debug-names.exp: Check file command warnings. --- gdb/dwarf2/read.c | 1 + gdb/testsuite/gdb.dwarf2/clang-debug-names.exp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 0a00f89cf6d..872b4e7bcf2 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -5323,6 +5323,7 @@ create_cus_from_debug_names_list (dwarf2_per_bfd *per_bfd, = create_cu_from_index_list (per_bfd, §ion, is_dwz, sect_off, 0); per_bfd->all_comp_units.push_back (per_cu); } + return; } sect_offset sect_off_prev; diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp index 12134cf7f3e..5548b30e771 100644 --- a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp +++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp @@ -33,6 +33,22 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ return -1 } +set test "no file command warnings" +if { [regexp "warning: " $gdb_file_cmd_msg] } { + set kfail_re \ + [concat \ + "warning: Section .debug_aranges in \[^\r\n\]* entry" \ + "at offset 0 debug_info_offset 0 does not exists," \ + "ignoring \\.debug_aranges\\."] + if { [regexp $kfail_re $gdb_file_cmd_msg] } { + kfail symtab/25969 $test + } else { + fail $test + } +} else { + pass $test +} + set cmd "ptype main" set pass_re \ [multi_line \