From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6J70FSQ6HWCJHgAAWB0awg (envelope-from ) for ; Fri, 05 Feb 2021 07:29:24 -0500 Received: by simark.ca (Postfix, from userid 112) id 56AAA1EFCB; Fri, 5 Feb 2021 07:29:24 -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 977861E590 for ; Fri, 5 Feb 2021 07:29:23 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4315E397141B; Fri, 5 Feb 2021 12:29:23 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 6CF27397141B for ; Fri, 5 Feb 2021 12:29:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6CF27397141B 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 91B8AAC6E for ; Fri, 5 Feb 2021 12:29:20 +0000 (UTC) Date: Fri, 5 Feb 2021 13:29:18 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit Message-ID: <20210205122917.GA19309@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.cp/cpexprs-debug-types.exp with target board unix/gdb:debug_flags=-gdwarf-5, I run into: ... (gdb) file cpexprs-debug-types^M Reading symbols from cpexprs-debug-types...^M ERROR: Couldn't load cpexprs-debug-types into GDB (eof). ERROR: Couldn't send delete breakpoints to GDB. ERROR: GDB process no longer exists GDB process exited with wait status 23054 exp9 0 0 CHILDKILLED SIGABRT SIGABRT ... We're running into this abort in process_psymtab_comp_unit: ... switch (reader.comp_unit_die->tag) { case DW_TAG_compile_unit: this_cu->unit_type = DW_UT_compile; break; case DW_TAG_partial_unit: this_cu->unit_type = DW_UT_partial; break; default: abort (); } ... because reader.comp_unit_die->tag == DW_TAG_type_unit. Fix this by adding a DW_TAG_type_unit case. Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit gdb/ChangeLog: 2021-02-05 Tom de Vries PR symtab/27333 * dwarf2/read.c (process_psymtab_comp_unit): Handle DW_TAG_type_unit. --- gdb/dwarf2/read.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 424a0da3d6c..dd308ca7ba3 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -7836,6 +7836,9 @@ process_psymtab_comp_unit (dwarf2_per_cu_data *this_cu, case DW_TAG_partial_unit: this_cu->unit_type = DW_UT_partial; break; + case DW_TAG_type_unit: + this_cu->unit_type = DW_UT_type; + break; default: abort (); }