From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id K9rVK+PEDmbORiMAWB0awg (envelope-from ) for ; Thu, 04 Apr 2024 11:18:59 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=UlOtcqoR; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=g4xVrlj2; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=UlOtcqoR; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=g4xVrlj2; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9C05D1E0C0; Thu, 4 Apr 2024 11:18:59 -0400 (EDT) Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 57DA71E0AC for ; Thu, 4 Apr 2024 11:18:57 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C094E3846405 for ; Thu, 4 Apr 2024 15:18:56 +0000 (GMT) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id CA0813857C4F for ; Thu, 4 Apr 2024 15:18:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CA0813857C4F 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 CA0813857C4F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712243907; cv=none; b=oTYj2uKgyLHOFVaRzPN4gBw8FSiLHIpyCB5vmQuyqDGDaPpcIaWcWrhS5lmMVFAkfvUjew+m23xlmB5DOItR+K4jwxg0+tDDXoe6SGsUeGGn2xvuGO1hKVtk3y63SZ0n4JRda1OT3/n4FroSRFzUlGaAhSccmGkdSa+oAoBUENU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712243907; c=relaxed/simple; bh=GerYGdP2NHu96UOsCMia7El9HCEw2ylVM3WR20j0dsA=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=f+HJrWkf9pm2gNuVeE5wZT+j3L5JlytyJx/A4tkv3U4CsKvZv5VxTunShZviT4h84crWH3H9VBZWUHXO0NJdKs5wWCMWs6TYM5rUVmNccNU8/7fDI7zIx2TwzPZni7b5r8IY5XhRSKWE3ALiqj/3GhbJLPbvTrsEKkca+SuNfQQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (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-out1.suse.de (Postfix) with ESMTPS id C581737B78 for ; Thu, 4 Apr 2024 15:18:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712243903; 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=90eObCrMUmVfyQsD398IDPBJBTPA/Vgg4zIzkVGvdkc=; b=UlOtcqoR7sgRF6YezpOlz2tCtQXmzCm9GdTmSpKNCS26ORkRZLatjpic0gFv6DxUPAah8/ lu4YSnAU+Ne/SxmV+YDouxEqTDP3wY/hM34bcExALDjnOLx8pWAxBfxs8Do0NHoZ+LXszs 5Cb8JAe0hGEFRHDoVqhPaBgFME5dM00= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712243903; 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=90eObCrMUmVfyQsD398IDPBJBTPA/Vgg4zIzkVGvdkc=; b=g4xVrlj2ZUfdb/X10sDGVMhLs99duTRNyF/QGXWxsC5G5hYi20/OtrAmoGdkGkyY6Kt3nB Fvq/xflbkE0sz1BA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=UlOtcqoR; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=g4xVrlj2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712243903; 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=90eObCrMUmVfyQsD398IDPBJBTPA/Vgg4zIzkVGvdkc=; b=UlOtcqoR7sgRF6YezpOlz2tCtQXmzCm9GdTmSpKNCS26ORkRZLatjpic0gFv6DxUPAah8/ lu4YSnAU+Ne/SxmV+YDouxEqTDP3wY/hM34bcExALDjnOLx8pWAxBfxs8Do0NHoZ+LXszs 5Cb8JAe0hGEFRHDoVqhPaBgFME5dM00= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712243903; 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=90eObCrMUmVfyQsD398IDPBJBTPA/Vgg4zIzkVGvdkc=; b=g4xVrlj2ZUfdb/X10sDGVMhLs99duTRNyF/QGXWxsC5G5hYi20/OtrAmoGdkGkyY6Kt3nB Fvq/xflbkE0sz1BA== Received: from imap2.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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id B18CE13A91 for ; Thu, 4 Apr 2024 15:18:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id EDclKr/EDma1GQAAn2gu4w (envelope-from ) for ; Thu, 04 Apr 2024 15:18:23 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 2/3] [gdb/testsuite] Require address update for DW_LNS_copy Date: Thu, 4 Apr 2024 17:18:26 +0200 Message-Id: <20240404151827.18126-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240404151827.18126-1-tdevries@suse.de> References: <20240404151827.18126-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Spamd-Result: default: False [-4.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_LOW(-1.00)[suse.de:dkim]; 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)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap2.dmz-prg2.suse.org:helo,imap2.dmz-prg2.suse.org:rdns,suse.de:dkim]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Queue-Id: C581737B78 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: -4.01 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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+public-inbox=simark.ca@sourceware.org No address update before a DW_LNS_copy might mean an incorrect dwarf assembly test-case. Try to catch such incorrect dwarf assembly test-cases by: - requiring an explicit address update for each DW_LNS_copy, and - handling the cases where such an update is not needed, by adding "DW_LNS_advance_pc 0". Tested on aarch64-linux. --- gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp | 1 + gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp | 1 + gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp | 1 + gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp | 3 +++ gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl | 1 + gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp | 6 ++++++ gdb/testsuite/lib/dwarf.exp | 3 +++ 7 files changed, 16 insertions(+) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp index 5268e7815ad..6d12e968f41 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp @@ -129,6 +129,7 @@ proc do_test { start_label func_name tag } { DW_LNS_advance_line 1 DW_LNS_copy + DW_LNS_advance_pc 0 DW_LNS_advance_line -4 DW_LNS_set_file 1 DW_LNS_negate_stmt diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp index d3a1fd38ed2..6a5f7d6dd76 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp @@ -119,6 +119,7 @@ Dwarf::assemble $asm_file { DW_LNS_advance_line 1 DW_LNS_copy + DW_LNS_advance_pc 0 DW_LNS_advance_line -4 DW_LNS_set_file 1 DW_LNS_negate_stmt diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp index 66d9f645cf3..b3db154db25 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp @@ -108,6 +108,7 @@ Dwarf::assemble $asm_file { DW_LNS_advance_line 1 DW_LNS_copy + DW_LNS_advance_pc 0 DW_LNS_advance_line -4 DW_LNS_set_file 1 DW_LNS_negate_stmt diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp index b117c8910f0..ed7166983d5 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp @@ -91,13 +91,16 @@ Dwarf::assemble $asm_file { line $f1_l1 DW_LNS_copy + DW_LNS_advance_pc 0 line ${f1_l2} DW_LNS_copy + DW_LNS_advance_pc 0 DW_LNS_set_file 2 line ${f2_l1} DW_LNS_copy + DW_LNS_advance_pc 0 DW_LNS_negate_stmt DW_LNS_copy diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl b/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl index 4f59c9b2639..968378620a0 100644 --- a/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl +++ b/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl @@ -96,6 +96,7 @@ Dwarf::assemble $asm_file { DW_LNS_advance_line 1 DW_LNS_copy + DW_LNS_advance_pc 0 DW_LNS_advance_line -4 DW_LNS_negate_stmt DW_LNS_copy diff --git a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp index a1c0e7705b3..2001b28989f 100644 --- a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp +++ b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp @@ -278,9 +278,12 @@ Dwarf::assemble ${asm_file} { DW_LNE_set_address $foo_start line [gdb_get_line_number "foo prologue" $libsrc] DW_LNS_copy + DW_LNE_set_address foo_label line [gdb_get_line_number "foo return" $libsrc] DW_LNS_copy + + DW_LNS_advance_pc 0 line [gdb_get_line_number "foo end" $libsrc] DW_LNS_copy @@ -291,9 +294,12 @@ Dwarf::assemble ${asm_file} { DW_LNE_set_address $bar_start line [gdb_get_line_number "bar prologue" $libsrc] DW_LNS_copy + DW_LNE_set_address bar_label line [gdb_get_line_number "bar return" $libsrc] DW_LNS_copy + + DW_LNS_advance_pc 0 line [gdb_get_line_number "bar end" $libsrc] DW_LNS_copy diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index 816440f975f..254f88f1055 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -2601,6 +2601,9 @@ namespace eval Dwarf { proc DW_LNS_copy {} { variable _line_address_update + if { $_line_address_update == 0 } { + error "Missing address update for copy" + } set _line_address_update 0 _op .byte 1 } -- 2.35.3