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 78CF93858C66 for ; Wed, 22 Mar 2023 08:38:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 78CF93858C66 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 8752122702 for ; Wed, 22 Mar 2023 08:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1679474297; 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=SVRhh5ug2/SI3hBTzyY5dCPy1PgeXY0gHcXGkWrpbwY=; b=Mg5S4fh8YerZIQ62uDYa8xlua8w7F6cHsrXX7MyrlvU6MlqionIbiIxu8kcYRtGbAyTHYR OHtfzKy2i2lc81AMgQnX6aI5qB3JdVzufvPxPlWJl+x8NfD5ir9FXnnje9+e95bXWZgXgf mbSItCJCXViYIGJTVLIVPay9RuiAMQY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1679474297; 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=SVRhh5ug2/SI3hBTzyY5dCPy1PgeXY0gHcXGkWrpbwY=; b=Klotgenlng/VYa8qX/+tCWG/2dAni67g9kRFFT/YrWyTm0LX2QiQGcaOUWGw2ikKWwgaOg qdL1O9eQ1klHGgBA== 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 72454138E9 for ; Wed, 22 Mar 2023 08:38:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YKunGnm+GmRxRAAAMHmgww (envelope-from ) for ; Wed, 22 Mar 2023 08:38:17 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed 2/3] [gdb/testsuite] Fix gdb.cp/annota{2,3}.exp for native-extended-gdbserver Date: Wed, 22 Mar 2023 09:38:18 +0100 Message-Id: <20230322083819.14320-3-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230322083819.14320-1-tdevries@suse.de> References: <20230322083819.14320-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.5 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 List-Id: When running test-cases gdb.cp/annota{2,3}.exp with target board native-extended-gdbserver, we run into a few FAILs, due to the test-cases trying to match inferior output together with gdb output. Fix this by ignoring the inferior output in this case. Tested on x86_64-linux. --- gdb/testsuite/gdb.cp/annota2.exp | 15 +++++++++++++-- gdb/testsuite/gdb.cp/annota3.exp | 25 +++++++++++++++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/gdb.cp/annota2.exp b/gdb/testsuite/gdb.cp/annota2.exp index 64adbbdb220..506817bd498 100644 --- a/gdb/testsuite/gdb.cp/annota2.exp +++ b/gdb/testsuite/gdb.cp/annota2.exp @@ -126,13 +126,24 @@ gdb_test_multiple "print a" "print class" { # `a.x is 1' is asynchronous regarding to `frames-invalid'. # +if { $gdb_spawn_id == $inferior_spawn_id } { + set match_output \ + [multi_line \ + "\($frames_invalid\)*a.x is 1" \ + "\($frames_invalid\)*"] +} else { + # Usually we'd handle this using gdb_test_stdio, but that looks too + # complicated in combination with annotations, so just ignore the inferior + # output. + set match_output "\($frames_invalid\)*" +} + set pat [multi_line "" \ "\032\032post-prompt" \ "Continuing." \ "" \ "\032\032starting" \ - "\(${frames_invalid}\)*a.x is 1" \ - "\(${frames_invalid}\)*"\ + $match_output \ "\032\032exited 0" \ "$inferior_exited_re normally." \ "" \ diff --git a/gdb/testsuite/gdb.cp/annota3.exp b/gdb/testsuite/gdb.cp/annota3.exp index 788bda77f3d..7b85c84cd97 100644 --- a/gdb/testsuite/gdb.cp/annota3.exp +++ b/gdb/testsuite/gdb.cp/annota3.exp @@ -95,14 +95,23 @@ gdb_expect_list "print class" "$gdb_prompt$" { # annotate-exited # send_gdb "continue\n" -gdb_expect_list "continue to exit" "$gdb_prompt$" [concat { - "\r\n\032\032post-prompt\r\n" - "Continuing.\r\n" - "\r\n\032\032starting\r\n" - "a.x is 1\r\n" - "\r\n\032\032exited 0\r\n"} [list "$inferior_exited_re normally.\r\n"] { - "\r\n\032\032stopped\r\n" -}] + +set el {} +lappend el "\r\n\032\032post-prompt\r\n" +lappend el "Continuing.\r\n" +lappend el "\r\n\032\032starting\r\n" +if { $gdb_spawn_id == $inferior_spawn_id } { + lappend el "a.x is 1\r\n" +} else { + # Usually we'd handle this using gdb_test_stdio, but that looks too + # complicated in combination with annotations, so just ignore the inferior + # output. +} +lappend el "\r\n\032\032exited 0\r\n" +lappend el "$inferior_exited_re normally.\r\n" +lappend el "\r\n\032\032stopped\r\n" + +gdb_expect_list "continue to exit" "$gdb_prompt$" $el # # delete all breakpoints -- 2.35.3