go-delve/delve · error

could not read debug info (%v) and could not read go symbol

Error message

could not read debug info (%v) and could not read go symbol table (%v)

What it means

When loading an ELF binary's image, Delve first tries DWARF debug info; if that fails (dwerr) it falls back to Go's runtime symbol table via loadBinaryInfoGoRuntimeElf. If both fail, it reports a combined error embedding both underlying causes, meaning the binary has neither debug info nor readable Go pclntab symbols.

Source

Thrown at pkg/proc/bininfo.go:1754

	}

	dwarfFile := elfFile

	bi.loadBuildID(image, elfFile)
	var debugInfoBytes []byte
	var dwerr error
	image.dwarf, dwerr = elfFile.DWARF()
	if dwerr != nil {
		var sepFile *os.File
		var serr error
		sepFile, dwarfFile, serr = bi.openSeparateDebugInfo(image, elfFile, bi.DebugInfoDirectories)
		if serr != nil {
			if len(bi.Images) <= 1 {
				fmt.Fprintln(os.Stderr, "Warning: no debug info found, some functionality will be missing such as stack traces and variable evaluation.")
			}
			err := loadBinaryInfoGoRuntimeElf(bi, image, path, elfFile)
			if err != nil {
				return fmt.Errorf("could not read debug info (%v) and could not read go symbol table (%v)", dwerr, err)
			}
			image.IsGo = true
			return nil
		}
		image.sepDebugCloser = sepFile
		image.dwarf, err = dwarfFile.DWARF()
		if err != nil {
			return err
		}
	}

	debugInfoBytes, err = godwarf.GetDebugSectionElf(dwarfFile, "info")
	if err != nil {
		return err
	}

	image.dwarfReader = image.dwarf.Reader()

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Rebuild the Go binary without -s -w / -ldflags stripping (keep DWARF).
  2. Verify the binary matches the target architecture and OS.
  3. Check the binary path is correct and the file is not truncated.
  4. If the binary is not Go, use appropriate tooling rather than Delve.

Example fix

// before
go build -ldflags="-s -w" -o app ./cmd/app
dlv exec ./app
// after
go build -o app ./cmd/app
dlv exec ./app
Defensive patterns

Strategy: validation

Validate before calling

f, err := elf.Open(path)
if err != nil { return err }
if f.Section(".debug_info") == nil {
    fmt.Println("warning: binary has no DWARF; rebuild without -s -w")
}

Try / catch

tgt, err := dbg.Attach(pid, path)
if err != nil && strings.Contains(err.Error(), "could not read debug info") {
    // rebuild binary with DWARF and retry
}

Prevention

When it happens

Trigger: Loading a binary (stripped, non-Go, or corrupted ELF) whose .debug_* sections are missing/unparseable AND whose gopclntab lookup fails.

Common situations: Debugging a fully stripped binary; pointing dlv at a non-Go binary; wrong-architecture binary; corrupted download of the executable.

Related errors


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