From patchwork Sat Oct 29 07:43:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 59613 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 5D73E3857805 for ; Sat, 29 Oct 2022 07:44:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D73E3857805 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667029463; bh=B1dxhqMxTut7/MjIBFsPuygBF2tAbb/DZo/5Bwj3vJI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ZTh0IC3tzwbSfyXUBQ+LfYW5Wta+zrwg4ZBZ2BYNgfzxTW/VD60K6OdEusmRaUo8g BP/LwPa9WVCcqYc74u3exbzfK9A5kL4YdEjDPA23E2xUcEHvgjB6rH2dAQdIYTEhb/ ttkuuSqxy5YkqLAGFSyuCXERXWV4SmWCPtMYWOnk= 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.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 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) 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 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 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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"