aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog16
-rw-r--r--gdb/testsuite/gdb.go/chan.exp1
-rw-r--r--gdb/testsuite/gdb.go/handcall.exp1
-rw-r--r--gdb/testsuite/gdb.go/hello.exp1
-rw-r--r--gdb/testsuite/gdb.go/integers.exp1
-rw-r--r--gdb/testsuite/gdb.go/max-depth.exp1
-rw-r--r--gdb/testsuite/gdb.go/methods.exp1
-rw-r--r--gdb/testsuite/gdb.go/package.exp1
-rw-r--r--gdb/testsuite/gdb.go/strings.exp1
-rw-r--r--gdb/testsuite/gdb.go/types.exp1
-rw-r--r--gdb/testsuite/gdb.go/unsafe.exp1
-rw-r--r--gdb/testsuite/lib/gdb.exp21
12 files changed, 46 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index f0549c26..cf7b3b1 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,19 @@
+2020-02-20 Tom de Vries <tdevries@suse.de>
+
+ * lib/gdb.exp (support_go_compile): New gdb_caching_proc.
+ (gdb_simple_compile): Handle compile_flags go by using .go extension
+ for source file.
+ * gdb.go/chan.exp: Use support_go_compile.
+ * gdb.go/handcall.exp: Same.
+ * gdb.go/hello.exp: Same.
+ * gdb.go/integers.exp: Same.
+ * gdb.go/max-depth.exp: Same.
+ * gdb.go/methods.exp: Same.
+ * gdb.go/package.exp: Same.
+ * gdb.go/strings.exp: Same.
+ * gdb.go/types.exp: Same.
+ * gdb.go/unsafe.exp: Same.
+
2020-02-19 Tom de Vries <tdevries@suse.de>
* gdb.python/lib-types.exp: Make xfail more strict.
diff --git a/gdb/testsuite/gdb.go/chan.exp b/gdb/testsuite/gdb.go/chan.exp
index 2281ede..d3799d5 100644
--- a/gdb/testsuite/gdb.go/chan.exp
+++ b/gdb/testsuite/gdb.go/chan.exp
@@ -21,6 +21,7 @@
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/handcall.exp b/gdb/testsuite/gdb.go/handcall.exp
index 360f351..0ae2e60 100644
--- a/gdb/testsuite/gdb.go/handcall.exp
+++ b/gdb/testsuite/gdb.go/handcall.exp
@@ -20,6 +20,7 @@
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/hello.exp b/gdb/testsuite/gdb.go/hello.exp
index 1096f64..e2ed54a 100644
--- a/gdb/testsuite/gdb.go/hello.exp
+++ b/gdb/testsuite/gdb.go/hello.exp
@@ -20,6 +20,7 @@
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/integers.exp b/gdb/testsuite/gdb.go/integers.exp
index efd3358..7d567db 100644
--- a/gdb/testsuite/gdb.go/integers.exp
+++ b/gdb/testsuite/gdb.go/integers.exp
@@ -20,6 +20,7 @@
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/max-depth.exp b/gdb/testsuite/gdb.go/max-depth.exp
index 7fef984..82879ce 100644
--- a/gdb/testsuite/gdb.go/max-depth.exp
+++ b/gdb/testsuite/gdb.go/max-depth.exp
@@ -20,6 +20,7 @@
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/methods.exp b/gdb/testsuite/gdb.go/methods.exp
index 0d23a69..e698cf3 100644
--- a/gdb/testsuite/gdb.go/methods.exp
+++ b/gdb/testsuite/gdb.go/methods.exp
@@ -20,6 +20,7 @@
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/package.exp b/gdb/testsuite/gdb.go/package.exp
index 53b0617..cb181c7 100644
--- a/gdb/testsuite/gdb.go/package.exp
+++ b/gdb/testsuite/gdb.go/package.exp
@@ -20,6 +20,7 @@
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile package1.go package2.go
diff --git a/gdb/testsuite/gdb.go/strings.exp b/gdb/testsuite/gdb.go/strings.exp
index d34498d..5da69a9 100644
--- a/gdb/testsuite/gdb.go/strings.exp
+++ b/gdb/testsuite/gdb.go/strings.exp
@@ -18,6 +18,7 @@
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/types.exp b/gdb/testsuite/gdb.go/types.exp
index fedc377..c8d7e21 100644
--- a/gdb/testsuite/gdb.go/types.exp
+++ b/gdb/testsuite/gdb.go/types.exp
@@ -20,6 +20,7 @@
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/unsafe.exp b/gdb/testsuite/gdb.go/unsafe.exp
index 89e2fff..c1f6257 100644
--- a/gdb/testsuite/gdb.go/unsafe.exp
+++ b/gdb/testsuite/gdb.go/unsafe.exp
@@ -20,6 +20,7 @@
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index d5e2295..d8ebddf 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2490,6 +2490,18 @@ gdb_caching_proc support_complex_tests {
} executable]
}
+# Return 1 if compiling go is supported.
+gdb_caching_proc support_go_compile {
+
+ return [gdb_can_simple_compile go-hello {
+ package main
+ import "fmt"
+ func main() {
+ fmt.Println("hello world")
+ }
+ } executable go]
+}
+
# Return 1 if GDB can get a type for siginfo from the target, otherwise
# return 0.
@@ -3631,7 +3643,14 @@ proc gdb_simple_compile {name code {type object} {compile_flags {}} {object obj}
set postfix "s"
}
}
- set src [standard_temp_file $name-[pid].c]
+ set ext "c"
+ foreach flag $compile_flags {
+ if { "$flag" == "go" } {
+ set ext "go"
+ break
+ }
+ }
+ set src [standard_temp_file $name-[pid].$ext]
set obj [standard_temp_file $name-[pid].$postfix]
set compile_flags [concat $compile_flags {debug nowarnings quiet}]