go-delve/delve · error

function calls not supported by this version of Go

Error message

function calls not supported by this version of Go

What it means

errFuncCallUnsupported is returned when a function call is requested but the Go runtime of the debugged program does not support Delve's call-injection mechanism: the binary must be built by a Go version that provides runtime.debugCallV1/V2 (maxDebugCallVersion 2). Returned by EvalExpressionWithCalls and evalCallInjectionStart in pkg/proc/fncall.go.

Source

Thrown at pkg/proc/fncall.go:59

// done by:
//
//  - evalop.CallInjectionStart
//  - evalop.CallInjectionSetTarget
//  - evalCallInjectionCopyArg
//  - evalCallInjectionComplete
//
// When the target has runtime.debugPinner then evalCallInjectionPinPointer
// must be also called in a loop until it returns false.

const (
	debugCallFunctionNamePrefix1 = "debugCall"
	debugCallFunctionNamePrefix2 = "runtime.debugCall"
	maxDebugCallVersion          = 2
	maxArgFrameSize              = 65535
)

var (
	errFuncCallUnsupported        = errors.New("function calls not supported by this version of Go")
	errFuncCallUnsupportedBackend = errors.New("backend does not support function calls")
	errFuncCallInProgress         = errors.New("cannot call function while another function call is already in progress")
	errNoGoroutine                = errors.New("no goroutine selected")
	errGoroutineNotRunning        = errors.New("selected goroutine not running")
	errNotEnoughStack             = errors.New("not enough stack space")
	errTooManyArguments           = errors.New("too many arguments")
	errNotEnoughArguments         = errors.New("not enough arguments")
	errNotAGoFunction             = errors.New("not a Go function")
	errFuncCallNotAllowedStrAlloc = errors.New("literal string can not be allocated because function calls are not allowed without using 'call'")
)

type functionCallState struct {
	// savedRegs contains the saved registers
	savedRegs Registers
	// err contains a saved error
	err error
	// expr is the expression being evaluated
	expr *ast.CallExpr

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Rebuild the target binary with a Go version that supports debugCallV2 (Go >= 1.11/1.12 era; ideally current)
  2. If a rebuild is impossible, step into the code manually or use breakpoints to observe instead of injecting calls
  3. Verify the target's Go version with the 'version' / version-related commands in the debugger

Example fix

// before: target built with go1.9
dlv> call foo(1)
// after: rebuild target with modern Go
go build -gcflags="all=-N -l" -o app ./cmd/app
dlv exec ./app
Defensive patterns

Strategy: fallback

Validate before calling

// check target Go version supports runtime.debugCallV2 (Go >= 1.11)
// dlv> version   (shows target's Go producer)

Try / catch

if errors.Is(err, proc.ErrFuncCallUnsupported) {
    // fall back to breakpoints + variable inspection instead of injecting calls
}

Prevention

When it happens

Trigger: Calling EvalExpressionWithCalls (or the 'call' terminal command) on a target built with a Go version older than the minimum supported for debugCall injection, so no runtime.debugCall* symbol is found.

Common situations: Debugging legacy binaries compiled with old Go toolchains; attaching to system/production binaries that were never rebuilt; mixing a modern Delve with an ancient target binary.

Related errors


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