{"record":{"id":"d12a8165f829f685","repo":"go-delve/delve","slug":"to-debug-executables-using-dwarfv5-or-later-delve","errorCode":null,"errorMessage":"To debug executables using DWARFv5 or later Delve must be built with Go version 1.25.0 or later","messagePattern":"To debug executables using DWARFv5 or later Delve must be built with Go version 1\\.25\\.0 or later","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/goversion/compat.go","lineNumber":59,"sourceCode":"\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(goTooOldErr, ver.String())\n\t}\n\tif ver.AfterOrEqual(GoVersion{MaxSupportedVersionOfGoMajor, MaxSupportedVersionOfGoMinor + 1, betaRev(0), \"\", \"\"}) {\n\t\tif warnonly {\n\t\t\tlogflags.WriteError(fmt.Sprintf(dlvTooOldWarn, ver.String()))\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(dlvTooOldErr, ver.String())\n\t}\n\tif dwarfVer >= 5 {\n\t\tif !VersionAfterOrEqual(runtime.Version(), 1, 25) {\n\t\t\tconst errstr = \"To debug executables using DWARFv5 or later Delve must be built with Go version 1.25.0 or later\"\n\t\t\tif warnonly {\n\t\t\t\tlogflags.WriteError(errstr)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn errors.New(errstr)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":41,"sourceCodeEnd":64,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/goversion/compat.go#L41-L64","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Rebuild/reinstall Delve using Go 1.25.0 or later (go install github.com/go-delve/delve/cmd/dlv@latest with a current toolchain)","Update your system's dlv package to a build produced with a recent Go toolchain","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"],"exampleFix":"// before (built with go1.24)\ngo install github.com/go-delve/delve/cmd/dlv@latest\n// after\nexport PATH=/usr/local/go1.25/bin:$PATH\ngo version  # go1.25.0 or later\ngo install github.com/go-delve/delve/cmd/dlv@latest","handlingStrategy":"validation","validationCode":"if !goversion.VersionAfterOrEqual(runtime.Version(), 1, 25) {\n    return errors.New(\"this Delve build cannot parse DWARFv5; rebuild with Go >= 1.25\")\n}\nerr := goversion.Compatible(binPath, false)","typeGuard":null,"tryCatchPattern":"if err := goversion.Compatible(path, false); err != nil {\n    if strings.Contains(err.Error(), \"DWARFv5\") {\n        return fmt.Errorf(\"unsupported target DWARF version: %w\", err)\n    }\n    return err\n}","preventionTips":["Pin Go >= 1.25 in the CI job that builds dlv","Keep dlv updated alongside the Go toolchain used to build target programs","Use warnonly=true only when you can tolerate degraded DWARFv5 support"],"tags":["dwarf","toolchain-version"],"backgroundTag":"go-toolchain-too-old","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}