runtime: make gcDumpObject useful on stack frames

gcDumpObject is often used on a stack pointer (for example, when
checkmark finds an unmarked object on the stack), but since stack
spans don't have an elemsize, it doesn't print any of the memory from
the frame. Make it at least slightly more useful by printing
everything between obj and obj+off (inclusive). While we're here, also
print out the span state.

Change-Id: I51be064ea8791b4a365865bfdc7afa7b5aaecfbd
Reviewed-on: https://go-review.googlesource.com/30142
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
This commit is contained in:
Austin Clements 2016-09-09 10:22:10 -04:00
parent 6879dbde4e
commit 38f1df66ff
2 changed files with 24 additions and 2 deletions

View file

@ -111,6 +111,15 @@ const (
_MSpanDead
)
// mSpanStateNames are the names of the span states, indexed by
// mSpanState.
var mSpanStateNames = []string{
"_MSpanInUse",
"_MSpanStack",
"_MSpanFree",
"_MSpanDead",
}
// mSpanList heads a linked list of spans.
//
// Linked list structure is based on BSD's "tail queue" data structure.