From patchwork Wed Feb 11 06:17:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 5033 Received: (qmail 20120 invoked by alias); 11 Feb 2015 06:18:25 -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 20103 invoked by uid 89); 11 Feb 2015 06:18:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, KAM_FROM_URIBL_PCCC, RCVD_IN_DNSWL_LOW, SPF_PASS, UNWANTED_LANGUAGE_BODY autolearn=no version=3.3.2 X-HELO: mail-pd0-f173.google.com Received: from mail-pd0-f173.google.com (HELO mail-pd0-f173.google.com) (209.85.192.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 11 Feb 2015 06:18:24 +0000 Received: by pdev10 with SMTP id v10so2287065pde.10 for ; Tue, 10 Feb 2015 22:18:22 -0800 (PST) X-Received: by 10.68.135.136 with SMTP id ps8mr44100595pbb.130.1423635502437; Tue, 10 Feb 2015 22:18:22 -0800 (PST) Received: from seba.sebabeach.org.gmail.com (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id ca2sm21096663pbc.68.2015.02.10.22.18.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Feb 2015 22:18:21 -0800 (PST) From: Doug Evans To: gdb-patches@sourceware.org, pierre.muller@ics-cnrs.unistra.fr Subject: [PATCH] fix lib/pascal.exp dest snafu Date: Tue, 10 Feb 2015 22:17:36 -0800 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes The "dest" parameter to fpc_compile/gpc_compile is the name of compilation destination file, not a board name. This patch fixes this by using names consistent with lib/future.exp:gdb_default_target_compile. 2015-02-10 Doug Evans * lib/pascal.exp (gpc_compile): Rename dest arg to destfile. Fix dest parameter to board_info. (fpc_compile): Ditto. (gdb_compile_pascal): Rename dest arg to destfile. diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp index 994e3da..89b552d 100644 --- a/gdb/testsuite/lib/pascal.exp +++ b/gdb/testsuite/lib/pascal.exp @@ -68,9 +68,11 @@ proc pascal_init {} { set pascal_init_done 1 } -proc gpc_compile {source dest type options} { +proc gpc_compile {source destfile type options} { global gpc_compiler set add_flags "" + set dest [target_info name] + if {$type == "object"} { append add_flags " -c" } @@ -93,13 +95,15 @@ proc gpc_compile {source dest type options} { } } - set result [remote_exec host $gpc_compiler "-o $dest --automake $add_flags $source"] + set result [remote_exec host $gpc_compiler "-o $destfile --automake $add_flags $source"] return $result } -proc fpc_compile {source dest type options} { +proc fpc_compile {source destfile type options} { global fpc_compiler set add_flags "" + set dest [target_info name] + if {$type == "object"} { append add_flags " -Cn" } @@ -122,11 +127,11 @@ proc fpc_compile {source dest type options} { } } - set result [remote_exec host $fpc_compiler "-o$dest $add_flags $source"] + set result [remote_exec host $fpc_compiler "-o$destfile $add_flags $source"] return $result } -proc gdb_compile_pascal {source dest type options} { +proc gdb_compile_pascal {source destfile type options} { global pascal_init_done global pascal_compiler_is_gpc global pascal_compiler_is_fpc @@ -136,15 +141,15 @@ proc gdb_compile_pascal {source dest type options} { } if { $pascal_compiler_is_fpc == 1 } { - set result [fpc_compile $source $dest $type $options] + set result [fpc_compile $source $destfile $type $options] } elseif { $pascal_compiler_is_gpc == 1 } { - set result [gpc_compile $source $dest $type $options] + set result [gpc_compile $source $destfile $type $options] } else { unsupported "No pascal compiler found" return "No pascal compiler. Compilation failed." } - if ![file exists $dest] { + if ![file exists $destfile] { unsupported "Pascal compilation failed: $result" return "Pascal compilation failed." }