From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id fkYPFo1ITGKndwAAWB0awg (envelope-from ) for ; Tue, 05 Apr 2022 09:47:57 -0400 Received: by simark.ca (Postfix, from userid 112) id 4727A1F344; Tue, 5 Apr 2022 09:47:57 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 A86C21E787 for ; Tue, 5 Apr 2022 09:47:56 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4B4C5385AC22 for ; Tue, 5 Apr 2022 13:47:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B4C5385AC22 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649166476; bh=9f34fSpCjpVeVwpxSS6NVk2Px2A2a/gFrHNfO53s2u4=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=CpNMuY26yAR8HVMygbCHGaEr+wYnEV1ZT3RqXaurH+e7DsPvbLhQp7DBLhFGFxaJo f1hXXvElgqvEu6em8JkbNAzSPCLGhTYM/LWo6xKkQSPR02iU8WL5NFNCSHDVdvtDcJ LC4A5nee2T1NBSaQMgqNZwphamjdBotJKT+oiRVk= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 0A9313858405 for ; Tue, 5 Apr 2022 13:47:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0A9313858405 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3E4DA1F37D for ; Tue, 5 Apr 2022 13:47:35 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 28AE813522 for ; Tue, 5 Apr 2022 13:47:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id pPfNCHdITGKCOgAAMHmgww (envelope-from ) for ; Tue, 05 Apr 2022 13:47:35 +0000 Date: Tue, 5 Apr 2022 15:47:33 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Make gdb.base/annota1.exp more robust Message-ID: <20220405134732.GA32701@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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, On openSUSE Tumbleweed I run into: ... FAIL: gdb.base/annota1.exp: run until main breakpoint (timeout) ... The problem is that the libthread_db message occurs at a location where it's not expected: ... Starting program: outputs/gdb.base/annota1/annota1 ^M ^M ^Z^Zstarting^M ^M ^Z^Zframes-invalid^M [Thread debugging using libthread_db enabled]^M Using host libthread_db library "/lib64/libthread_db.so.1".^M ^M ^Z^Zbreakpoints-invalid^M ^M ... Fix this by making the matching more robust: - rewrite the regexp such that each annotation is on a single line, starting with \r\n\032\032 and ending with \r\n - add a regexp variable optional_re, that matches all possible optional output, and use it as a separator in the first part of the regexp Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/testsuite] Make gdb.base/annota1.exp more robust --- gdb/testsuite/gdb.base/annota1.exp | 71 +++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 24 deletions(-) diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp index c9544eec0ec..40a13e7cf19 100644 --- a/gdb/testsuite/gdb.base/annota1.exp +++ b/gdb/testsuite/gdb.base/annota1.exp @@ -128,41 +128,64 @@ gdb_test_multiple "info break" "breakpoint info" { set binexp [string_to_regexp $binfile] set warning_slow_re \ - "warning: File transfers from remote targets can be slow\[^\r\n\]+" + "warning: File transfers from remote targets can be slow\[^\r\n\]+\r\n" set warning_gdb_index_re \ [multi_line \ "warning: Skipping \[^\r\n\]+ .gdb_index section in \[^\r\n\]+" \ "Do \"set use-deprecated-index-sections on\" before the file is read" \ - "to use the section anyway\\."] + "to use the section anyway\\.\r\n"] set reading_re \ - "Reading \[^\r\n\]+" + "Reading \[^\r\n\]+\r\n" set libthread_db_re \ [multi_line \ "\\\[Thread debugging using libthread_db enabled\\\]" \ - "Using host libthread_db library \[^\r\n\]+"] + "Using host libthread_db library \[^\r\n\]+\r\n"] -set run_re \ +set optional_re \ [list \ - "\r\n\032\032post-prompt\r\nStarting program: $binexp " \ - "\(\(\r\n$reading_re\)|\(\r\n$warning_slow_re\)\)*" \ + "\(" \ + "\($reading_re)" \ + "|" \ + "\($warning_slow_re\)" \ + "|" \ + "\($libthread_db_re\)" \ + "|" \ "\(\r\n$warning_gdb_index_re\)?" \ - "\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \ - "\032\032starting\(\(\r\n$reading_re\)|\(\r\n$warning_slow_re\)|\r\n$libthread_db_re\)*" \ - "\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \ - "\032\032breakpoint 1\r\n\r\n" \ - "Breakpoint 1, \r\n" \ - "\032\032frame-begin 0 $hex\r\n\r\n" \ - "\032\032frame-function-name\r\n" \ - "main\r\n" \ - "\032\032frame-args\r\n \\(\\)\r\n" \ - "\032\032frame-source-begin\r\n at \r\n" \ - "\032\032frame-source-file\r\n.*annota1.c\r\n" \ - "\032\032frame-source-file-end\r\n:\r\n" \ - "\032\032frame-source-line\r\n$main_line\r\n" \ - "\032\032frame-source-end\r\n\r\n\r\n" \ - "\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n" \ - "\032\032frame-end\r\n\r\n" \ - "\032\032stopped"] + "\)*"] +set optional_re [join $optional_re ""] + +set run_re \ + [list \ + "\r\n\032\032post-prompt\r\n" \ + "Starting program: $binexp \r\n" \ + $optional_re \ + "\r\n\032\032starting\r\n" \ + $optional_re \ + "\r\n\032\032frames-invalid\r\n" \ + $optional_re \ + "\r\n\032\032breakpoints-invalid\r\n" \ + $optional_re \ + "\r\n\032\032breakpoint 1\r\n" \ + "\r\n" \ + "Breakpoint 1, " \ + "\r\n\032\032frame-begin 0 $hex\r\n" \ + "\r\n\032\032frame-function-name\r\n" \ + "main" \ + "\r\n\032\032frame-args\r\n" \ + " \\(\\)" \ + "\r\n\032\032frame-source-begin\r\n" \ + " at " \ + "\r\n\032\032frame-source-file\r\n" \ + ".*annota1.c" \ + "\r\n\032\032frame-source-file-end\r\n" \ + ":" \ + "\r\n\032\032frame-source-line\r\n" \ + "$main_line" \ + "\r\n\032\032frame-source-end\r\n" \ + "\r\n" \ + "\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n" \ + "\r\n\032\032frame-end\r\n" \ + "\r\n\032\032stopped\r\n"] set run_re [join $run_re ""]