go-delve/delve · error

not implemented

Error message

not implemented

What it means

callOP sets up a function call injection on a thread for a given calling convention. The default case — reached when bininfo.Arch.Name is none of '386', 'amd64', 'arm64', 'ppc64le', 'loong64' (i.e. an architecture without call-injection support, such as riscv64) — panics 'not implemented'. Function calls from the debugger are inherently architecture-specific (register setup: args, stack alignment, LR/PC).

Source

Thrown at pkg/proc/fncall.go:501

	case "amd64":
		sp := regs.SP()
		// push PC on the stack
		sp -= uint64(bi.Arch.PtrSize())
		if err := setSP(thread, sp); err != nil {
			return err
		}
		if err := writePointer(bi, thread.ProcessMemory(), sp, regs.PC()); err != nil {
			return err
		}
		return setPC(thread, callAddr)
	case "arm64", "ppc64le", "loong64":
		if err := setLR(thread, regs.PC()); err != nil {
			return err
		}
		return setPC(thread, callAddr)

	default:
		panic("not implemented")
	}
}

// funcCallEvalFuncExpr evaluates expr.Fun and returns the function that we're trying to call.
// If allowCalls is false function calls will be disabled even if scope.callCtx != nil
func funcCallEvalFuncExpr(scope *EvalScope, stack *evalStack, fncall *functionCallState) error {
	bi := scope.BinInfo

	fnvar := stack.peek()
	if fnvar.Kind != reflect.Func {
		return fmt.Errorf("expression %q is not a function", astutil.ExprToString(fncall.expr.Fun))
	}
	fnvar.loadValue(LoadConfig{false, 0, 0, 0, 0, 0})
	if fnvar.Unreadable != nil {
		return fnvar.Unreadable
	}
	if fnvar.Base == 0 {
		return errors.New("nil pointer dereference")

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Only use function-call expressions on supported architectures (386, amd64, arm64, ppc64le, loong64)
  2. Implement the missing arch case in callOP (argument registers, SP alignment, PC/LR) when porting call injection
  3. Check Delve docs: function calls have per-architecture support; disable call injection (allowCalls=false) for unsupported arches

Example fix

// before
default:
	panic("not implemented")
// after
default:
	return fmt.Errorf("function call injection not implemented for %s", bininfo.Arch.Name)
Defensive patterns

Strategy: validation

Validate before calling

var callOPArches = map[string]bool{"386":true,"amd64":true,"arm64":true,"ppc64le":true,"loong64":true}
if !callOPArches[bininfo.Arch.Name] {
	return fmt.Errorf("function calls unsupported on %s", bininfo.Arch.Name)
}

Prevention

When it happens

Trigger: evalCallInjectionStart / evalCallInjectionSetTarget invoking callOP with a thread whose architecture isn't one of the implemented ones — i.e. starting a function-call expression evaluation (print f(), eval -c ...) on an unsupported arch.

Common situations: Using function calls from the CLI or IDE on riscv64 or other freshly ported architectures; automated expression evaluation that inadvertently calls functions on unsupported targets.

Related errors


AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31). Data as JSON: /api/errors/458f6c5fb0610496. Report an issue: GitHub.