From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3559 invoked by alias); 17 Oct 2014 13:27:21 -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 3547 invoked by uid 89); 17 Oct 2014 13:27:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 17 Oct 2014 13:27:19 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9HDRHNW029309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Oct 2014 09:27:17 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9HDRFRm023518; Fri, 17 Oct 2014 09:27:16 -0400 Message-ID: <54411933.702@redhat.com> Date: Fri, 17 Oct 2014 13:27:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Skip argv0-symlink.exp on target argv[0] isn't available References: <1413440712-3645-1-git-send-email-yao@codesourcery.com> <54400505.6070908@redhat.com> <87lhofkvr8.fsf@codesourcery.com> <5440FA3F.4000805@redhat.com> <874mv2ltut.fsf@codesourcery.com> In-Reply-To: <874mv2ltut.fsf@codesourcery.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-10/txt/msg00475.txt.bz2 On 10/17/2014 02:16 PM, Yao Qi wrote: > Pedro Alves writes: > >> So how about instead of silently skipping the tests, call >> unsupported, like: >> >> global has_argv0 >> set test "verify dereferenced value" >> if { $has_argv0 } { >> gdb_test "python print (arg0)" "0x.*$testfile\"" $test >> } else { >> unsupported $test >> } >> > > OK, fixed in the updated patch. > >> etc. >> >>> +gdb_caching_proc gdb_has_argv0 { >>> + set result 0 >> ... >>> + # Helper proc. >>> + proc gdb_has_argv0_1 { exe } { >> ... >>> + set result [gdb_has_argv0_1 $exe] >> >> And then in addition, add an assert here for the main OSs >> we support, like so: >> >> if { !$result >> && ([istarget *-*-linux*] >> || [istarget *-*-gnu*] >> || [istarget *-*-cygwin*] >> || [istarget *-*-mingw*] >> || [istarget *-*-darwin*] >> || [istarget *-*-bsd*] >> || [istarget *-*-solaris*] >> || [istarget *-*-msdosdjgpp*] >> || [istarget *-*-go32*] >> || [istarget *-*-aix*] >> || [istarget *-*-hpux*]) } { >> fail "argv[0] should be available on this target" >> } >> > > OK, I list all OSes GDB supports (extracted from configure.tgt and configure.ac). > >>> + # Helper proc. >>> + proc gdb_has_argv0_1 { exe } { >>> + global srcdir subdir >>> + global gdb_prompt hex decimal >>> + >>> + gdb_exit >>> + gdb_start >>> + gdb_reinitialize_dir $srcdir/$subdir >>> + gdb_load "$exe" >> >> BTW, use clean_restart here? (if so, I think 'global srcdir subdir' >> becomes unnecessary too) > > Unfortunately we can't. clean_restart loads file from $objdir/$subdir, > but $exe is in $objdir or $objdir/temp. > OK. This version looks good to me. Thanks, Pedro Alves