From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29729 invoked by alias); 2 Apr 2014 08:46:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 29717 invoked by uid 89); 2 Apr 2014 08:46:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Apr 2014 08:46:25 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WVGoP-0003Sm-CV from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 02 Apr 2014 01:46:21 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 2 Apr 2014 01:46:21 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Wed, 2 Apr 2014 01:44:17 -0700 From: Yao Qi To: Subject: [PATCH] Return argv0-symlink.exp early if gdb can't load symlink Date: Wed, 02 Apr 2014 08:46:00 -0000 Message-ID: <1396428218-31822-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00022.txt.bz2 We run argv0-symlink.exp on mingw32 host, and see the following error in gdb.log (gdb) file argv0-symlink-filelink^M "argv0-symlink-filelink": not in executable format: File format not recognized (gdb) ERROR: Couldn't load argv0-symlink-filelink into arm-none-eabi-gdb. the rest of the test don't have to run. This patch expands clean_restart so that we can check the return value of gdb_load. Return if return value of gdb_load isn't zero. Note that originally I added a unsupported statement to mention that symlink is not supported, but perror in gdb_file_cmd changes it to unresolved, so I remove that unsupported statement. gdb/testsuite: 2014-04-02 Yao Qi * gdb.base/argv0-symlink.exp: Return early if GDB can't load symlink successfully. --- gdb/testsuite/gdb.base/argv0-symlink.exp | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp index 0e0202d..5e16b00 100644 --- a/gdb/testsuite/gdb.base/argv0-symlink.exp +++ b/gdb/testsuite/gdb.base/argv0-symlink.exp @@ -29,7 +29,14 @@ if {[lindex $status 0] != 0} { return 0 } -clean_restart "$filelink" +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir + +if { [gdb_load [standard_output_file ${filelink}]] != 0 } { + # GDB can't load symlink successfully, skip it. + return 0 +} if ![runto_main] { untested "could not run to main" -- 1.7.7.6