runtime: simply user throws, expand runtime throws

This gives explicit names to the possible states of throwing (-1, 0, 1).

m.throwing is now one of:

throwTypeOff: not throwing, previously == 0
throwTypeUser: user throw, previously == -1
throwTypeRuntime: runtime throw, previously == 1

For runtime throws, we now always include frame metadata and system
goroutines regardless of GOTRACEBACK to aid in debugging the runtime.

For user throws, we no longer include frame metadata or runtime frames,
unless GOTRACEBACK=system or higher.

For #51485.

Change-Id: If252e2377a0b6385ce7756b937929be4273a56c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/390421
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Michael Pratt 2022-03-07 14:07:14 -05:00
parent 29bbca5c2c
commit 4289bd365c
9 changed files with 49 additions and 18 deletions

View file

@ -532,7 +532,7 @@ type m struct {
oldp puintptr // the p that was attached before executing a syscall
id int64
mallocing int32
throwing int32
throwing throwType
preemptoff string // if != "", keep curg running on this m
locks int32
dying int32