aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_debug_test.go
diff options
context:
space:
mode:
authorChressie Himpel <chressie@google.com>2022-02-03 19:10:54 +0100
committerChressie Himpel <chressie@google.com>2022-02-03 19:30:02 +0100
commite14fee553a4646d15123caa04f7ca6ddb7b48362 (patch)
tree26086b9981918546f946d12547d097eb0974cc2e /src/runtime/export_debug_test.go
parentd382493a20cf005c6631032ebb410a7c2bc768eb (diff)
parent8384fe86a5b7f579a50c7ad423d4dd4eb2d1f117 (diff)
downloadgo-e14fee553a4646d15123caa04f7ca6ddb7b48362.tar.xz
[dev.boringcrypto] all: merge master into dev.boringcrypto
Change-Id: I18dbf4f9fa7e2334fccedd862a523126cf38164e
Diffstat (limited to 'src/runtime/export_debug_test.go')
-rw-r--r--src/runtime/export_debug_test.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/runtime/export_debug_test.go b/src/runtime/export_debug_test.go
index 032a9b9725..19a9ec135f 100644
--- a/src/runtime/export_debug_test.go
+++ b/src/runtime/export_debug_test.go
@@ -22,7 +22,7 @@ import (
//
// On success, InjectDebugCall returns the panic value of fn or nil.
// If fn did not panic, its results will be available in args.
-func InjectDebugCall(gp *g, fn interface{}, regArgs *abi.RegArgs, stackArgs interface{}, tkill func(tid int) error, returnOnUnsafePoint bool) (interface{}, error) {
+func InjectDebugCall(gp *g, fn any, regArgs *abi.RegArgs, stackArgs any, tkill func(tid int) error, returnOnUnsafePoint bool) (any, error) {
if gp.lockedm == 0 {
return nil, plainError("goroutine not locked to thread")
}
@@ -96,7 +96,7 @@ type debugCallHandler struct {
regArgs *abi.RegArgs
argp unsafe.Pointer
argSize uintptr
- panic interface{}
+ panic any
handleF func(info *siginfo, ctxt *sigctxt, gp2 *g) bool
@@ -107,6 +107,10 @@ type debugCallHandler struct {
}
func (h *debugCallHandler) inject(info *siginfo, ctxt *sigctxt, gp2 *g) bool {
+ // TODO(49370): This code is riddled with write barriers, but called from
+ // a signal handler. Add the go:nowritebarrierrec annotation and restructure
+ // this to avoid write barriers.
+
switch h.gp.atomicstatus {
case _Grunning:
if getg().m != h.mp {
@@ -141,7 +145,11 @@ func (h *debugCallHandler) inject(info *siginfo, ctxt *sigctxt, gp2 *g) bool {
}
func (h *debugCallHandler) handle(info *siginfo, ctxt *sigctxt, gp2 *g) bool {
- // Sanity check.
+ // TODO(49370): This code is riddled with write barriers, but called from
+ // a signal handler. Add the go:nowritebarrierrec annotation and restructure
+ // this to avoid write barriers.
+
+ // Double-check m.
if getg().m != h.mp {
println("trap on wrong M", getg().m, h.mp)
return false