From patchwork Mon Feb 1 12:46:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 10682 Received: (qmail 42420 invoked by alias); 1 Feb 2016 12:47:02 -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 42380 invoked by uid 89); 1 Feb 2016 12:47:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 spammy=Hx-languages-length:2329, 416, Root, gm X-HELO: mail-wm0-f53.google.com Received: from mail-wm0-f53.google.com (HELO mail-wm0-f53.google.com) (74.125.82.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 01 Feb 2016 12:47:00 +0000 Received: by mail-wm0-f53.google.com with SMTP id l66so69413461wml.0 for ; Mon, 01 Feb 2016 04:46:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to:content-type; bh=NwVbFo5vldu/b3QBhPAbTQH12l7dCm/zFtC8srBXhSM=; b=VvTohFR4lEbnXVQvfyrByMQMC+LpypxZB3amik7j6BCSgExHYXZeS1HkHyjRA26GQO Gc615t2mno1cSR6uGEr4jnaTIyc9kHN1jBoYUsOX6TR3BZNMPCHzlAL3uv+RXDGpZIjE 6jOQgqLHxtbhi8GH8yqEzbr8XmtYL9XvRZZyQvVHZBIK2/I9kGegyaAL/VRzmd2T56lg skHcMtj8du0h0k4ioByQBZZcwrJm/0erWTRSxZ18FtTdE8aynFk8Cf/m6cWeNzW4NmlU dpmvozRZIq7j1Fqn0Z3N+5EKf3rBqM1o7ADfUIBq3Ddv/Ky8zK//RrOuo4xxC2BpSzK+ zhzA== X-Gm-Message-State: AG10YORIh66Vl5XkMnj+a8IUiP4a05xTJksLjNRtIjNFJtrc53RO15niPEYZRw4Om+Rn8GzOFhqerjMO2CKUpA== MIME-Version: 1.0 X-Received: by 10.194.241.228 with SMTP id wl4mr22384492wjc.11.1454330817117; Mon, 01 Feb 2016 04:46:57 -0800 (PST) Received: by 10.28.211.1 with HTTP; Mon, 1 Feb 2016 04:46:56 -0800 (PST) Date: Mon, 1 Feb 2016 13:46:56 +0100 Message-ID: Subject: [PATCH] gdb/testsuite: Add D support to gdb_default_target_compile From: Iain Buclaw To: GDB Patches X-IsSubscribed: yes Hi, As discussed a couple months back. Adding support for D in gdb_default_target_compile, which should allow D sources to be used in the testsuite. Iain. gdb/testsuite/ChangeLog: * lib/future.exp: Add D support. (gdb_find_gdc): New proc. (gdb_default_target_compile): Add D support. --- diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp index 538fa5a..da0dd15 100644 --- a/gdb/testsuite/lib/future.exp +++ b/gdb/testsuite/lib/future.exp @@ -41,6 +41,27 @@ proc gdb_find_gnatmake {} { return $GM } +proc gdb_find_gdc {} { + global tool_root_dir + print "Tool Root: $tool_root_dir" + + if {![is_remote host]} { + set file [lookfor_file $tool_root_dir gdc] + if { $file == "" } { + set file [lookfor_file $tool_root_dir gcc/gdc] + } + if { $file != "" } { + set CC "$file -B[file dirname $file]/" + } else { + set CC [transform gdc] + } + } else { + set CC [transform gdc] + } + print "CC: $CC" + return $CC +} + proc gdb_find_gfortran {} { global tool_root_dir @@ -185,6 +206,18 @@ proc gdb_default_target_compile {source destfile type options} { } } + if { $i == "d" } { + set compiler_type "d" + if {[board_info $dest exists dflags]} { + append add_flags " [target_info dflags]" + } + if {[board_info $dest exists dcompiler]} { + set compiler [target_info dcompiler] + } else { + set compiler [find_gdc] + } + } + if { $i == "f77" } { set compiler_type "f77" if {[board_info $dest exists f77flags]} { @@ -285,6 +318,7 @@ proc gdb_default_target_compile {source destfile type options} { global CC_FOR_TARGET global CXX_FOR_TARGET + global DC_FOR_TARGET global F77_FOR_TARGET global F90_FOR_TARGET global GNATMAKE_FOR_TARGET @@ -309,6 +343,12 @@ proc gdb_default_target_compile {source destfile type options} { } } + if {[info exists DC_FOR_TARGET]} { + if { $compiler_type == "d" } { + set compiler $DC_FOR_TARGET + } + } + if {[info exists F77_FOR_TARGET]} { if { $compiler_type == "f77" } { set compiler $F77_FOR_TARGET @@ -560,6 +600,11 @@ if {[info procs find_go_linker] == ""} { set use_gdb_compile 1 } +if {[info procs find_gdc] == ""} { + rename gdb_find_gdc find_gdc + set use_gdb_compile 1 +} + if {$use_gdb_compile} { catch {rename default_target_compile {}} rename gdb_default_target_compile default_target_compile