{"record":{"id":"51c149e50728496d","repo":"go-delve/delve","slug":"unsupported-operating-system","errorCode":null,"errorMessage":"unsupported operating system","messagePattern":"unsupported operating system","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"pkg/proc/bininfo.go","lineNumber":918,"sourceCode":"\n\tbi.DebugInfoDirectories = debugInfoDirs\n\n\treturn bi.AddImage(path, entryPoint)\n}\n\nfunc loadBinaryInfo(bi *BinaryInfo, image *Image, path string, entryPoint uint64) error {\n\tvar wg sync.WaitGroup\n\tdefer wg.Wait()\n\n\tswitch bi.GOOS {\n\tcase \"linux\", \"freebsd\":\n\t\treturn loadBinaryInfoElf(bi, image, path, entryPoint, &wg)\n\tcase \"windows\":\n\t\treturn loadBinaryInfoPE(bi, image, path, entryPoint, &wg)\n\tcase \"darwin\":\n\t\treturn loadBinaryInfoMacho(bi, image, path, entryPoint, &wg)\n\t}\n\treturn errors.New(\"unsupported operating system\")\n}\n\n// GStructOffset returns the offset of the G\n// struct in thread local storage.\nfunc (bi *BinaryInfo) GStructOffset(mem MemoryReadWriter) (uint64, error) {\n\toffset := bi.gStructOffset\n\tif bi.gStructOffsetIsPtr {\n\t\t// The G struct offset from the TLS section is a pointer\n\t\t// and the address must be dereferenced to find to actual G struct offset.\n\t\tvar err error\n\t\toffset, err = readUintRaw(mem, offset, int64(bi.Arch.PtrSize()))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\treturn offset, nil\n}\n","sourceCodeStart":900,"sourceCodeEnd":936,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/bininfo.go#L900-L936","documentation":"loadBinaryInfo dispatches on runtime.GOOS (elf/PE/Macho loaders) and returns this error for any operating system it has no loader for. It means Delve's proc package cannot parse executables on the current platform at all, so BinaryInfo loading fails before any debugging can start.","triggerScenarios":"Running a Delve binary (or embedding pkg/proc) on an OS other than linux, windows, or darwin — e.g. freebsd builds where this generic path is reached, or cross-compiled binaries reporting an unexpected runtime.GOOS.","commonSituations":"Embedding delve as a library on an unsupported platform; running an incorrectly cross-compiled dlv binary; exotic GOOS values (plan9, js, illumos).","solutions":["Build/run Delve on a supported OS: linux, windows, or darwin","Check `dlv --version` / the binary's target platform matches the host","For remote debugging, run dlv headless on a supported machine and connect with dlv connect","If adding a new platform, add a loadBinaryInfo<Format> case in loadBinaryInfo plus a port per Documentation/internal/portnotes.md"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"switch runtime.GOOS {\ncase \"linux\", \"windows\", \"darwin\":\n    // supported\ndefault:\n    return fmt.Errorf(\"delve does not support executables on %s\", runtime.GOOS)\n}","typeGuard":null,"tryCatchPattern":"if err := loadErr; err != nil {\n    if err.Error() == \"unsupported operating system\" {\n        // fail fast: cannot debug on this platform; use remote dlv on supported host\n    }\n}","preventionTips":["Verify the dlv binary was built for the host GOOS","Use dlv headless + dlv connect for cross-platform workflows","Consult the porting notes before embedding pkg/proc on new OSes"],"tags":["platform","operating-system","elf","pe","macho"],"backgroundTag":"unsupported-platform","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}