Commit cd682f38 authored by Egon Elbre's avatar Egon Elbre Committed by Alex Brainman

runtime: improve Windows gdb tests

This ensures that gdb tests run on Windows by ignoring any line ending.

Works with gdb 7.7, however with gdb 7.9 and 7.12 gets an error
error:

    internal-error: buildsym_init: Assertion `free_pendings == NULL'
    failed.

Updates #21380

Change-Id: I6a6e5b2a1b5efdca4dfce009fcb9c134c87497d6
Reviewed-on: https://go-review.googlesource.com/102419
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarAlex Brainman <alex.brainman@gmail.com>
parent 31db81d3
...@@ -70,7 +70,7 @@ func checkGdbPython(t *testing.T) { ...@@ -70,7 +70,7 @@ func checkGdbPython(t *testing.T) {
if err != nil { if err != nil {
t.Skipf("skipping due to issue running gdb: %v", err) t.Skipf("skipping due to issue running gdb: %v", err)
} }
if string(out) != "go gdb python support\n" { if strings.TrimSpace(string(out)) != "go gdb python support" {
t.Skipf("skipping due to lack of python gdb support: %s", out) t.Skipf("skipping due to lack of python gdb support: %s", out)
} }
} }
...@@ -154,8 +154,8 @@ func testGdbPython(t *testing.T, cgo bool) { ...@@ -154,8 +154,8 @@ func testGdbPython(t *testing.T, cgo bool) {
t.Fatalf("building source %v\n%s", err, out) t.Fatalf("building source %v\n%s", err, out)
} }
args := []string{"-nx", "-q", "--batch", "-iex", args := []string{"-nx", "-q", "--batch",
fmt.Sprintf("add-auto-load-safe-path %s/src/runtime", runtime.GOROOT()), "-iex", "add-auto-load-safe-path " + filepath.Join(runtime.GOROOT(), "src", "runtime"),
"-ex", "set startup-with-shell off", "-ex", "set startup-with-shell off",
"-ex", "info auto-load python-scripts", "-ex", "info auto-load python-scripts",
"-ex", "set python print-stack full", "-ex", "set python print-stack full",
...@@ -320,6 +320,7 @@ func TestGdbBacktrace(t *testing.T) { ...@@ -320,6 +320,7 @@ func TestGdbBacktrace(t *testing.T) {
// Execute gdb commands. // Execute gdb commands.
args := []string{"-nx", "-batch", args := []string{"-nx", "-batch",
"-iex", "add-auto-load-safe-path " + filepath.Join(runtime.GOROOT(), "src", "runtime"),
"-ex", "set startup-with-shell off", "-ex", "set startup-with-shell off",
"-ex", "break main.eee", "-ex", "break main.eee",
"-ex", "run", "-ex", "run",
...@@ -390,6 +391,7 @@ func TestGdbAutotmpTypes(t *testing.T) { ...@@ -390,6 +391,7 @@ func TestGdbAutotmpTypes(t *testing.T) {
// Execute gdb commands. // Execute gdb commands.
args := []string{"-nx", "-batch", args := []string{"-nx", "-batch",
"-iex", "add-auto-load-safe-path " + filepath.Join(runtime.GOROOT(), "src", "runtime"),
"-ex", "set startup-with-shell off", "-ex", "set startup-with-shell off",
"-ex", "break main.main", "-ex", "break main.main",
"-ex", "run", "-ex", "run",
...@@ -455,6 +457,7 @@ func TestGdbConst(t *testing.T) { ...@@ -455,6 +457,7 @@ func TestGdbConst(t *testing.T) {
// Execute gdb commands. // Execute gdb commands.
args := []string{"-nx", "-batch", args := []string{"-nx", "-batch",
"-iex", "add-auto-load-safe-path " + filepath.Join(runtime.GOROOT(), "src", "runtime"),
"-ex", "set startup-with-shell off", "-ex", "set startup-with-shell off",
"-ex", "break main.main", "-ex", "break main.main",
"-ex", "run", "-ex", "run",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment