From patchwork Tue May 21 15:44:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 90616 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C9CC0384AB76 for ; Tue, 21 May 2024 15:45:05 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 94101384AB40 for ; Tue, 21 May 2024 15:43:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 94101384AB40 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 94101384AB40 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716306190; cv=none; b=YLEeHXFuN3TfsZ6Dmp7Je1luWoHpwWyy1eVoEvcOzA0pgMM+3S4jA0+QL65KMqbV+6hH9MJ6trGnqLjOz7A9iK+6ULeGPO5jXMUp6xQjxuUSUkfSXJ6WKl8PX5GHa1gfX0ax8n/zeOr0EaiY//argofuFzJRICjnIxa5MlOUkv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716306190; c=relaxed/simple; bh=7zRVs1prGIORq6Twdfa7zQm3f+DaSWVkl79yt6l8vnU=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=If/oLIH7EHbbgDuTGKwZbATOUwXDPH5E+LSUayNV/o8iz4mJWTXa0nvShyRAr4ftqDGAK0zVawNorxweeWub2vSaq7vVbNl1knmxtaKp6NPUlcrGE9v2jUdtXzffhehVU1ePux6SdoAIbNtnavJ46kk4D1WjZqQBcDmBq5HxoQg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EF92A5C295 for ; Tue, 21 May 2024 15:43:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716306185; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iexGmnTUK1jqDHpcLbLUTz6VFNdQgIgXopQypPu0DrU=; b=irCXe2YilMynKzaAh8rfpndaTbHKKOMog2ztXoeiAwAfRQ/uz5cmsYFxLhnbo1FzqPiXmB bDmVvR3yWjyedEBdIcO+33+V5Q/beDTolGTjpRUOePhRbIrJGjIIf8JquoDLYjaHt7JN/1 MnevEiO8QnnHm4tpnDJaghH6HjI5obc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716306185; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iexGmnTUK1jqDHpcLbLUTz6VFNdQgIgXopQypPu0DrU=; b=ebfVJF55aN6G25wUH8HDFZ2rgyrNAY6d2S8ODRqR3lgHrpLHd5Gy0y8zRi57ggtidzNW5r ufIpEgjx9SklZ0Cw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=lYjB7hNn; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/hQwzXFA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716306183; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iexGmnTUK1jqDHpcLbLUTz6VFNdQgIgXopQypPu0DrU=; b=lYjB7hNnC4obkKQYOMhJMdEeTS92oUWilityAUTjj3kKYcP9X8na4d3vCNN6Oci5aR+Dhu TCQn/Zfv/ZGp+rSRti3LtdH5GQ6Lbkeh7iczIJsdbrn3WbunZQi/RHSLsCyCWrFPxagLlq rBNcd8wVK6LRUEw9QC6jrTjuXPa2olc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716306183; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iexGmnTUK1jqDHpcLbLUTz6VFNdQgIgXopQypPu0DrU=; b=/hQwzXFA9KeYB/60MagIY8Se6o1izX2p8/8K2oS6uxM8eLzICVDd2nkyji7x+/7Un9vUZW VVN/TVQaNks70uBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id DA23713A21 for ; Tue, 21 May 2024 15:43:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id mCzuMwfBTGbJGwAAD6G6ig (envelope-from ) for ; Tue, 21 May 2024 15:43:03 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 09/11] [gdb/macros] Fix gdb.base/fission-macro.exp with clang Date: Tue, 21 May 2024 17:44:13 +0200 Message-Id: <20240521154415.9543-9-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240521154415.9543-1-tdevries@suse.de> References: <20240521154415.9543-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Rspamd-Queue-Id: EF92A5C295 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org When running test-case gdb.base/fission-macro.exp with clang, we run into: ... (gdb) info macro FIFTH^M Defined at $build/gdb/testsuite/:18^M included at $src/gdb/testsuite/gdb.base/fission-macro.c:21^M (gdb) FAIL: gdb.base/fission-macro.exp: dwarf_version=4: dwarf_bits=32: \ strict_dwarf=0: info macro FIFTH ... This is caused by the fact that the .debug_macros.dwo section refers to the .debug_line.dwo section, but the .debug_line section is used instead. Fix this by making sure the .debug_line.dwo section is used. PR macros/31750 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31750 --- gdb/dwarf2/read.c | 16 ++++++++++++++++ gdb/testsuite/gdb.base/fission-macro.exp | 6 ++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 6a489502f8b..b742f38c303 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -21224,6 +21224,7 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset, struct dwarf2_section_info *section; const char *section_name; + line_header_up lh_up; if (cu->dwo_unit != nullptr) { if (section_is_gnu) @@ -21236,6 +21237,21 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset, section = &cu->dwo_unit->dwo_file->sections.macinfo; section_name = ".debug_macinfo.dwo"; } + + { + struct dwarf2_section_info *line_section; + + line_section = &cu->dwo_unit->dwo_file->sections.line; + line_section->read (per_objfile->objfile); + if (line_section->buffer == NULL) + { + complaint (_("missing .debug_line.dwo section")); + return; + } + lh_up = dwarf_decode_line_header ((sect_offset)0, 0, per_objfile, + line_section, &cu->header, nullptr); + lh = lh_up.get (); + } } else { diff --git a/gdb/testsuite/gdb.base/fission-macro.exp b/gdb/testsuite/gdb.base/fission-macro.exp index 5474baf21d5..de1ce7d3823 100644 --- a/gdb/testsuite/gdb.base/fission-macro.exp +++ b/gdb/testsuite/gdb.base/fission-macro.exp @@ -13,8 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . */ -# Gcc 14 is the first release containing the fix for PR debug/111409. -require {expr [gcc_major_version] >= 14} +if { [test_compiler_info "gcc-*"] } { + # Gcc 14 is the first release containing the fix for PR debug/111409. + require {expr [gcc_major_version] >= 14} +} standard_testfile .c -2.c .h