public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: Add D support to gdb_default_target_compile
@ 2016-02-01 12:47 Iain Buclaw
  2016-02-10 12:29 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Iain Buclaw @ 2016-02-01 12:47 UTC (permalink / raw)
  To: GDB Patches

[-- Attachment #1: Type: text/plain, Size: 158 bytes --]

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.

[-- Attachment #2: dlang-future.patch --]
[-- Type: text/x-patch, Size: 2309 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gdb/testsuite: Add D support to gdb_default_target_compile
  2016-02-01 12:47 [PATCH] gdb/testsuite: Add D support to gdb_default_target_compile Iain Buclaw
@ 2016-02-10 12:29 ` Pedro Alves
  2016-02-11  7:04   ` Iain Buclaw
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2016-02-10 12:29 UTC (permalink / raw)
  To: Iain Buclaw, GDB Patches

On 02/01/2016 12:46 PM, Iain Buclaw wrote:
> 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.

Looks fine, but could you send a patch to dejagnu too, so that our
copy can be dropped at some point?

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gdb/testsuite: Add D support to gdb_default_target_compile
  2016-02-10 12:29 ` Pedro Alves
@ 2016-02-11  7:04   ` Iain Buclaw
  2016-02-11 10:00     ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Iain Buclaw @ 2016-02-11  7:04 UTC (permalink / raw)
  To: Pedro Alves; +Cc: GDB Patches

On 10 February 2016 at 13:29, Pedro Alves <palves@redhat.com> wrote:
> On 02/01/2016 12:46 PM, Iain Buclaw wrote:
>> 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.
>
> Looks fine, but could you send a patch to dejagnu too, so that our
> copy can be dropped at some point?
>
> Thanks,
> Pedro Alves
>

Yep, I have a patch against dejagnu ready.  I just haven't searched
for their patches ML just yet.

Thanks.
Iain

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gdb/testsuite: Add D support to gdb_default_target_compile
  2016-02-11  7:04   ` Iain Buclaw
@ 2016-02-11 10:00     ` Pedro Alves
  2016-02-18 20:52       ` Iain Buclaw
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2016-02-11 10:00 UTC (permalink / raw)
  To: Iain Buclaw; +Cc: GDB Patches

On 02/11/2016 07:04 AM, Iain Buclaw wrote:

> Yep, I have a patch against dejagnu ready.  I just haven't searched
> for their patches ML just yet.

It's dejagnu at gnu.org.  I'm not aware of a separate patches list.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gdb/testsuite: Add D support to gdb_default_target_compile
  2016-02-11 10:00     ` Pedro Alves
@ 2016-02-18 20:52       ` Iain Buclaw
  0 siblings, 0 replies; 5+ messages in thread
From: Iain Buclaw @ 2016-02-18 20:52 UTC (permalink / raw)
  To: Pedro Alves; +Cc: GDB Patches

On 11 February 2016 at 11:00, Pedro Alves <palves@redhat.com> wrote:
> On 02/11/2016 07:04 AM, Iain Buclaw wrote:
>
>> Yep, I have a patch against dejagnu ready.  I just haven't searched
>> for their patches ML just yet.
>
> It's dejagnu at gnu.org.  I'm not aware of a separate patches list.
>
> Thanks,
> Pedro Alves
>

Thanks, I've sent it the patch request to Dejagnu, and pushed this in.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-18 20:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-01 12:47 [PATCH] gdb/testsuite: Add D support to gdb_default_target_compile Iain Buclaw
2016-02-10 12:29 ` Pedro Alves
2016-02-11  7:04   ` Iain Buclaw
2016-02-11 10:00     ` Pedro Alves
2016-02-18 20:52       ` Iain Buclaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).