go-delve/delve · error

executables built by Go 1.11 or later need Delve built by Go

Error message

executables built by Go 1.11 or later need Delve built by Go 1.11 or later

What it means

Delve must be compiled with a Go toolchain new enough to understand the debug info produced by the toolchain that built the debuggee. When loading the binary fails and Delve detects the executable was built by Go 1.11+ while the running Delve binary itself was built by an older Go (pre-1.11), it returns this explanatory error instead of the raw parse failure.

Source

Thrown at service/debugger/debugger.go:2512

		if g == nil {
			g = &proc.G{Unreadable: err}
		}
		gs[i] = g
	}
	return gs, nil
}

func go11DecodeErrorCheck(err error) error {
	if !errors.Is(err, dwarf.DecodeError{}) {
		return err
	}

	gover, ok := goversion.Installed()
	if !ok || !gover.AfterOrEqual(goversion.GoVersion{Major: 1, Minor: 11, Rev: -1}) || goversion.VersionAfterOrEqual(runtime.Version(), 1, 11) {
		return err
	}

	return errors.New("executables built by Go 1.11 or later need Delve built by Go 1.11 or later")
}

const NoDebugWarning string = "debuggee must not be built with 'go run' or -ldflags='-s -w', which strip debug info"

func noDebugErrorWarning(err error) error {
	if errors.Is(err, dwarf.DecodeError{}) || strings.Contains(err.Error(), "could not open debug info") {
		return fmt.Errorf("%s - %s", err.Error(), NoDebugWarning)
	}
	return err
}

func verifyBinaryFormat(exePath string) (string, error) {
	fullpath, err := filepath.Abs(exePath)
	if err != nil {
		return "", err
	}

	f, err := os.Open(fullpath)

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Rebuild or reinstall Delve with a current Go toolchain: `go install github.com/go-delve/delve/cmd/dlv@latest`
  2. Download a prebuilt dlv release built with a recent Go version
  3. Check `dlv version` output for its Go version and ensure it is >= the version used to build your program

Example fix

// before (shell)
dlv version  # built with go1.10
dlv debug .  # program built with go1.21 -> error
// after
go install github.com/go-delve/delve/cmd/dlv@latest
dlv debug .
Defensive patterns

Strategy: fallback

Validate before calling

// shell precondition check
if !strings.Contains(run(captureStderr, "go", "version"), goRuntimeVerOfDelve()) {
    // warn: delve binary built with older Go than target
}

Type guard

func delveToolchainNewEnough(dlvGoVer string, targetGoVer goversion.GoVersion) bool {
    v, ok := goversion.Parse(dlvGoVer)
    return ok && v.AfterOrEqual(targetGoVer)
}

Try / catch

_, err := dbg.Launch(args, dir)
if err != nil && strings.Contains(err.Error(), "need Delve built by Go 1.11 or later") {
    // instruct user to reinstall dlv with a current toolchain
}

Prevention

When it happens

Trigger: noDebugErrorWarning / the helper at debugger.go:2512 receives an error while parsing the executable's debug info (dwarf.DecodeError or missing debug info) and goversion checks confirm: executable built with Go >= 1.11 but runtime.Version() of the Delve binary is < 1.11.

Common situations: Using a very old prebuilt dlv binary (built with Go 1.10 or earlier) against any modern Go program; distro-packaged delve versions pinned to ancient toolchains; environments where an old delve was vendored and never rebuilt.

Related errors


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