diff options
author | David Chase <drchase@google.com> | 2018-03-26 13:37:00 -0400 |
---|---|---|
committer | David Chase <drchase@google.com> | 2018-03-26 18:44:52 +0000 |
commit | a934e34e875d6402da79d52a859434b60b6f6131 (patch) | |
tree | 0897c44cdd19ff8b8af248a2b11d92e5eb20a856 /src/cmd/compile/internal/ssa/debug_test.go | |
parent | 3db3826a57ccb39c1e30fe70dc82f2a6c2785877 (diff) | |
download | go-a934e34e875d6402da79d52a859434b60b6f6131.tar.gz go-a934e34e875d6402da79d52a859434b60b6f6131.zip |
cmd/compile: invoke gdb more carefully in ssa/debug_test.go
Gdb can be sensitive to contents of .gdbinit, and to run
this test properly needs to have runtime/runtime-gdb.py
on the auto load safe path. Therefore, turn off .gdbinit
loading and explicitly add $GOROOT/runtime to the safe
load path.
This should make ssa/debug_test.go run more consistently.
Updates #24464.
Change-Id: I63ed17c032cb3773048713ce51fca3a3f86e79b6
Reviewed-on: https://go-review.googlesource.com/102598
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/debug_test.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/debug_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/debug_test.go b/src/cmd/compile/internal/ssa/debug_test.go index ff9f17525b..d0a7a69db9 100644 --- a/src/cmd/compile/internal/ssa/debug_test.go +++ b/src/cmd/compile/internal/ssa/debug_test.go @@ -551,7 +551,9 @@ type gdbState struct { func newGdb(tag, executable string, args ...string) dbgr { // Turn off shell, necessary for Darwin apparently - cmd := exec.Command(gdb, "-ex", "set startup-with-shell off", executable) + cmd := exec.Command(gdb, "-nx", + "-iex", fmt.Sprintf("add-auto-load-safe-path %s/src/runtime", runtime.GOROOT()), + "-ex", "set startup-with-shell off", executable) cmd.Env = replaceEnv(cmd.Env, "TERM", "dumb") s := &gdbState{tagg: tag, cmd: cmd, args: args} s.atLineRe = regexp.MustCompile("(^|\n)([0-9]+)(.*)") |