From patchwork Wed Apr 2 08:43:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 385 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (peon2454.g.dreamhost.com [208.113.200.127]) by wilcox.dreamhost.com (Postfix) with ESMTP id DBB8D3600B6 for ; Wed, 2 Apr 2014 01:46:29 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14314964) id 78C94D8D729; Wed, 2 Apr 2014 01:46:29 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx21.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx21.g.dreamhost.com (Postfix) with ESMTPS id 51B6BD8D723 for ; Wed, 2 Apr 2014 01:46:29 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=JOt12oJNUUowNR554BLPfiD6VIre+ +koACxEFohJLT5a+glnkxbBZmnDE2hbjhzG66uoTPVn6IqyPiJa2zIWJzozZu5rq 540fXRlwcyxmjAGM9OokY0lZraRg8XwzhVeWWnd9NruYr/OdW3+6k4a8PnF7evaW q4Wjv8Zu+KKAFQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=vzpiclWqlNjGfMeyF5XXxUROvjY=; b=gkD Tx122lwNqDdKsRuN/9X8QLkYdOSulUIe6vdUpprrq+hComhHMOvP4IuxXa7Ud441 aO3Y8ZHqpQ45QycNjb1uDIuSr182am9osGVjd2iV2w1puhFhl7SYnA9DHyon+Dz0 FGlHgI8YpVav3rtYtJlqkEJsB6zYFYjEMFdbXwJw= 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-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@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, 2 Apr 2014 16:43:38 +0800 Message-ID: <1396428218-31822-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in 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"