From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id o8iiCkWwbmKdqQMAWB0awg (envelope-from ) for ; Sun, 01 May 2022 12:07:33 -0400 Received: by simark.ca (Postfix, from userid 112) id 1E73E1E058; Sun, 1 May 2022 12:07:33 -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=mtO81ic9; 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=-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.6 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 7381F1E00D for ; Sun, 1 May 2022 12:07:32 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9ABD43858D3C for ; Sun, 1 May 2022 16:07:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9ABD43858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651421251; bh=Ma1wh7WTEsH03cVEd3G8VFKHM64VuLKjSiJFUCzM47g=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=mtO81ic91pEkKAmcxMxIOpZ6nTC+VM+GyuYh/HGHCKkLBNMimp60DkxS/s+5lysPj X5Zo6SmtJcjG30Z/KyG3xHKoAUEpOZSgBURIPLv6dwpjt7ZW1lnsi02vlbB5w/1116 E/mgPVGgJFQOyqjIsJyRBF/3mFBELMbAlLP5TRW0= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 25AEC3858D33 for ; Sun, 1 May 2022 16:07:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 25AEC3858D33 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-out1.suse.de (Postfix) with ESMTPS id E12A4210DF for ; Sun, 1 May 2022 16:07:10 +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 C305313AE0 for ; Sun, 1 May 2022 16:07:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ERKLLi6wbmIedQAAMHmgww (envelope-from ) for ; Sun, 01 May 2022 16:07:10 +0000 Date: Sun, 1 May 2022 18:07:09 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.multi/attach-no-multi-process.exp with check-readmore Message-ID: <20220501160708.GA18741@delia.home> 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, When running test-case gdb.multi/attach-no-multi-process.exp with check-readmore, I get: ... (gdb) attach 13411^M Attaching to Remote target^M No unwaited-for children left.^M (gdb) Reading symbols from attach-no-multi-process...^M Reading symbols from /lib64/libm.so.6...^M (No debugging symbols found in /lib64/libm.so.6)^M Reading symbols from /lib64/libc.so.6...^M (No debugging symbols found in /lib64/libc.so.6)^M Reading symbols from /lib64/ld-linux-x86-64.so.2...^M (No debugging symbols found in /lib64/ld-linux-x86-64.so.2)^M 0x00007f5df1fffc8a in clock_nanosleep@GLIBC_2.2.5 () from /lib64/libc.so.6^M FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=off: \ attach to the program via remote (timeout) ... The problem is that the attach output is matched using gdb_test, which uses the '$gdb_prompt $' regexp, and this does not handle the case that '(gdb) ' is not the last available output. Fix this by using a gdb_test_multiple instead with a '$gdb_prompt ' regexp, so without the '$' anchor. Tested on x86_64-linux with native, check-read1 and check-readmore. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.multi/attach-no-multi-process.exp with check-readmore --- gdb/testsuite/gdb.multi/attach-no-multi-process.exp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp index 081579fb964..66b210f882c 100644 --- a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp +++ b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp @@ -32,6 +32,7 @@ if {[build_executable "build" $testfile $srcfile {debug}] == -1} { proc test {target_non_stop} { global binfile + global gdb_prompt save_vars { ::GDBFLAGS } { # If GDB and GDBserver are both running locally, set the sysroot to avoid @@ -64,9 +65,11 @@ proc test {target_non_stop} { set spawn_id_list [spawn_wait_for_attach [list $binfile]] set test_spawn_id [lindex $spawn_id_list 0] set testpid [spawn_id_get_pid $test_spawn_id] - gdb_test "attach $testpid" \ - "Attaching to Remote target.*" \ - "attach to the program via remote" + gdb_test_multiple "attach $testpid" "attach to the program via remote" { + -re "Attaching to Remote target.*\[\r\n\]+$gdb_prompt " { + pass $gdb_test_name + } + } # Check that we have two threads. Bad GDB duplicated the # thread coming from the remote when target-non-stop is off;