From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id D3A413858C83 for ; Sat, 29 Oct 2022 07:43:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3A413858C83 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-out2.suse.de (Postfix) with ESMTPS id 12C7A1FAD5 for ; Sat, 29 Oct 2022 07:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1667029438; 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=B1dxhqMxTut7/MjIBFsPuygBF2tAbb/DZo/5Bwj3vJI=; b=EpWf9bpSQAACMSAWcDsFSVK6+O0dQXA5IfjO7dYKI/RXRN+q+UUb57BLNGdC1Gw4Dkn1/+ f1sbiCjH7gYk2JbdmltykYUvzeBKuY/8X4wMMaOwqR87iJCE4jGEwqZx7QWW4uVqBYzn6K qE1ikZN2QC5t1aFeFAQCEpvE/Z4dqBs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1667029438; 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=B1dxhqMxTut7/MjIBFsPuygBF2tAbb/DZo/5Bwj3vJI=; b=RY//jr/t5X3cx7uP19HlWXJAffDmwkVlDqC5fTHgckVJtz0idJC8ZwkuuEBQjwxNh7t3Rm O0h2jgY9Sse+FTAg== 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 F2A9013AA4 for ; Sat, 29 Oct 2022 07:43:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MF4KOr3ZXGO+VgAAMHmgww (envelope-from ) for ; Sat, 29 Oct 2022 07:43:57 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed 2/3] [gdb/testsuite] Fix gdb.server/multi-ui-errors.exp with local-remote-host-notty Date: Sat, 29 Oct 2022 09:43:56 +0200 Message-Id: <20221029074357.12305-3-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221029074357.12305-1-tdevries@suse.de> References: <20221029074357.12305-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 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: With test-case gdb.server/multi-ui-errors.exp and host board local-remote-host-notty, I run into: ... (gdb) PASS: gdb.server/multi-ui-errors.exp: interact with GDB's main UI Executing on target: kill -9 29666 (timeout = 300) builtin_spawn -ignore SIGHUP kill -9 29666^M echo^M Remote connection closed^M (gdb) (gdb) FAIL: gdb.server/multi-ui-errors.exp: \ main UI, prompt after gdbserver dies (timeout) ... In contrast, with local-remote-host (so, everything the same but editing off): ... (gdb) PASS: gdb.server/multi-ui-errors.exp: interact with GDB's main UI Executing on target: kill -9 31245 (timeout = 300) builtin_spawn -ignore SIGHUP kill -9 31245^M Remote connection closed^M (gdb) echo^M (gdb) PASS: gdb.server/multi-ui-errors.exp: main UI, prompt after gdbserver dies ... The test-case issues a kill, which results in a "Remote connection closed" message and a prompt. The problem is that the prompt is not consumed, so the subsequent echo may be issued before that prompt, which causes a mismatch when matching the result of the echo. Fix this by consuming the "Remote connection closed" message and prompt. Tested on x86_64-linux. --- gdb/testsuite/gdb.server/multi-ui-errors.exp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdb/testsuite/gdb.server/multi-ui-errors.exp b/gdb/testsuite/gdb.server/multi-ui-errors.exp index 8a1276fb272..45a2dabbd6c 100644 --- a/gdb/testsuite/gdb.server/multi-ui-errors.exp +++ b/gdb/testsuite/gdb.server/multi-ui-errors.exp @@ -111,6 +111,14 @@ remote_exec target "kill -9 $gdbserver_pid" # The point is that we should be able to interact with GDB from either # interpreter now. +with_spawn_id $gdb_main_spawn_id { + gdb_test_multiple "" "remote connection closed - main UI" { + -re -wrap "Remote connection closed" { + pass $gdb_test_name + } + } +} + with_spawn_id $gdb_main_spawn_id { gdb_test "echo" "" \ "main UI, prompt after gdbserver dies" -- 2.35.3