From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wnMXBVxmNGGWVQAAWB0awg (envelope-from ) for ; Sun, 05 Sep 2021 02:40:28 -0400 Received: by simark.ca (Postfix, from userid 112) id B011F1EE23; Sun, 5 Sep 2021 02:40:27 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=unavailable 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 0048A1EDDB for ; Sun, 5 Sep 2021 02:40:12 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB0263877421 for ; Sun, 5 Sep 2021 06:40:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB0263877421 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1630824011; bh=7fGYQdlgHNGY+RIhbYrMGbvNUgVQEpTbQ/apOIvuvbE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=R1j/esdgSbaCUV1Me+3WjBquXHg9K3229DeqEByP2H0rtsboH1gY2vUCYNw22HaBQ AuvAxKkbpM49Mrxb65r3ALbJv06ZKnl+7a6wNB1FZiWGplIaA8/ZeKP6L97gjWDO9w v1XqeKYwbgdtzhAlXgNSwDmoAeUjV3UgZtTDBwp4= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 5C1D33858D34 for ; Sun, 5 Sep 2021 06:39:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5C1D33858D34 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-out1.suse.de (Postfix) with ESMTPS id 86C8E2232D; Sun, 5 Sep 2021 06:39:52 +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 65F741332A; Sun, 5 Sep 2021 06:39:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id rXtdFzhmNGFeKQAAGKfGzw (envelope-from ); Sun, 05 Sep 2021 06:39:52 +0000 Date: Sun, 5 Sep 2021 08:39:50 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Simplify gdb.dwarf2/locexpr-data-member-location.exp Message-ID: <20210905063948.GA22464@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, The test-case gdb.dwarf2/locexpr-data-member-location.exp currently fails like this: ... FAIL: gdb.dwarf2/locexpr-data-member-location.exp: running to bar in runto \ (GDB internal error) ERROR: : spawn id exp9 not open while executing "expect { -i exp9 -timeout 10 -re "Quit this debugging session\\? \\(y or n\\) $" { send_gdb "n\n" answer incr count } -re "Create ..." ("uplevel" body line 1) invoked from within "uplevel $body" NONE : spawn id exp9 not open ERROR: Could not resync from internal error (timeout) ... and takes 1 minute to run. The long running time is caused by the timeout of 60 in gdb_run_cmd. Avoid this by simplify the test-case to trigger the same assert using the file command instead. Then fix the: ... ERROR: : spawn id exp9 not open ... by handling eof in gdb_internal_error_resync. Finally, mark the FAIL as KFAIL, such that we end up with: ... KFAIL: gdb.dwarf2/locexpr-data-member-location.exp: Discard file \ (GDB internal error) (PRMS: gdb/28030) ERROR: Could not resync from internal error (eof) ... and a running time of 2 seconds. Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/testsuite] Simplify gdb.dwarf2/locexpr-data-member-location.exp --- .../gdb.dwarf2/locexpr-data-member-location.exp | 23 ++++++++++++++++------ gdb/testsuite/lib/gdb.exp | 4 ++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp index 1f70e6a34bd..9423132e775 100644 --- a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp +++ b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp @@ -40,7 +40,7 @@ # purging of shared objects. # # 3) After performing some simple gdb commands, the program is -# run again. In the course of running the objfile destructor +# discarded. In the course of running the objfile destructor # associated with the shared object, values are preserved # along with their types. As noted earlier, it was during # the recursive type copy that the bug was observed. @@ -342,8 +342,19 @@ gdb_test "step" "bar \\(.*" "step into bar" # We don't want a clean restart here since that will be too clean. # The original reproducer for PR28030 set a breakpoint in the shared -# library and then restarted via "run". The command below does roughly -# the same thing. It's at this step that an internal error would -# occur for PR28030. The "message" argument tells runto to turn on -# the printing of PASSes while runto is doing its job. -runto "bar" message +# library and then restarted via "run". The command below is more minimal: +# it discards executable file and symbol table. It's at the latter step +# that an internal error would occur for PR28030. + +# 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" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 00336bd588e..cdda51529fb 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -770,6 +770,10 @@ proc gdb_internal_error_resync {} { perror "Could not resync from internal error (timeout)" return 0 } + eof { + perror "Could not resync from internal error (eof)" + return 0 + } } } perror "Could not resync from internal error (resync count exceeded)"