go-delve/delve · error
ErrNoDebugInfoFound
ErrNoDebugInfoFound
Error message
could not open debug info
What it means
ErrNoDebugInfoFound is returned when Delve can neither read a .debug_info section from the executable nor locate an external debug info file (e.g. via the GNU debuglink or build-id path). Without DWARF debug_info, no types, variables, or source-level breakpoint mapping can be resolved, so loading binary info aborts with this sentinel error.
Source
Thrown at pkg/proc/bininfo.go:134
regabi bool
debugPinnerFn *Function
logger logflags.Logger
eventsFn func(*Event)
cancelDownloadsMu sync.Mutex
cancelDownloads func()
downloadsCtx context.Context
}
var (
// ErrCouldNotDetermineRelocation is an error returned when Delve could not determine the base address of a
// position independent executable.
ErrCouldNotDetermineRelocation = errors.New("could not determine the base address of a PIE")
// ErrNoDebugInfoFound is returned when Delve cannot open the debug_info
// section or find an external debug info file.
ErrNoDebugInfoFound = errors.New("could not open debug info")
)
var (
supportedLinuxArch = map[elf.Machine]bool{
elf.EM_X86_64: true,
elf.EM_AARCH64: true,
elf.EM_386: true,
elf.EM_PPC64: true,
elf.EM_RISCV: true,
elf.EM_LOONGARCH: true,
}
supportedWindowsArch = map[_PEMachine]bool{
_IMAGE_FILE_MACHINE_AMD64: true,
_IMAGE_FILE_MACHINE_ARM64: true,
}
supportedDarwinArch = map[macho.Cpu]bool{View on GitHub (pinned to a23773e6c3)
Solutions
- Rebuild with debug info: go build without -s -w (default go build keeps DWARF)
- Install the matching debug symbols package (e.g. debian -dbgsym) so the debuglink/build-id resolves
- Place the .debug file in one of the searched locations: alongside the binary, ./.debug/, /usr/lib/debug/
- Point Delve at an unstripped copy of the same binary
Example fix
// before CGO_ENABLED=0 go build -ldflags="-s -w" -o app . // stripped, no debug_info // after go build -o app . // DWARF retained
Defensive patterns
Strategy: try-catch
Validate before calling
func hasDebugInfo(path string) bool {
f, err := os.Open(path); if err != nil { return false }
defer f.Close()
ef, err := elf.NewFile(f); if err != nil { return false }
return ef.Section(".debug_info") != nil
} Type guard
func isNoDebugInfo(err error) bool {
return errors.Is(err, proc.ErrNoDebugInfoFound)
} Try / catch
if err := loadErr; err != nil {
if errors.Is(err, proc.ErrNoDebugInfoFound) {
// prompt user to rebuild unstripped or install dbgsym package
}
} Prevention
- Check for .debug_info with readelf -S before debugging
- Never ship/launch binaries built with -ldflags "-s -w" for debugging
- Install matching -dbgsym/-debuginfo packages on the target machine
When it happens
Trigger: Loading a binary built with -ldflags="-s -w" or without any -gcflags debug info; a stripped executable whose separate debug file is missing from the debuglink location.
Common situations: Debugging stripped production binaries; separating debug symbols into -dbg packages but running on a machine where the package isn't installed; Docker scratch images containing only the stripped binary.
Related errors
- could not read debug info (%v) and could not read go symbol
- ErrTypeNotFound
- entry has no location attribute
- malformed executable
- can't open separate debug file:
AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31).
Data as JSON: /api/errors/e311577c85329367.
Report an issue: GitHub.