{"record":{"id":"aaf35fc91b57e2f9","repo":"go-delve/delve","slug":"could-not-read-debug-info-v-and-could-not-read","errorCode":null,"errorMessage":"could not read debug info (%v) and could not read go symbol table (%v)","messagePattern":"could not read debug info \\((.+?)\\) and could not read go symbol table \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/bininfo.go","lineNumber":1754,"sourceCode":"\t}\n\n\tdwarfFile := elfFile\n\n\tbi.loadBuildID(image, elfFile)\n\tvar debugInfoBytes []byte\n\tvar dwerr error\n\timage.dwarf, dwerr = elfFile.DWARF()\n\tif dwerr != nil {\n\t\tvar sepFile *os.File\n\t\tvar serr error\n\t\tsepFile, dwarfFile, serr = bi.openSeparateDebugInfo(image, elfFile, bi.DebugInfoDirectories)\n\t\tif serr != nil {\n\t\t\tif len(bi.Images) <= 1 {\n\t\t\t\tfmt.Fprintln(os.Stderr, \"Warning: no debug info found, some functionality will be missing such as stack traces and variable evaluation.\")\n\t\t\t}\n\t\t\terr := loadBinaryInfoGoRuntimeElf(bi, image, path, elfFile)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"could not read debug info (%v) and could not read go symbol table (%v)\", dwerr, err)\n\t\t\t}\n\t\t\timage.IsGo = true\n\t\t\treturn nil\n\t\t}\n\t\timage.sepDebugCloser = sepFile\n\t\timage.dwarf, err = dwarfFile.DWARF()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tdebugInfoBytes, err = godwarf.GetDebugSectionElf(dwarfFile, \"info\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\timage.dwarfReader = image.dwarf.Reader()\n","sourceCodeStart":1736,"sourceCodeEnd":1772,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/bininfo.go#L1736-L1772","documentation":"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.","triggerScenarios":"Loading a binary (stripped, non-Go, or corrupted ELF) whose .debug_* sections are missing/unparseable AND whose gopclntab lookup fails.","commonSituations":"Debugging a fully stripped binary; pointing dlv at a non-Go binary; wrong-architecture binary; corrupted download of the executable.","solutions":["Rebuild the Go binary without -s -w / -ldflags stripping (keep DWARF).","Verify the binary matches the target architecture and OS.","Check the binary path is correct and the file is not truncated.","If the binary is not Go, use appropriate tooling rather than Delve."],"exampleFix":"// before\ngo build -ldflags=\"-s -w\" -o app ./cmd/app\ndlv exec ./app\n// after\ngo build -o app ./cmd/app\ndlv exec ./app","handlingStrategy":"validation","validationCode":"f, err := elf.Open(path)\nif err != nil { return err }\nif f.Section(\".debug_info\") == nil {\n    fmt.Println(\"warning: binary has no DWARF; rebuild without -s -w\")\n}","typeGuard":null,"tryCatchPattern":"tgt, err := dbg.Attach(pid, path)\nif err != nil && strings.Contains(err.Error(), \"could not read debug info\") {\n    // rebuild binary with DWARF and retry\n}","preventionTips":["Build with DWARF: avoid -ldflags=\"-s -w\" and strip tools.","Verify the binary matches the target OS/arch.","Sanity-check binaries with 'file' and 'readelf -S' before debugging."],"tags":["go","dwarf","elf","binary-info","stripped-binary"],"backgroundTag":"missing-debug-info","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}