go-delve/delve · error

To debug executables using DWARFv5 or later Delve must be bu

Error message

To debug executables using DWARFv5 or later Delve must be built with Go version 1.25.0 or later

What it means

Delve's Compatible check in pkg/goversion/compat.go verifies that the Go toolchain used to BUILD Delve itself can parse the DWARF version of the target executable. Debugging DWARFv5+ executables requires Delve to have been compiled with Go 1.25.0 or later; otherwise older DWARF-parsing libraries produce wrong results, so Delve refuses (or warns) with this message.

Source

Thrown at pkg/goversion/compat.go:59

			return nil
		}
		return fmt.Errorf(goTooOldErr, ver.String())
	}
	if ver.AfterOrEqual(GoVersion{MaxSupportedVersionOfGoMajor, MaxSupportedVersionOfGoMinor + 1, betaRev(0), "", ""}) {
		if warnonly {
			logflags.WriteError(fmt.Sprintf(dlvTooOldWarn, ver.String()))
			return nil
		}
		return fmt.Errorf(dlvTooOldErr, ver.String())
	}
	if dwarfVer >= 5 {
		if !VersionAfterOrEqual(runtime.Version(), 1, 25) {
			const errstr = "To debug executables using DWARFv5 or later Delve must be built with Go version 1.25.0 or later"
			if warnonly {
				logflags.WriteError(errstr)
				return nil
			}
			return errors.New(errstr)
		}
	}
	return nil
}

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Rebuild/reinstall Delve using Go 1.25.0 or later (go install github.com/go-delve/delve/cmd/dlv@latest with a current toolchain)
  2. Update your system's dlv package to a build produced with a recent Go toolchain
  3. As a workaround for older Go targets, compile the debugged binary with -gcflags=all="-dwarf=false" plus appropriate flags or use a Delve version matched to that Go version

Example fix

// before (built with go1.24)
go install github.com/go-delve/delve/cmd/dlv@latest
// after
export PATH=/usr/local/go1.25/bin:$PATH
go version  # go1.25.0 or later
go install github.com/go-delve/delve/cmd/dlv@latest
Defensive patterns

Strategy: validation

Validate before calling

if !goversion.VersionAfterOrEqual(runtime.Version(), 1, 25) {
    return errors.New("this Delve build cannot parse DWARFv5; rebuild with Go >= 1.25")
}
err := goversion.Compatible(binPath, false)

Try / catch

if err := goversion.Compatible(path, false); err != nil {
    if strings.Contains(err.Error(), "DWARFv5") {
        return fmt.Errorf("unsupported target DWARF version: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: Calling goversion.Compatible (directly or via debugger startup) on an executable that uses DWARFv5 or later while the Delve binary was built with runtime.Version() before 1.25.0; when warnonly is true it only logs, otherwise it returns this error.

Common situations: Debugging binaries produced by very new Go toolchains (which default to DWARF5) using a Delve installed from an older toolchain; distro-packaged dlv builds compiled with stale Go versions.

Related errors


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