runtime: fix isSystemGoroutine for gccgo
commitae439daba1d6b0ca232ba460c58de61c157fe2a5
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 May 2017 20:55:41 +0000 (11 20:55 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 May 2017 20:55:41 +0000 (11 20:55 +0000)
tree1836ce9be27e6473305ed505646f84c09ff1a621
parent7511addcbc1810d50268782eec8ff180ac33cf0a
runtime: fix isSystemGoroutine for gccgo

    The gc toolchain decides whether a goroutine is a system goroutine by
    comparing startpc to a list of saved special PCs.  In gccgo that
    approach does not work as startpc is often a thunk that invokes the
    real function with arguments, so the thunk address never matches the
    saved special PCs.

    This patch fixes gccgo's understanding of system goroutines.  Since
    there are only a limited number of them, we simply change each one to
    mark itself as special.

    This fixes stack dumps and functions like runtime.NumGoroutine to
    behave more like gc.  It also fixes the goprint test in the gc
    testsuite.

    Reviewed-on: https://go-review.googlesource.com/43156

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247931 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
libgo/go/runtime/mfinal.go
libgo/go/runtime/mgc.go
libgo/go/runtime/mgcsweep.go
libgo/go/runtime/proc.go
libgo/go/runtime/runtime2.go
libgo/go/runtime/time.go
libgo/go/runtime/traceback_gccgo.go