From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OZWBNLLwd2JdHAUAWB0awg (envelope-from ) for ; Sun, 08 May 2022 12:32:50 -0400 Received: by simark.ca (Postfix, from userid 112) id CAB5D1E21F; Sun, 8 May 2022 12:32:50 -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=ZGs8TwnC; 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 29B931E01D for ; Sun, 8 May 2022 12:32:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E0E323857415 for ; Sun, 8 May 2022 16:32:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0E323857415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652027569; bh=AtO0hNyratDnooqLU04xlqM2/0R63+uLLrqOyvUG2l4=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ZGs8TwnCKjP/KdkEqYlriWo9O6xhAM+zz17A8qZr/YkEjA3NT3ZP1RDFdCA2j7gUp wyeCaqXz1BUv1xwVLnesRcNAIr2TdydANnmBJjh7xppBtoR8fntAAubLS09qY/qH4r jZFA5h1oJnUzEJWU+kdRRkuEu4gdZQjEbBUbZoJ4= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 8DDE1385842B for ; Sun, 8 May 2022 16:32:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8DDE1385842B 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 835E821BC5 for ; Sun, 8 May 2022 16:32:29 +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 7082E13B12 for ; Sun, 8 May 2022 16:32:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HHdnGp3wd2KiEAAAMHmgww (envelope-from ) for ; Sun, 08 May 2022 16:32:29 +0000 Date: Sun, 8 May 2022 18:32:28 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Handle init errors in gdb.mi/user-selected-context-sync.exp Message-ID: <20220508163226.GA13071@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, In OBS, on aarch64-linux, with a gdb 11.1 based package, I run into: ... (gdb) builtin_spawn -pty^M new-ui mi /dev/pts/5^M New UI allocated^M (gdb) =thread-group-added,id="i1"^M (gdb) ERROR: MI channel failed warning: Error detected on fd 11^M thread 1.1^M Unknown thread 1.1.^M (gdb) UNRESOLVED: gdb.mi/user-selected-context-sync.exp: mode=non-stop: \ test_cli_inferior: reset selection to thread 1.1 ... with many more UNRESOLVED following. The ERROR is a common problem, filed as https://sourceware.org/bugzilla/show_bug.cgi?id=28561 . But the many UNRESOLVEDs are due to not checking whether the setup as done in the test_setup function succeeds or not. Fix this by: - making test_setup return an error upon failure - handling test_setup error at the call site - adding a "setup done" pass/fail to be turned into an unresolved in case of error during setup. Tested on x86_64-linux, by manually triggering the error in mi_gdb_start_separate_mi_tty. Committed to trunk. Thanks, - Tom [gdb/testsuite] Handle init errors in gdb.mi/user-selected-context-sync.exp --- gdb/testsuite/gdb.mi/user-selected-context-sync.exp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp index 9444ca5acf4..d78c96ddef1 100644 --- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp +++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp @@ -393,7 +393,7 @@ proc_with_prefix test_setup { mode } { } if { [mi_gdb_start "separate-mi-tty"] != 0 } { - return + return -1 } } @@ -402,7 +402,7 @@ proc_with_prefix test_setup { mode } { mi_gdb_load $binfile if { [mi_runto_main] < 0 } { - return + return -1 } # When using mi_expect_stop, we don't expect a prompt after the *stopped @@ -443,6 +443,8 @@ proc_with_prefix test_setup { mode } { # Prepare the second inferior for the test. test_continue_to_start $mode 2 } + + return 0 } # Reset the selection to frame #0 of thread THREAD. @@ -1300,7 +1302,12 @@ proc_with_prefix test_cli_in_mi_frame { mode cli_in_mi_mode } { } foreach_with_prefix mode { "all-stop" "non-stop" } { - test_setup $mode + set test "setup done" + if { [test_setup $mode] == -1 } { + fail $test + continue + } + pass $test # Test selecting inferior, thread and frame from CLI