From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YtiVNBUhN2FwKwAAWB0awg (envelope-from ) for ; Tue, 07 Sep 2021 04:21:41 -0400 Received: by simark.ca (Postfix, from userid 112) id 873951EE22; Tue, 7 Sep 2021 04:21:41 -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 CB0621ECEB for ; Tue, 7 Sep 2021 04:21:39 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9A7BE385383C for ; Tue, 7 Sep 2021 08:21:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A7BE385383C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631002898; bh=rCBSKhy2y8jXdah5OJMc64+7z6TFwhMs4xTVEHO5yE0=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Oqq6+fkGn0l91ayNkCXOUBZVYkIxciSRgBzWiG52KhLmgJW9Gn+EEgQe934Wq9efu W1fDjT0CUkqehUKdpUmdfXHA9zLFchelf1h5BKclt52BvrO305T6FewP24LQjtqYVf N+qhtCWlkpxGH90/j5HP7yJM1VY4nYcM3sF3Cq6Y= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id BB1323858415 for ; Tue, 7 Sep 2021 08:21:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB1323858415 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 EA8101FD6B; Tue, 7 Sep 2021 08:21:17 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 imap1.suse-dmz.suse.de (Postfix) with ESMTPS id D0BB5132AB; Tue, 7 Sep 2021 08:21:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id M1HQMf0gN2GAHwAAGKfGzw (envelope-from ); Tue, 07 Sep 2021 08:21:17 +0000 Subject: [committed][gdb/testsuite] Handle internal-error in gdb_unload To: gdb-patches@sourceware.org References: <20210905063948.GA22464@delia> Message-ID: Date: Tue, 7 Sep 2021 10:21:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210905063948.GA22464@delia> Content-Type: multipart/mixed; boundary="------------54D5F9AA7F9B60512038FE6D" Content-Language: en-US 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" This is a multi-part message in MIME format. --------------54D5F9AA7F9B60512038FE6D Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit [ was: Re: [PATCH][gdb/testsuite] Simplify gdb.dwarf2/locexpr-data-member-location.exp ] On 9/5/21 8:39 AM, Tom de Vries wrote: > +# Avoid questions from the file command about: > +# - Are you sure you want to change the file (y or n) ? > +# - Discard symbol table from (y or n) ? > +gdb_test_no_output "set confirm off" > + > +# Tell internal-error how to behave, otherwise "set confirm off" will trigger > +# generation of core file. > +gdb_test_no_output "maint set internal-error quit no" > +gdb_test_no_output "maint set internal-error corefile no" > + > +setup_kfail gdb/28030 *-*-* > +gdb_test "file" "No executable file now\\." "Discard file" I realized that we have gdb_unload for this, which handles the file command questions. But it's missing the internal-error handling. I've fixed this in a separate patch. Thanks, - Tom --------------54D5F9AA7F9B60512038FE6D Content-Type: text/x-patch; charset=UTF-8; name="0001-gdb-testsuite-Handle-internal-error-in-gdb_unload.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-gdb-testsuite-Handle-internal-error-in-gdb_unload.patch" [gdb/testsuite] Handle internal-error in gdb_unload When reverting commit 5a20fadc841 and using gdb_unload instead of runto "bar" to trigger the internal-error in test-case gdb.dwarf2/locexpr-data-member-location.exp, we run into: ... ERROR: couldn't unload file in $gdb (timeout). ... and the test-case takes about 1 minute. Fix this by handling internal-error in gdb_unload, such that we have: ... ERROR: Couldn't unload file in $gdb (GDB internal error). ERROR: Could not resync from internal error (eof) ... within 2 seconds. Tested on x86_64-linux. --- gdb/testsuite/lib/gdb.exp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index d99e8360808..ff19760bac4 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -235,6 +235,11 @@ proc gdb_unload {} { exp_continue } -re "$gdb_prompt $" {} + -re "A problem internal to GDB has been detected" { + perror "Couldn't unload file in $GDB (GDB internal error)." + gdb_internal_error_resync + return -1 + } timeout { perror "couldn't unload file in $GDB (timeout)." return -1 --------------54D5F9AA7F9B60512038FE6D--