This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Add D support to gdb_default_target_compile.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=24f75eadabc519563ed119932c77874a016a799a

commit 24f75eadabc519563ed119932c77874a016a799a
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Thu Feb 18 22:01:44 2016 +0100

    Add D support to gdb_default_target_compile.
    
    gdb/testsuite/ChangeLog:
    
    	* lib/future.exp: Add D support.
    	(gdb_find_gdc): New proc.
    	(gdb_default_target_compile): Add D support.

Diff:
---
 gdb/testsuite/ChangeLog      |  6 ++++++
 gdb/testsuite/lib/future.exp | 45 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 31f8d38..5676cac 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-18  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+	* lib/future.exp: Add D support.
+	(gdb_find_gdc): New proc.
+	(gdb_default_target_compile): Add D support.
+
 2016-02-18  Wei-cheng Wang  <cole945@gmail.com>
 
 	* gdb.trace/tspeed.c (myclock): Return wallclock instead of
diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp
index 538fa5a..4f771b8 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 D_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 D_FOR_TARGET]} {
+	if { $compiler_type == "d" } {
+	    set compiler $D_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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]