From 8728df645c70e6420eb59e5886bc839022998322 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Sun, 24 Apr 2016 17:36:41 -0400 Subject: [PATCH] runtime: remove canBackTrace variable from TestGdbPython 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 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot --- src/runtime/runtime-gdb_test.go | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go index e7aaa27b03..ba005ac35b 100644 --- a/src/runtime/runtime-gdb_test.go +++ b/src/runtime/runtime-gdb_test.go @@ -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) } } -- 2.48.1