From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id hfTXDNraNmBwIwAAWB0awg (envelope-from ) for ; Wed, 24 Feb 2021 18:01:46 -0500 Received: by simark.ca (Postfix, from userid 112) id 2DD131EF78; Wed, 24 Feb 2021 18:01:46 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI,RDNS_NONE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 D28071EE0E for ; Wed, 24 Feb 2021 18:01:45 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6435F3857800; Wed, 24 Feb 2021 23:01:45 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id BCC4A3857C62 for ; Wed, 24 Feb 2021 23:01:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BCC4A3857C62 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 C59DDAEA8 for ; Wed, 24 Feb 2021 23:01:41 +0000 (UTC) Subject: [PING][PATCH][gdb/symtab] Fix wrong unit_type Dwarf Error From: Tom de Vries To: gdb-patches@sourceware.org References: <20210211105947.GA22976@delia> Message-ID: <7af3f689-ebee-b4d6-fc0e-4c8a54391224@suse.de> Date: Thu, 25 Feb 2021 00:01:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210211105947.GA22976@delia> 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/11/21 11:59 AM, Tom de Vries wrote: > Hi, > > When running test-case gdb.dwarf2/fission-mix.exp using gcc-11 (and using the > tentative fix for PR27353 to get past that assertion failure), I run into: > ... > (gdb) file fission-mix^M > Reading symbols from fission-mix...^M > Dwarf Error: wrong unit_type in compilation unit header \ > (is DW_UT_split_compile (0x05), should be DW_UT_type (0x02)) \ > [in module fission-mix2.dwo]^M > (No debugging symbols found in fission-mix)^M > ... > > The compilation unit that is complained about is: > ... > Contents of the .debug_info.dwo section (loaded from fission-mix2.dwo): > > Compilation Unit @ offset 0x0: > Length: 0x57 (32-bit) > Version: 5 > Unit Type: DW_UT_split_compile (5) > Abbrev Offset: 0x0 > Pointer Size: 8 > DWO ID: 0x3e3930d3cc1805df > <0><14>: Abbrev Number: 1 (DW_TAG_compile_unit) > ... > > And the dwarf error is triggered here in read_comp_unit_head: > ... > case DW_UT_split_compile: > if (section_kind != rcuh_kind::COMPILE) > error (_("Dwarf Error: wrong unit_type in compilation unit header " > "(is %s, should be %s) [in module %s]"), > dwarf_unit_type_name (cu_header->unit_type), > dwarf_unit_type_name (DW_UT_type), filename); > break; > ... > due to passing rcuh_kind::TYPE here in open_and_init_dwo_file: > ... > create_debug_type_hash_table (per_objfile, dwo_file.get (), > &dwo_file->sections.info, dwo_file->tus, > rcuh_kind::TYPE); > ... > > Fix this by changing the section_kind argument to create_debug_type_hash_table > to rcuh_kind::COMPILE, to reflect that we're passing &dwo_file->sections.info > rather than &dwo_file->sections.types. > > Tested on x86_64-linux. > > Any comments? > Ping. Thanks, - Tom > [gdb/symtab] Fix wrong unit_type Dwarf Error > > gdb/ChangeLog: > > 2021-02-11 Tom de Vries > > PR symtab/27354 > * dwarf2/read.c (open_and_init_dwo_file): Use rcuh_kind::COMPILE as > section_kind for &dwo_file->sections.info. > > --- > gdb/dwarf2/read.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c > index 51bf0fbeea5..aacb1806742 100644 > --- a/gdb/dwarf2/read.c > +++ b/gdb/dwarf2/read.c > @@ -12952,7 +12952,7 @@ open_and_init_dwo_file (dwarf2_cu *cu, const char *dwo_name, > { > create_debug_type_hash_table (per_objfile, dwo_file.get (), > &dwo_file->sections.info, dwo_file->tus, > - rcuh_kind::TYPE); > + rcuh_kind::COMPILE); > } > > dwarf_read_debug_printf ("DWO file found: %s", dwo_name); >