diff options
| author | Keith Randall <khr@golang.org> | 2016-06-08 22:02:08 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2017-04-21 20:19:50 +0000 |
| commit | 1e72bf62183ea21b9affffd4450d44d994393899 (patch) | |
| tree | f85847aa6dd2c0b82a735fdaccb5a80dd31a3889 /src/runtime/runtime-gdb_test.go | |
| parent | e516227554a355ed3bb66e433057cab84e92085c (diff) | |
| download | go-1e72bf62183ea21b9affffd4450d44d994393899.tar.xz | |
cmd/compile: experiment which clobbers all dead pointer fields
The experiment "clobberdead" clobbers all pointer fields that the
compiler thinks are dead, just before and after every safepoint.
Useful for debugging the generation of live pointer bitmaps.
Helped find the following issues:
Update #15936
Update #16026
Update #16095
Update #18860
Change-Id: Id1d12f86845e3d93bae903d968b1eac61fc461f9
Reviewed-on: https://go-review.googlesource.com/23924
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/runtime-gdb_test.go')
| -rw-r--r-- | src/runtime/runtime-gdb_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go index 5f33ebf91c..3cc41e0b7f 100644 --- a/src/runtime/runtime-gdb_test.go +++ b/src/runtime/runtime-gdb_test.go @@ -69,6 +69,7 @@ func checkGdbPython(t *testing.T) { const helloSource = ` import "fmt" +import "runtime" var gslice []string func main() { mapvar := make(map[string]string,5) @@ -78,9 +79,10 @@ func main() { ptrvar := &strvar slicevar := make([]string, 0, 16) slicevar = append(slicevar, mapvar["abc"]) - fmt.Println("hi") // line 12 + fmt.Println("hi") // line 13 _ = ptrvar gslice = slicevar + runtime.KeepAlive(mapvar) } ` @@ -211,7 +213,7 @@ func testGdbPython(t *testing.T, cgo bool) { t.Fatalf("info locals failed: %s", bl) } - btGoroutineRe := regexp.MustCompile(`^#0\s+runtime.+at`) + btGoroutineRe := regexp.MustCompile(`^#0\s+(0x[0-9a-f]+\s+in\s+)?runtime.+at`) if bl := blocks["goroutine 2 bt"]; !btGoroutineRe.MatchString(bl) { t.Fatalf("goroutine 2 bt failed: %s", bl) } |
