From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OAE8OpYSvmAUJQAAWB0awg (envelope-from ) for ; Mon, 07 Jun 2021 08:35:34 -0400 Received: by simark.ca (Postfix, from userid 112) id EC73D1F163; Mon, 7 Jun 2021 08:35:34 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 3C5EF1E939 for ; Mon, 7 Jun 2021 08:35:34 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0AA41383540A for ; Mon, 7 Jun 2021 12:35:34 +0000 (GMT) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id CA4243833011 for ; Mon, 7 Jun 2021 12:34:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CA4243833011 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E4BBF1FDCE for ; Mon, 7 Jun 2021 12:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623069282; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=YrL1/rH1MgMHXObgb77f3bxRmUM7Lg8lxdQ9Vr+Lxzo=; b=0L+Tc4GKq/zm3ZHQqV5VitUD0Gbk3Nlt1x/ZUNT+w4c8ETjPZSgTKUAP86vpXDgw+ct3r/ DGuAIMFRx4v2V8v3FkG+9CeCvkNgB4DzOywayfm8Hn8988zj6jWf3Mmdop/2fsBfWgDy8L XK8zuGUbgvcl9Xr1UoQ9XnYU/SiDhiM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623069282; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=YrL1/rH1MgMHXObgb77f3bxRmUM7Lg8lxdQ9Vr+Lxzo=; b=3wrV7YfQZ7wfR3rsrjkR5spaK77EBF5pqWjTuirEb7YJ6ZHiVNCoSfL1zSp68yBMwwelkx ahJ5b+GvmZnT01Cg== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id C876B118DD for ; Mon, 7 Jun 2021 12:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623069282; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=YrL1/rH1MgMHXObgb77f3bxRmUM7Lg8lxdQ9Vr+Lxzo=; b=0L+Tc4GKq/zm3ZHQqV5VitUD0Gbk3Nlt1x/ZUNT+w4c8ETjPZSgTKUAP86vpXDgw+ct3r/ DGuAIMFRx4v2V8v3FkG+9CeCvkNgB4DzOywayfm8Hn8988zj6jWf3Mmdop/2fsBfWgDy8L XK8zuGUbgvcl9Xr1UoQ9XnYU/SiDhiM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623069282; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=YrL1/rH1MgMHXObgb77f3bxRmUM7Lg8lxdQ9Vr+Lxzo=; b=3wrV7YfQZ7wfR3rsrjkR5spaK77EBF5pqWjTuirEb7YJ6ZHiVNCoSfL1zSp68yBMwwelkx ahJ5b+GvmZnT01Cg== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id qr3PL2ISvmBVfwAALh3uQQ (envelope-from ) for ; Mon, 07 Jun 2021 12:34:42 +0000 Date: Mon, 7 Jun 2021 14:34:41 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Simplify gdb.base/info-types.exp.tcl Message-ID: <20210607123440.GA8513@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, The regexp matching state machine in gdb.base/info-types.exp.tcl handles "File .*:" lines individually. Now that we do line-by-line matching, that's no longer necessary. Simplify accordingly. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Simplify gdb.base/info-types.exp.tcl gdb/testsuite/ChangeLog: 2021-06-07 Tom de Vries * gdb.base/info-types.exp.tcl: Remove "File .*" matching from regexp matching state machine. --- gdb/testsuite/gdb.base/info-types.exp.tcl | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/gdb/testsuite/gdb.base/info-types.exp.tcl b/gdb/testsuite/gdb.base/info-types.exp.tcl index 0eac3dbe67c..104fdb3a62f 100644 --- a/gdb/testsuite/gdb.base/info-types.exp.tcl +++ b/gdb/testsuite/gdb.base/info-types.exp.tcl @@ -89,9 +89,12 @@ proc run_test { lang } { return 0 } + set file_re "File .*[string_to_regexp $srcfile]:" + if { $lang == "c++" } { set output_lines \ [list \ + $file_re \ "98:\[\t \]+CL;" \ "42:\[\t \]+anon_struct_t;" \ "65:\[\t \]+anon_union_t;" \ @@ -126,6 +129,7 @@ proc run_test { lang } { } else { set output_lines \ [list \ + $file_re \ "52:\[\t \]+typedef enum {\\.\\.\\.} anon_enum_t;" \ "45:\[\t \]+typedef struct {\\.\\.\\.} anon_struct_t;" \ "68:\[\t \]+typedef union {\\.\\.\\.} anon_union_t;" \ @@ -160,28 +164,20 @@ proc run_test { lang } { if { $state == 0 } { set state 1 } else { set state -1 } exp_continue } - -re "^\r\nFile .*[string_to_regexp $srcfile]:" { - if { $state == 1 } { set state 2 } else { set state -2 } - exp_continue - } - -re "^\r\nFile \[^\r\n\]*:" { - if { $state == 2 } { set state -4 } - exp_continue - } -re "^\r\n(\[^\r\n\]*)(?=\r\n)" { - if { $state == 2 } { + if { $state == 1 } { set line $expect_out(1,string) set res [match_line $line $output_lines idx] if { $res == 1 } { - set state 3 + set state 2 } elseif { $res == -1 } { - set state -3 + set state -2 } } exp_continue } -re -wrap "" { - if { $state == 3} { + if { $state == 2} { pass $gdb_test_name } else { fail "$gdb_test_name (state == $state)"