]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove canBackTrace variable from TestGdbPython
authorMichael Munday <munday@ca.ibm.com>
Sun, 24 Apr 2016 21:36:41 +0000 (17:36 -0400)
committerMichael Munday <munday@ca.ibm.com>
Wed, 12 Oct 2016 02:16:11 +0000 (02:16 +0000)
The canBackTrace variable is true for all of the architectures
Go supports and this is likely to remain the case as new
architectures are added.

Change-Id: I73900c018eb4b2e5c02fccd8d3e89853b2ba9d90
Reviewed-on: https://go-review.googlesource.com/22423
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/runtime-gdb_test.go

index e7aaa27b038d596e82dfdb39ecde4e6aa4d6772d..ba005ac35b594c9de5ebbc426d0a36fddea6f1b4 100644 (file)
@@ -121,21 +121,11 @@ func TestGdbPython(t *testing.T) {
                "-ex", "print strvar",
                "-ex", "echo END\n",
                "-ex", "down", // back to fmt.Println (goroutine 2 below only works at bottom of stack.  TODO: fix that)
+               "-ex", "echo BEGIN goroutine 2 bt\n",
+               "-ex", "goroutine 2 bt",
+               "-ex", "echo END\n",
+               filepath.Join(dir, "a.exe"),
        }
-
-       // without framepointer, gdb cannot backtrace our non-standard
-       // stack frames on RISC architectures.
-       canBackTrace := false
-       switch runtime.GOARCH {
-       case "amd64", "386", "ppc64", "ppc64le", "arm", "arm64", "mips64", "mips64le", "s390x":
-               canBackTrace = true
-               args = append(args,
-                       "-ex", "echo BEGIN goroutine 2 bt\n",
-                       "-ex", "goroutine 2 bt",
-                       "-ex", "echo END\n")
-       }
-
-       args = append(args, filepath.Join(dir, "a.exe"))
        got, _ := exec.Command("gdb", args...).CombinedOutput()
 
        firstLine := bytes.SplitN(got, []byte("\n"), 2)[0]
@@ -179,10 +169,8 @@ func TestGdbPython(t *testing.T) {
        }
 
        btGoroutineRe := regexp.MustCompile(`^#0\s+runtime.+at`)
-       if bl := blocks["goroutine 2 bt"]; canBackTrace && !btGoroutineRe.MatchString(bl) {
+       if bl := blocks["goroutine 2 bt"]; !btGoroutineRe.MatchString(bl) {
                t.Fatalf("goroutine 2 bt failed: %s", bl)
-       } else if !canBackTrace {
-               t.Logf("gdb cannot backtrace for GOARCH=%s, skipped goroutine backtrace test", runtime.GOARCH)
        }
 }