From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 537F0386F439 for ; Thu, 4 Jun 2020 10:24:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 537F0386F439 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B8DC4ABCF; Thu, 4 Jun 2020 10:24:29 +0000 (UTC) Date: Thu, 4 Jun 2020 12:24:24 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix PATH error in gdb_file_cmd Message-ID: <20200604102423.GA2054@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-Spam-Status: No, score=-16.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Thu, 04 Jun 2020 10:24:42 -0000 Hi, When building gdb using this patch: ... static void file_command (const char *arg, int from_tty) { + gdb_assert (0); /* FIXME, if we lose on reading the symbol file, we should revert the exec file, but that's rough. */ exec_file_command (arg, from_tty); ... and running the testsuite, we run into: ... Running src/gdb/testsuite/gdb.ada/O2_float_param.exp ... PASS: gdb.ada/O2_float_param.exp: compilation foo.adb FAIL: gdb.ada/O2_float_param.exp: (outputs/gdb.ada/O2_float_param/foo) \ (GDB internal error) PATH: gdb.ada/O2_float_param.exp: (outputs/gdb.ada/O2_float_param/foo) \ (GDB internal error) ... Fix this by using the basename in the FAIL message, such that we have: ... Running src/gdb/testsuite/gdb.ada/O2_float_param.exp ... PASS: gdb.ada/O2_float_param.exp: compilation foo.adb FAIL: gdb.ada/O2_float_param.exp: (foo) (GDB internal error) ... Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/testsuite] Fix PATH error in gdb_file_cmd gdb/testsuite/ChangeLog: 2020-06-04 Tom de Vries * lib/gdb.exp (gdb_file_cmd): Only use basename of loaded file in fail message. --- gdb/testsuite/lib/gdb.exp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 444cea01c3..71884b2b81 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1761,6 +1761,7 @@ proc gdb_file_cmd { arg } { } send_gdb "file $arg\n" + set basename [file tail $arg] gdb_expect 120 { -re "Reading symbols from.*LZMA support was disabled.*$gdb_prompt $" { verbose "\t\tLoaded $arg into $GDB; .gnu_debugdata found but no LZMA available" @@ -1800,7 +1801,7 @@ proc gdb_file_cmd { arg } { return -1 } -re "A problem internal to GDB has been detected" { - fail "($arg) (GDB internal error)" + fail "($basename) (GDB internal error)" gdb_internal_error_resync return -1 }