From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id D9RLLyWkNmHSHgAAWB0awg (envelope-from ) for ; Mon, 06 Sep 2021 19:28:37 -0400 Received: by simark.ca (Postfix, from userid 112) id AD52D1EE22; Mon, 6 Sep 2021 19:28:37 -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=ham 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 EEC1C1EDF5 for ; Mon, 6 Sep 2021 19:28:36 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6FCAF385C41F for ; Mon, 6 Sep 2021 23:28:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FCAF385C41F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1630970916; bh=8gJVulxSNpewuWHOX8Kdr+Hn8ObhZ46HWw1NFY+vhRc=; 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=Cu3HO/gQhgQsyAdBuUrfeh8is2cAZR6wCYNhXbYydyieWD4RS+WN2QEl3MpUv9Pyw EOPedHW0BE2Ysa+IjjkLf3YeGIE9Mw227fDFQdvE8PGYVKIHm7/V8p5zmf0cOzYe9R 2l5A/lsGMor3wY8rl5H+rHKzEmNMlbuXJDkvmUhs= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id C82FC3858413 for ; Mon, 6 Sep 2021 23:28:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C82FC3858413 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 DE0F6221CD; Mon, 6 Sep 2021 23:28:16 +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 C067613313; Mon, 6 Sep 2021 23:28:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id cf8/LRCkNmHdPgAAGKfGzw (envelope-from ); Mon, 06 Sep 2021 23:28:16 +0000 Subject: [committed][gdb/testsuite] Handle internal-error in gdb_run_cmd To: gdb-patches@sourceware.org References: <20210905063948.GA22464@delia> Message-ID: <1e8a9ce0-649e-3fd4-fe13-29596583fc9a@suse.de> Date: Tue, 7 Sep 2021 01:28:16 +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="------------7D3127DBD9398422908E02E2" 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. --------------7D3127DBD9398422908E02E2 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: > The test-case gdb.dwarf2/locexpr-data-member-location.exp currently fails like > this: > ... > ... > and takes 1 minute to run. I've fixed this in a separate patch. Thanks, - Tom --------------7D3127DBD9398422908E02E2 Content-Type: text/x-patch; charset=UTF-8; name="0001-gdb-testsuite-Handle-internal-error-in-gdb_run_cmd.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-gdb-testsuite-Handle-internal-error-in-gdb_run_cmd.patc"; filename*1="h" [gdb/testsuite] Handle internal-error in gdb_run_cmd When reverting commit 5a20fadc841 the test-case gdb.dwarf2/locexpr-data-member-location.exp fails like this: ... FAIL: gdb.dwarf2/locexpr-data-member-location.exp: running to bar in runto \ (GDB internal error) ERROR: Could not resync from internal error (eof) ... and takes 1 minute to run. The long running time is caused by running into a timeout in gdb_run_cmd, at this point: ... (gdb) run ^M The program being debugged has been started already.^M Start it from the beginning? (y or n) y^M /home/vries/gdb_versions/devel/src/gdb/gdbtypes.c:5583: internal-error: \ Unexpected type field location kind: 4^M A problem internal to GDB has been detected,^M further debugging may prove unreliable.^M Quit this debugging session? (y or n) ... Fix this by detecting the internal-error in gdb_run_cmd. We don't handle it in gdb_run_cmd, but stash the gdb output back into the buffer using -notransfer, and let the caller proc runto deal with it. After the fix, the test-case just takes 2 seconds. Tested on x86_64-linux. --- gdb/testsuite/lib/gdb.exp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index cdda51529fb..d99e8360808 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -408,6 +408,9 @@ proc gdb_run_cmd { {inferior_args {}} } { -notransfer -re "$gdb_prompt $" { # There is no more input expected. } + -notransfer -re "A problem internal to GDB has been detected" { + # Let caller handle this. + } } return 0 --------------7D3127DBD9398422908E02E2--