From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 33D713857B8D for ; Fri, 23 Sep 2022 14:22:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 33D713857B8D Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 28NEMlCU005833 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Sep 2022 10:22:52 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 28NEMlCU005833 Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A9E891E0D3; Fri, 23 Sep 2022 10:22:47 -0400 (EDT) Message-ID: Date: Fri, 23 Sep 2022 10:22:47 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] gdb/testsuite/tui: start GDB with "set filename-display basename" Content-Language: en-US To: Tom Tromey , Simon Marchi via Gdb-patches References: <20220922160215.742183-1-simon.marchi@polymtl.ca> <87k05u19p4.fsf@tromey.com> From: Simon Marchi In-Reply-To: <87k05u19p4.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 23 Sep 2022 14:22:47 +0000 X-Spam-Status: No, score=-3032.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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-List-Received-Date: Fri, 23 Sep 2022 14:22:54 -0000 On 2022-09-23 09:50, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> And that causes `wait_for` to think the "step" command is complete. > Simon> This is wrong, as the prompt at line 17 isn't the prompt drawn after the > Simon> completion of the "step" command. The subsequent tests now run with a > Simon> partially updated screen (what is shown above) and obviously fail. > > Simon> The ideal way to fix this would be for `wait_for` to be smarter, to > Simon> avoid it confusing the different prompts drawn. > > This is actually ridiculously hard. Not being able to solve this is why > we added the refresh-counting hack for TUI testing. Ok, I'm not aware of that. But yeah I thought about this problem for a day and didn't find any magic solution. The only semi-relevant idea I had was to track at which line the last prompt was printed. And when matching a prompt, it must be at a line >= where the last prompt was printed. If it's above, it means it's a redraw of an old prompt. > Simon> Doing this happens to fix my failures and makes my CI happy (which in > Simon> turns makes me happy). To be clear, I understand that this does not fix > Simon> the root issue of `proc wait_for` being confused. However, it makes TUI > Simon> test runs be more similar for everyone, such that there's less chance of > Simon> TUI tests randomly failing for somebody. > > It seems like an improvement to me. > > Simon> Note that there are other reasons why TUI tests could vary, like > Simon> different curses library versions taking different re-drawing decisions. > Simon> However, I think my change is a good step towards more stable test > Simon> results. > > Indeed, I think this has happened already. > > Anyway the patch looks good to me. Thanks, I'll push it. Simon