From patchwork Wed Mar 12 11:50:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 46 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (caibbdcaabja.dreamhost.com [208.113.200.190]) by wilcox.dreamhost.com (Postfix) with ESMTP id EBEC1360060 for ; Wed, 12 Mar 2014 04:50:40 -0700 (PDT) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14314964) id 9EA0862C2D963; Wed, 12 Mar 2014 04:50:40 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx23.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-mx23.g.dreamhost.com (Postfix) with ESMTPS id 8171762BF3C58 for ; Wed, 12 Mar 2014 04:50:40 -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:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=GcMfh USir7Ajr1Bo7AjJHHhhDRvX8ruyM+J+GgakAxUkrvi7Wyn61jN1R0wEKpqRMGqWl 4PTw0tgvY7qehVEzLNqFmvMmdmsB/xNOS1Nxnhy6MxMa5rz4WWajSVMTK5ijk7A6 5tCBpM83FFOrzL6F083Qc5yXRWfh2hS/qOCDzk= 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:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=fUHHVXgXebB P5Q7fv1xFUEscLiU=; b=N7YiYuYT3uR3AOYxy6xYck5jVR1vRpDHM6BEnBIx/vQ UFfOEsXpwolbCytEspEwRBCch0iKVAc6xmGNCSxxwd8xsihLke6zXFVvrG6xXnRC RhSpGBFzVtXN4LYD/yyDljURMR0YqN4+XZ4QEUEu+NGaNQlHYooNF0skAzmusGrc = Received: (qmail 24401 invoked by alias); 12 Mar 2014 11:50:38 -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 24333 invoked by uid 89); 12 Mar 2014 11:50:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp11.uk.ibm.com Received: from e06smtp11.uk.ibm.com (HELO e06smtp11.uk.ibm.com) (195.75.94.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 12 Mar 2014 11:50:36 +0000 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Mar 2014 11:50:33 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 12 Mar 2014 11:50:30 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 75EB62190041 for ; Wed, 12 Mar 2014 11:50:25 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s2CBoHG92883858 for ; Wed, 12 Mar 2014 11:50:17 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s2CBoSur006256 for ; Wed, 12 Mar 2014 05:50:29 -0600 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-219.boeblingen.de.ibm.com [9.152.212.219]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s2CBoRLh006230; Wed, 12 Mar 2014 05:50:27 -0600 From: Andreas Arnez To: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, krebbel@linux.vnet.ibm.com (Andreas Krebbel) Subject: Re: [PATCH 1/4] gdb.exp: Support absolute path name args in 'prepare_for_testing' etc. References: <201403111448.s2BEmrwg030791@d03av02.boulder.ibm.com> Date: Wed, 12 Mar 2014 12:50:27 +0100 In-Reply-To: <201403111448.s2BEmrwg030791@d03av02.boulder.ibm.com> (Ulrich Weigand's message of "Tue, 11 Mar 2014 15:48:53 +0100 (CET)") Message-ID: <87ha73ocu4.fsf@br87z6lw.de.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14031211-5024-0000-0000-0000091FC624 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in On Tue, Mar 11 2014, Ulrich Weigand wrote: > Andreas Arnez wrote: > >> Test cases that produce source files in the build directory have not >> been able to use prepare_for_testing and friends. This was because >> build_executable_from_specs unconditionally prepended the source >> directory path name to its arguments. >> >> gdb/testsuite/ >> * lib/gdb.exp (build_executable_from_specs): Don't prepend source >> directory to absolute path name arguments. > > I think that makes sense, and there is precedent to this approach in > gdb_get_line_number and mi_prepare_inline_tests. > > However, for consistency, I think you should also support absolute > path names in the gdb_compile_shlib[_pthreads] path just next to > the location you're modifying. OK, good point. Done. BTW, is any test case using the shlib[_pthreads] option with build_executable_from_specs at all? > Otherwise this looks good to me. Thanks. With the updated patch below, is the patch set then OK to apply? --- Test cases that produce source files in the build directory have not been able to use prepare_for_testing and friends. This was because build_executable_from_specs unconditionally prepended the source directory path name to its arguments. gdb/testsuite/ * lib/gdb.exp (build_executable_from_specs): Don't prepend source directory to absolute path name arguments. --- gdb/testsuite/lib/gdb.exp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 2d04a8c..4a6f930 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4260,14 +4260,21 @@ proc build_executable_from_specs {testname executable options args} { if [string match gdb_compile_shlib* $func] { set sources_path {} foreach {s local_options} $args { - lappend sources_path "${srcdir}/${subdir}/${s}" + if { [regexp "^/" "$s"] } then { + lappend sources_path "$s" + } else { + lappend sources_path "$srcdir/$subdir/$s" + } } set ret [$func $sources_path "${binfile}" $options] } else { set objects {} set i 0 foreach {s local_options} $args { - if { [gdb_compile "${srcdir}/${subdir}/${s}" "${binfile}${i}.o" object $local_options] != "" } { + if { ! [regexp "^/" "$s"] } then { + set s "$srcdir/$subdir/$s" + } + if { [gdb_compile "${s}" "${binfile}${i}.o" object $local_options] != "" } { untested $testname return -1 }