From patchwork Thu Oct 10 07:25:07 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: 98639 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 201D53857B8C for ; Thu, 10 Oct 2024 07:25:58 +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 [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 8CD543858405 for ; Thu, 10 Oct 2024 07:25:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8CD543858405 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 8CD543858405 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728545114; cv=none; b=BZC0Iz/1T4lHnLJMrIOWNGwkMrg8wsNfaenVVBu4exKDFpXLwYJtwZAkHVoBHXU7bDx630GjzlxSpNiL1XjT/BunVQfl5FCH1xDsi56isH+9VthVBJ8Hv6znvY6q/s4g1Vdu2hR7knC16hDO/a7Uzjb9affYIU5+lHLwnwUxDSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728545114; c=relaxed/simple; bh=lPlEG+A/qrYZXSnIWCzPHG3FkCx0V/1zrnW8dEQLUys=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=Y6DGdhBW6PDkBwmUuLlY8cBnd9fDeqWTaSu3peD0ZkJnpTOtwpbAj7ujvZgcIk7pu/X2paTJIhbS5jEKmcKpIyppgUqsi9xcbQcac68Y1GclShJn40pBNKwEWYZSpL36oDQZ3spRKGksta3IbMGFHEHJLaKAzA6t2cNgRDSJzuI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [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 A99851FEC9 for ; Thu, 10 Oct 2024 07:25:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1728545111; 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=5Wu3PD29ZPzM91ExF2aJGBAts+YAsOehAF5/NC2FpLs=; b=mBrvPRlUEwBo+IQg0Mmc8eduvyz/3GNcSTP2OKuS6rFdw7H2LwrAaLMDXkm1O6IaaEc/OE 3ZqeCQe2ifCxzfMWgefumx97vDK34g+qzdgQZ+UovI5t33IEV6YiuLkauvVl9JTS6YGziQ oedi8eK4k6RbKk9cdZDIpMrkWy3f3lY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1728545111; 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=5Wu3PD29ZPzM91ExF2aJGBAts+YAsOehAF5/NC2FpLs=; b=a+CMP04qeFolYha0hzgro5Tgi5e6WjF7dnfJqXmZ351NomU5PT7oq7jX9G7mHU15iQqkZo PjcoodpWtKzDCzAQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1728545111; 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=5Wu3PD29ZPzM91ExF2aJGBAts+YAsOehAF5/NC2FpLs=; b=mBrvPRlUEwBo+IQg0Mmc8eduvyz/3GNcSTP2OKuS6rFdw7H2LwrAaLMDXkm1O6IaaEc/OE 3ZqeCQe2ifCxzfMWgefumx97vDK34g+qzdgQZ+UovI5t33IEV6YiuLkauvVl9JTS6YGziQ oedi8eK4k6RbKk9cdZDIpMrkWy3f3lY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1728545111; 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=5Wu3PD29ZPzM91ExF2aJGBAts+YAsOehAF5/NC2FpLs=; b=a+CMP04qeFolYha0hzgro5Tgi5e6WjF7dnfJqXmZ351NomU5PT7oq7jX9G7mHU15iQqkZo PjcoodpWtKzDCzAQ== 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 8288F13A70 for ; Thu, 10 Oct 2024 07:25:11 +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 eKJ7HleBB2cqWgAAD6G6ig (envelope-from ) for ; Thu, 10 Oct 2024 07:25:11 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 2/5] [gdb/testsuite] Fix some test-cases for check-read1 (pipe/grep) Date: Thu, 10 Oct 2024 09:25:07 +0200 Message-Id: <20241010072510.25545-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20241010072510.25545-1-tdevries@suse.de> References: <20241010072510.25545-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: X-Spam-Status: No, score=-12.4 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~patchwork=sourceware.org@sourceware.org I ran the testsuite in an environment simulating a stressed system in combination with check-read1. This exposes a few more FAILs. Fix some by using pipe / grep to filter out unnecessary output. Tested on x86_64-linux. --- .../gdb.base/breakpoint-in-ro-region.exp | 2 +- gdb/testsuite/gdb.base/charset.exp | 17 ++++++++++++++--- gdb/testsuite/gdb.base/corefile.exp | 19 ++++++++++++------- gdb/testsuite/gdb.base/osabi.exp | 3 ++- .../gdb.base/sss-bp-on-user-bp-2.exp | 2 +- gdb/testsuite/gdb.threads/corethreads.exp | 6 ++++-- 6 files changed, 34 insertions(+), 15 deletions(-) diff --git a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp index b0a51961870..21cc7ff5133 100644 --- a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp +++ b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp @@ -43,7 +43,7 @@ proc probe_target_hardware_step {} { gdb_test_no_output "set debug target 1" set test "probe target hardware step" - gdb_test_multiple "si" $test { + gdb_test_multiple "pipe si | grep resume" $test { -re "resume \\(\[^\r\n\]+, step, .*$gdb_prompt $" { set hw_step 1 pass $test diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp index babfa285c94..0d39d04bc87 100644 --- a/gdb/testsuite/gdb.base/charset.exp +++ b/gdb/testsuite/gdb.base/charset.exp @@ -87,9 +87,20 @@ if {[lsearch -exact $show_charset $show_host_charset] >= 0} { } # Try a malformed `set charset'. -gdb_test "set charset" \ - "Requires an argument. Valid arguments are.*" \ - "try malformed `set charset'" +set cmd "set charset" +set ok 0 +gdb_test_multiple $cmd "try malformed `set charset'" { + -re "^$cmd\r\nRequires an argument. Valid arguments are " { + set ok 1 + exp_continue + } + -re ", " { + exp_continue + } + -re -wrap "" { + gdb_assert { $ok } $gdb_test_name + } +} # Try using `set host-charset' on an invalid character set. gdb_test "set host-charset my_grandma_bonnie" \ diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp index f4f102a156b..dc3c8b1dfc8 100644 --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp @@ -266,7 +266,10 @@ proc corefile_test_run {} { clean_restart $::binfile gdb_test "core-file $corefile" "Core was generated by .*" "run: load core again" - gdb_test "info files" "\r\nLocal core dump file:\r\n.*" "run: sanity check we see the core file" + set re "Local core dump file:" + gdb_test "pipe info files | grep \"$re\"" \ + "Local core dump file:" \ + "run: sanity check we see the core file" set test "run: with core" if [runto_main] { @@ -276,11 +279,12 @@ proc corefile_test_run {} { } set test "run: core file is cleared" - gdb_test_multiple "info files" $test { - -re "\r\nLocal core dump file:\r\n.*\r\n$gdb_prompt $" { + set re "Local core dump file:" + gdb_test_multiple "pipe info files | grep \"$re\"" $test { + -re -wrap $re { fail $test } - -re "\r\n$gdb_prompt $" { + -re -wrap "" { pass $test } } @@ -349,11 +353,12 @@ proc corefile_test_attach {} { gdb_test "attach $pid" "Attaching to process $pid\r\n.*" "attach: with core" set test "attach: core file is cleared" - gdb_test_multiple "info files" $test { - -re "\r\nLocal core dump file:\r\n.*\r\n$gdb_prompt $" { + set re "Local core dump file:" + gdb_test_multiple "pipe info files | grep \"$re\"" $test { + -re -wrap $re { fail $test } - -re "\r\n$gdb_prompt $" { + -re -wrap "" { pass $test } } diff --git a/gdb/testsuite/gdb.base/osabi.exp b/gdb/testsuite/gdb.base/osabi.exp index 9bbfff52bae..4fd267bdbf4 100644 --- a/gdb/testsuite/gdb.base/osabi.exp +++ b/gdb/testsuite/gdb.base/osabi.exp @@ -24,7 +24,8 @@ require !gdb_debug_enabled proc test_set_osabi_none { } { clean_restart gdb_test_no_output "set debug arch 1" - gdb_test "set osabi none" ".*gdbarch_find_by_info: info.osabi 1 \\(none\\).*" + gdb_test "pipe set osabi none | grep gdbarch_find_by_info" \ + ".*gdbarch_find_by_info: info.osabi 1 \\(none\\).*" } test_set_osabi_none diff --git a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp index 773afa793a0..226a756c765 100644 --- a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp +++ b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp @@ -64,7 +64,7 @@ delete_breakpoints gdb_test_no_output "set debug target 1" set hardware_step 0 set test "probe target hardware step" -gdb_test_multiple "si" $test { +gdb_test_multiple "pipe si | grep resume" $test { -re "resume \\(\[^\r\n\]+, step, .*$gdb_prompt $" { set hardware_step 1 pass $test diff --git a/gdb/testsuite/gdb.threads/corethreads.exp b/gdb/testsuite/gdb.threads/corethreads.exp index dfaca828a45..41759486046 100644 --- a/gdb/testsuite/gdb.threads/corethreads.exp +++ b/gdb/testsuite/gdb.threads/corethreads.exp @@ -35,8 +35,10 @@ if {$corefile == ""} { clean_restart $executable gdb_test "core-file $corefile" "Core was generated by .*" "load core" -gdb_test "info files" "\r\nLocal core dump file:\r\n.*" "sanity check we see the core file" - +set re "Local core dump file:" +gdb_test "pipe info files | grep \"$re\"" \ + $re \ + "sanity check we see the core file" set test "print pthread_t of thread0" gdb_test_multiple "p/x thread0" $test { -re " = (0x\[0-9a-f\]+)\r\n$gdb_prompt $" {