From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aBf9GbvbaWTeLRAAWB0awg (envelope-from ) for ; Sun, 21 May 2023 04:52:11 -0400 Received: by simark.ca (Postfix, from userid 112) id 672231E11E; Sun, 21 May 2023 04:52:11 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=G4PO1MgL; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 587481E0D6 for ; Sun, 21 May 2023 04:52:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 59BA03858C53 for ; Sun, 21 May 2023 08:52:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59BA03858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684659129; bh=+/zMJf16bJsq8dnHflH92YbKVcbw/fq8f3l/JKRrmw0=; h=To:Cc:Subject:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=G4PO1MgL1QqkLcZx8Me/yoqcPmILQ/0r1MAZjBRdFsTpFyCzejRqT4wBEIBpMbqs+ cnFQtws95pUXueg+FAYILgRrsHHqoWflbVAXs8Z+TNVYBwdneoL4LA2ZVAk7d4m2Rv DYY2dRiwDWIXVKxERD8D14pBVYk4isC5ecN1HJrY= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 892903858D33 for ; Sun, 21 May 2023 08:51:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 892903858D33 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-180-JHM0Zav7Pq20ppYVXg1NZQ-1; Sun, 21 May 2023 04:51:46 -0400 X-MC-Unique: JHM0Zav7Pq20ppYVXg1NZQ-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-309579be13cso1238364f8f.3 for ; Sun, 21 May 2023 01:51:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684659105; x=1687251105; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+/zMJf16bJsq8dnHflH92YbKVcbw/fq8f3l/JKRrmw0=; b=lM1jCyRfG4I/fgPhiRCJ9M/CftbqtL14hqK+yfEKBODgj+kBbZ7hbaCe0Xm201TW5c 9EcCOs2Jkc7kDcn1xMnU1qyZO3CxtX0nZ9trZflU/gWSA7imTGLgrcnXOxhS7TPRHp3O +0vSSdLAoO94vOb7aFtlv7LRQsAOgQpZJ3iZGewuzt/KMw1hciYMQhdk66Ri5pucox2Q OVzgRg5jaXNXjsCHgienTNu6x90ELbb9o4t4GaK8WMSIeVL/KE73BfYyO/oPHTA7d1mN GOJro1HpPbGl0MsegOOb7Davl4QvQwCUdopyYfaw0nlIEEWOaLZp0Dtmjs925rMzFoTf klkg== X-Gm-Message-State: AC+VfDy7Q6mHk1Y0SiztBPrEm9PjM2z4V6uOxe97S9vEW66FnB21UiRw S7eGHrQI7jFQYl1+XXGwQUCUs6sn2/neQ5b0aBxUHd7ugWd3+DMkWEe8qK7DwdTXI2xe0uUP+Id i39Ms8+NkRkLJjtEKF0eeag== X-Received: by 2002:a5d:61cb:0:b0:306:330e:bfe3 with SMTP id q11-20020a5d61cb000000b00306330ebfe3mr6279808wrv.19.1684659105130; Sun, 21 May 2023 01:51:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4qkk/Yobsc+Ma17BFpa4GYI9h542N7lg5QaVuIjXODKXl+RBGVL57UMicSriW2pCBOHu/YGQ== X-Received: by 2002:a5d:61cb:0:b0:306:330e:bfe3 with SMTP id q11-20020a5d61cb000000b00306330ebfe3mr6279799wrv.19.1684659104760; Sun, 21 May 2023 01:51:44 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id k1-20020adfd841000000b002f28de9f73bsm4070574wrl.55.2023.05.21.01.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 May 2023 01:51:44 -0700 (PDT) To: Tom de Vries , gdb-patches@sourceware.org Cc: Simon Marchi Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.tui/wrap-line.exp In-Reply-To: <20230518061046.17837-1-tdevries@suse.de> References: <20230518061046.17837-1-tdevries@suse.de> Date: Sun, 21 May 2023 09:51:42 +0100 Message-ID: <87ilcm83tt.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Tom de Vries via Gdb-patches writes: > PR testsuite/30458 reports the following FAIL: > ... > PASS: gdb.tui/wrap-line.exp: width-auto-detected: cli: wrap > ^CQuit > (gdb) WARNING: timeout in accept_gdb_output > Screen Dump (size 50 columns x 24 rows, cursor at column 6, row 3): > 0 Quit > 1 (gdb) 7890123456789012345678901234567890123456789 > 2 W^CQuit > 3 (gdb) > ... > FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: prompt after wrap > ... > > The problem is that the regexp doesn't account for the ^C: > ... > gdb_assert { [Term::wait_for "^WQuit"] } "prompt after wrap" > ... > > Fix this by updating the regexp, and likewise in another place in the > test-case where we use ^C. Do we know why we sometimes manage to see '^C'? I guess it's a timing thing, but right now I'm at a loss for how we manage to see it. It appears that we print the wrapping line, that ends with 'W', and then wait for this to be displayed. At this point GDB should be in a stable state waiting in the event-loop. When we send \003 this should trigger an event, which should trigger async_request_quit, which should result in the 'Quit' exception being thrown, caught, and printed. I think the '^C' must be getting printed from tui_redisplay_readline maybe, but I can't see how that gets triggered with \003 in the input buffer. I only ask because if we understand why '^C' is sometimes printed then we might be able to decide if this should always be printed, or never be printed, and change GDB accordingly... Thanks, Andrew > > Tested on x86_64-linux. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30458 > --- > gdb/testsuite/gdb.tui/wrap-line.exp | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/gdb/testsuite/gdb.tui/wrap-line.exp b/gdb/testsuite/gdb.tui/wrap-line.exp > index 4587517504c..2bfe342e04d 100644 > --- a/gdb/testsuite/gdb.tui/wrap-line.exp > +++ b/gdb/testsuite/gdb.tui/wrap-line.exp > @@ -25,6 +25,8 @@ set cols 50 > set lines 24 > set dims [list $lines $cols] > > +set re_control_c "(\\^C)?Quit" > + > # Fill line, assuming we start after the gdb prompt. > proc fill_line { width } { > set res "" > @@ -47,7 +49,7 @@ proc fill_line { width } { > proc test_wrap { wrap_width } { > # Generate a prompt and parse it. > send_gdb "\003" > - gdb_assert { [Term::wait_for "(^|$::gdb_prompt )Quit"] } "start line" > + gdb_assert { [Term::wait_for "(^|$::gdb_prompt )$::re_control_c"] } "start line" > > # Fill the line to just before wrapping. > set str [fill_line $wrap_width] > @@ -64,7 +66,7 @@ proc test_wrap { wrap_width } { > > # Generate a prompt and parse it. > send_gdb "\003" > - gdb_assert { [Term::wait_for "^WQuit"] } "prompt after wrap" > + gdb_assert { [Term::wait_for "^W$::re_control_c"] } "prompt after wrap" > } > > # Test wrapping in both CLI and TUI. > > base-commit: 0cc8cc5e6f82b8d3d8e3803c6f7f5e63f0c866ad > -- > 2.35.3