From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gHUXLRAAHWBfGQAAWB0awg (envelope-from ) for ; Fri, 05 Feb 2021 03:21:36 -0500 Received: by simark.ca (Postfix, from userid 112) id B0C5C1EFCB; Fri, 5 Feb 2021 03:21:36 -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 EF7D31E590 for ; Fri, 5 Feb 2021 03:21:35 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8AAD93971417; Fri, 5 Feb 2021 08:21:35 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id E1AA23971414 for ; Fri, 5 Feb 2021 08:21:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E1AA23971414 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 0C8DBAE3F; Fri, 5 Feb 2021 08:21:31 +0000 (UTC) Subject: Re: [PATCH][gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list To: Simon Marchi , gdb-patches@sourceware.org References: <20210202113513.GA10112@delia> <160b7f2f-944e-d971-d5c9-43545ef392e1@polymtl.ca> From: Tom de Vries Message-ID: Date: Fri, 5 Feb 2021 09:21:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <160b7f2f-944e-d971-d5c9-43545ef392e1@polymtl.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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" On 2/3/21 7:29 PM, Simon Marchi wrote: > On 2021-02-02 6:35 a.m., Tom de Vries wrote: >> 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; >> } > > I don't know the specific details of this, but from a quick glance it > makes sense. It seems like two methods of patsing the CU table, we > don't want to run through the two methods. Thanks for the review. > I noticed the indentation is > wrong in the code above, could you push a patch to fix that? Done, and committed this one. Thanks, - Tom