runtime: preserve stack context in tracebackothers

The tracebackothers function works by saving the current stack context
in the goroutine's context field and then calling gogo to switch to a
new goroutine.  The new goroutine will collect its own stack trace and
then call gogo to switch back to the original goroutine.  This works
fine, but if the original goroutine was called by mcall then the
contents of its context field are needed to return from the mcall.
Fix this by saving the stack context across the calls to the other
goroutines.

Change-Id: I26e2ef05f5324c7f82bee776ec3fdf997af29eac
Reviewed-on: https://go-review.googlesource.com/41293
Reviewed-by: Than McIntosh <thanm@google.com>
1 file changed