From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 From: Tom de Vries 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-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 07 Sep 2021 08:21:21 -0000 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--