]> Cypherpunks repositories - gostls13.git/commit
runtime/gdb: use goroutine atomicstatus to determine the state
authorHana Kim <hakim@google.com>
Tue, 16 Jan 2018 20:31:12 +0000 (15:31 -0500)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Tue, 13 Feb 2018 19:23:37 +0000 (19:23 +0000)
commitdc3bef36354c7977cfd9e4459e1e6f31bc8624a6
tree46b157a5f09ec677b714c10ea01114fdf9865c67
parentef175731ffd2eee6b0da5c2eb8dc2590f2641f2f
runtime/gdb: use goroutine atomicstatus to determine the state

Previously find_goroutine determined whether a goroutine is
stopped by checking the sched.sp field. This heuristic doesn't
always hold but causes find_goroutine to return bogus pc/sp
info for running goroutines.

This change uses the atomicstatus bit to determine
the state which is more accurate.

R=go1.11

Change-Id: I537d432d9e0363257120a196ce2ba52da2970f59
Reviewed-on: https://go-review.googlesource.com/49691
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/runtime-gdb.py
src/runtime/runtime-gdb_test.go