From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 2A9A03858412 for ; Wed, 20 Sep 2023 14:06:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A9A03858412 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 61BE421D38; Wed, 20 Sep 2023 14:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1695218786; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AOlBk25w5vmdUiliAixZrlve4DLrd/QvoiiJCelJsK0=; b=yPiUkojfS2N8WXhzBPopYtPWbV8lRZLCHePoz+59oIAcynn9ZI3PInoVnrmkBek4fE5J+8 6PQN3d3+Nv9dTYUscF2jKK9nieDRILDZFPn89oUyGvtbXS+MXWzIOhvPKGR3DUEjoISNjB ZIXxlntU7nuwqhXHHj5wS4O6eSw7+mU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1695218786; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AOlBk25w5vmdUiliAixZrlve4DLrd/QvoiiJCelJsK0=; b=VjSxZ3twbLwmkZZcpDCJ9rU/ZL4mKEKaRd3gMA/C2IDt/vg8r6FIue9wm7reYqPDBHeOwL mpqQCXJxKuWkIYAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4D50C1333E; Wed, 20 Sep 2023 14:06:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NZzUEWL8CmWLFgAAMHmgww (envelope-from ); Wed, 20 Sep 2023 14:06:26 +0000 Message-ID: <5b47cd2d-efa5-43df-942b-5129d5896dcb@suse.de> Date: Wed, 20 Sep 2023 16:06:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/symtab] Error out for .debug_types section in dwz file Content-Language: en-US To: Guinevere Larsen , gdb-patches@sourceware.org References: <20230912084326.26830-1-tdevries@suse.de> <422fd996-6908-7663-9531-50654a6185cb@redhat.com> From: Tom de Vries In-Reply-To: <422fd996-6908-7663-9531-50654a6185cb@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 9/20/23 11:18, Guinevere Larsen wrote: > On 12/09/2023 10:43, Tom de Vries via Gdb-patches wrote: >> There are two methods to factor out type information in a dwarf4 >> executable: >> - use -fdebug-info-types to generate type units in a .debug_types >> section, and >> - use dwz to create partial units. >> >> The dwz method has an extra benefit: it also allows to factor out >> information >> between executables into a newly created .dwz file, pointed to by a >> .gnu_debugaltlink section. >> >> There is nothing prohibiting a .gnu_debugaltlink file to contain a >> .debug_types section. >> >> It's just not generated by dwz or any other tool atm, and consequently >> gdb has >> no support for it.  Enhancement PR symtab/30838 is open about the lack of >> support. >> >> Make the current situation explicit by emitting a dwarf error: >> ... >> (gdb) file struct-with-sig-2^M >> Reading symbols from struct-with-sig-2...^M >> Dwarf Error: .debug_types section not supported in dwz file^M >> ... >> and add an assert in write_gdbindex: >> ... >> +      /* See enhancement PR symtab/30838.  */ >> +      gdb_assert (!(per_cu->is_dwz && per_cu->is_debug_types)); >> ... >> to clarify why we can use: >> ... >>        data_buf &cu_list = (per_cu->is_debug_types >>                             ? types_cu_list >>                             : per_cu->is_dwz ? dwz_cu_list : >> objfile_cu_list); >> ... >> >> The test-case is a modified copy from gdb.dwarf2/struct-with-sig.exp, >> so it >> keeps the copyright years range. >> >> Tested on x86_64-linux. >> >> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30838 >> --- > > Hi! I tested this patch and it does not add any regression, and properly > detects the situation. > Hi, Thanks for testing this, committed. - Tom > Tested-By: Guinevere Larsen >