// InjectDebugCall injects a debugger call to fn into g. regArgs must // contain any arguments to fn that are passed in registers, according // to the internal Go ABI. It may be nil if no arguments are passed in // registers to fn. args must be a pointer to a valid call frame (including // arguments and return space) for fn, or nil. tkill must be a function that // will send SIGTRAP to thread ID tid. gp must be locked to its OS thread and // running. // // 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 any, regArgs *abi.RegArgs, stackArgs any, tkill func(tid int) error, returnOnUnsafePoint bool) (any, error) { … } type debugCallHandler … func (h *debugCallHandler) inject(info *siginfo, ctxt *sigctxt, gp2 *g) bool { … } func (h *debugCallHandler) handle(info *siginfo, ctxt *sigctxt, gp2 *g) bool { … }