From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 16BD73858D35 for ; Wed, 21 Jun 2023 13:35:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 16BD73858D35 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 015751FE76; Wed, 21 Jun 2023 13:35:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687354529; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M0xYXlhz0b+a2HXozhaDPvitAdKpox8i8wl1DuJpH7k=; b=U4VSUhiMTbJOjJHHCdEhxTz+YAm682o0TO86hHbsOGcPQvTteKEzFj4txgGcoU7mlzZA0j 9SBjIq2w00lDbYyZCTraSXUl7/Ejfgzk26xPgQYGAkgV8uhXGke0SBieUWl1s3UuM/bVNk A4Vg5iJ5F532i3+rKSBLeVOsFdhDnD8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687354529; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M0xYXlhz0b+a2HXozhaDPvitAdKpox8i8wl1DuJpH7k=; b=UhAPdPp8XBDIT6ANrUkCIdSrGO6jfvhuhkBYKPIG0QXhXoISd30CmnecAiV4JQo8EufcQB C14EifKZtkZpZOAA== 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 E2B0D134B1; Wed, 21 Jun 2023 13:35:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id n0lRNqD8kmS2awAAMHmgww (envelope-from ); Wed, 21 Jun 2023 13:35:28 +0000 Message-ID: <8efaccce-ef77-125f-d52b-2ec0146fc427@suse.de> Date: Wed, 21 Jun 2023 15:35:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] [gdb/testsuite] Remove Term::command_no_prompt_prefix Content-Language: en-US To: gdb-patches@sourceware.org Cc: Tom Tromey References: <20230609072605.2327-1-tdevries@suse.de> From: Tom de Vries In-Reply-To: <20230609072605.2327-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: On 6/9/23 09:26, Tom de Vries via Gdb-patches wrote: > Say we run test-case gdb.tui/basic.exp. It calls Term::enter_tui, which does: > ... > command_no_prompt_prefix "tui enable" > ... > > The proc command_no_prompt_prefix is documented as: > ... > # As proc command, but don't wait for an initial prompt. This is used for > # initial terminal commands, where there's no prompt yet. > ... > > Indeed, before the "tui enable" command, the tuiterm is empty, so there is no > prompt. > > The reason that there is no prompt, is that: > - in order for tuiterm to show something, its input processing procs need to > be called, and > - the initial gdb prompt, and subsequent prompts generated by gdb_test-style > procs, are all consumed by those procs instead. > > This is in principle not a problem, but the absence of a prompt makes a > tuiterm session look less like a session on an actual xterm. > > Fix this by using a new proc gen_prompt, that: > - generates a prompt using ^C (though also something like echo \n would work) > - consumes the response before the prompt using gdb_expect > - consumes the prompt using Term::wait_for "". > > A fix was necessary to Term::wait_for, to make sure that Term::wait_for "" > consumes just one prompt. > > This allows us to use the regular proc command instead: > ... > gen_prompt > command "tui enable" > ... > such that we have in tuiterm: > ... > (gdb) tui enable > ... > instead of: > ... > tui enable > ... > > Fix all uses of command_no_prompt_prefix, and remove it. > I split up the patch in two parts (one separate patch for the change in Term::wait_for), and rather than removing command_no_prompt_prefix, reimplemented it. Committed, and posted here: - https://sourceware.org/pipermail/gdb-patches/2023-June/200422.html - https://sourceware.org/pipermail/gdb-patches/2023-June/200423.html Thanks, - Tom