aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime-gdb_test.go
diff options
context:
space:
mode:
authorHaosdent Huang <haosdent@gmail.com>2019-04-29 02:04:26 +0000
committerDavid Chase <drchase@google.com>2019-04-29 18:11:11 +0000
commit8c1f78524e421ac01e35e8805dd7a45bf98c2a79 (patch)
tree83d40f52bf7a4cd2cf49b5c9aac3c7730d0217a6 /src/runtime/runtime-gdb_test.go
parent08b956f37846bd317aace534aa98dcd9353d868b (diff)
downloadgo-8c1f78524e421ac01e35e8805dd7a45bf98c2a79.tar.gz
go-8c1f78524e421ac01e35e8805dd7a45bf98c2a79.zip
runtime: support all as parameter in gdb goroutine commands.
For example, can use `goroutine all bt` to dump all goroutines' information. Change-Id: I51b547c2b837913e4bdabf0f45b28f09250a3e34 GitHub-Last-Rev: d04dcd4f581f97e35ee45969a864f1270d79e49b GitHub-Pull-Request: golang/go#26283 Reviewed-on: https://go-review.googlesource.com/c/go/+/122589 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/runtime/runtime-gdb_test.go')
-rw-r--r--src/runtime/runtime-gdb_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go
index 63d6e52dea..de1bac65da 100644
--- a/src/runtime/runtime-gdb_test.go
+++ b/src/runtime/runtime-gdb_test.go
@@ -217,6 +217,9 @@ func testGdbPython(t *testing.T, cgo bool) {
"-ex", "echo BEGIN goroutine 2 bt\n",
"-ex", "goroutine 2 bt",
"-ex", "echo END\n",
+ "-ex", "echo BEGIN goroutine all bt\n",
+ "-ex", "goroutine all bt",
+ "-ex", "echo END\n",
"-ex", "clear main.go:15", // clear the previous break point
"-ex", fmt.Sprintf("br main.go:%d", nLines), // new break point at the end of main
"-ex", "c",
@@ -303,6 +306,10 @@ func testGdbPython(t *testing.T, cgo bool) {
t.Fatalf("goroutine 2 bt failed: %s", bl)
}
+ if bl := blocks["goroutine all bt"]; !btGoroutine1Re.MatchString(bl) || !btGoroutine2Re.MatchString(bl) {
+ t.Fatalf("goroutine all bt failed: %s", bl)
+ }
+
btGoroutine1AtTheEndRe := regexp.MustCompile(`(?m)^#0\s+(0x[0-9a-f]+\s+in\s+)?main\.main.+at`)
if bl := blocks["goroutine 1 bt at the end"]; !btGoroutine1AtTheEndRe.MatchString(bl) {
t.Fatalf("goroutine 1 bt at the end failed: %s", bl)