From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684659108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+/zMJf16bJsq8dnHflH92YbKVcbw/fq8f3l/JKRrmw0=; b=Ze2EfmIlpLyNL7vyLExqRh6QlGMjNm1tTz50/ht+q0BXr6S13W6XWsnyljLtigbrEYClMJ UTeUyttx9UVOdXAfiVGjBx3B0QLQeRaHkJ7UW8v+iUtjNcFiJ9GIfKKYeOVx3V/mBFGyUq 47eQb+SzG5AC9jKQxcMMSwFq3M1KGHU= 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) From: Andrew Burgess 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-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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: 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