From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 5653F385B534 for ; Fri, 10 Feb 2023 14:19:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5653F385B534 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x336.google.com with SMTP id l37-20020a05600c1d2500b003dfe46a9801so4210118wms.0 for ; Fri, 10 Feb 2023 06:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=C4p6HYRfSQVuZRdotvEK0beyhpyr2d4a/04b5j3j330=; b=R7k7oqxcycAxCN2qcL3mNoB/+xoMJRfSq1k5UbBb3WKpJlZ3mYZQAy38xu25glerkg RxSFy5OzqCfrHgQjVW2HvVnUIXaNOgXUghxCluN2ukEI2YS2/oAp/vilQ8wpLdXZxs/m OfLfvmxLxiHl74K/Or9gh8ul4Ww+1tKD9Cvo5f3hrU+Vw+OLoVtE53TIYG2iDafukmfV 3y//5tcFNyphc7MgBAKcS3Z/sheF/aNZBQP3OgJNET6QAldmew83er64pVc7qoRjAGpb mdmOAikdraZ1qdaj2U/8ejPaldgRk213INAvLCz5aTckhMBGdwwbLAh2OetnGEWr29CH wsKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=C4p6HYRfSQVuZRdotvEK0beyhpyr2d4a/04b5j3j330=; b=PebalCyUUEIhuMIuVHEP2/rEwpEd3YGjQnrRTRAFfJ4QCspWx0v7ilhP5hLGIYwGox jhhGPTrVgMZacwF64u7wN7HsbWsaLgOrIwfmVp013MzPCBj2di/KekCbFyAa5HZkTFTe SPQJuHlCYb4HxLlDPMEoMiLOa98kRMp0vQMScK6TfhbQAjDrSZACTjomRU7Th/l94rG8 eamK0nqHMdrGy5r19an227qrM2PD3/w6SvLPlDkCUIXT1zNGKkt6FCt14PR0vTHMdKoO 8ya0/YmnNnxIC1C7GjhITpA848y0ZUkyzS2dN8TAuAjA572T/0rwWk60LPKx36ofkq3E VXDg== X-Gm-Message-State: AO0yUKWHHR9++dcTqrikfXSUa1BzPQpT2Gn1N98mV7gfcZ2QUL1TlBUH tXJRDh8xWO7dP8L42B/s8YcgI1Zs+TPUZw96 X-Google-Smtp-Source: AK7set8qvYSKgVYGvlDot9vuyNf4TjYEBkqBNJCrvGle2P8BED0rerRipeTra7G0BDKuxMsrWIvOjw== X-Received: by 2002:a05:600c:4da4:b0:3dc:37d0:e9df with SMTP id v36-20020a05600c4da400b003dc37d0e9dfmr12626563wmp.14.1676038784234; Fri, 10 Feb 2023 06:19:44 -0800 (PST) Received: from tpp.orcam.me.uk (tpp.orcam.me.uk. [2001:8b0:154:0:ea6a:64ff:fe24:f2fc]) by smtp.gmail.com with ESMTPSA id bg1-20020a05600c3c8100b003e118684d56sm5331418wmb.45.2023.02.10.06.19.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Feb 2023 06:19:43 -0800 (PST) Date: Fri, 10 Feb 2023 14:19:42 +0000 (GMT) From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: Andrew Burgess , Tom Tromey , Richard Bunt Subject: [PATCH v4 5/6] GDB/testsuite: Add `-nonl' option to `gdb_test' In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,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 List-Id: Add a `-nonl' option to `gdb_test' making it possible to match output from commands such as `output' that do not produce a new line sequence at the end, e.g.: (gdb) output 0 0(gdb) --- No change from v3. No change from v2. New change in v2. --- gdb/testsuite/lib/gdb.exp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) gdb-test-nonl.diff Index: src/gdb/testsuite/lib/gdb.exp =================================================================== --- src.orig/gdb/testsuite/lib/gdb.exp +++ src/gdb/testsuite/lib/gdb.exp @@ -1395,6 +1395,8 @@ proc gdb_test_multiline { name args } { # have any effect if -prompt is specified. # -lbl specifies that line-by-line matching will be used. # -nopass specifies that a PASS should not be issued. +# -nonl specifies that no \r\n sequence is expected between PATTERN +# and the gdb prompt. # # Returns: # 1 if the test failed, @@ -1410,6 +1412,7 @@ proc gdb_test { args } { {no-prompt-anchor} {lbl} {nopass} + {nonl} } lassign $args command pattern message question response @@ -1424,12 +1427,13 @@ proc gdb_test { args } { } set prompt [fill_in_default_prompt $prompt [expr !${no-prompt-anchor}]] + set nl [expr ${nonl} ? {""} : {"\[\r\n\]+"}] set saw_question 0 set user_code {} lappend user_code { - -re "\[\r\n\]*(?:$pattern)\[\r\n\]+$prompt" { + -re "\[\r\n\]*(?:$pattern)$nl$prompt" { if { $question != "" & !$saw_question} { fail $message } elseif {!$nopass} {