+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.
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile package1.go package2.go
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
load_lib "go.exp"
if { [skip_go_tests] } { continue }
+if { [support_go_compile] == 0 } { continue }
standard_testfile .go
} 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.
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}]