{"record":{"id":"dedb5957b7417015","repo":"go-delve/delve","slug":"lldb-backend-not-supported-on-windows","errorCode":null,"errorMessage":"lldb backend not supported on Windows","messagePattern":"lldb backend not supported on Windows","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/gdbserial/gdbserver.go","lineNumber":443,"sourceCode":"}\n\nfunc canUnmaskSignals(debugServerExecutable string) bool {\n\tcheckCanUnmaskSignalsOnce.Do(func() {\n\t\tbuf, _ := exec.Command(debugServerExecutable, \"--unmask-signals\").CombinedOutput()\n\t\tcanUnmaskSignalsCached = !strings.Contains(string(buf), \"unrecognized option\")\n\t})\n\treturn canUnmaskSignalsCached\n}\n\n// commandLogger is a wrapper around the exec.Command() function to log the arguments prior to\n// starting the process\nfunc commandLogger(binary string, arguments ...string) *exec.Cmd {\n\tlogflags.GdbWireLogger().Debugf(\"executing %s %v\", binary, arguments)\n\treturn exec.Command(binary, arguments...)\n}\n\n// ErrUnsupportedOS is returned when trying to use the lldb backend on Windows.\nvar ErrUnsupportedOS = errors.New(\"lldb backend not supported on Windows\")\n\nfunc getLdEnvVars() []string {\n\tvar result []string\n\n\tenviron := os.Environ()\n\tfor i := range environ {\n\t\tif strings.HasPrefix(environ[i], \"LD_\") ||\n\t\t\tstrings.HasPrefix(environ[i], \"DYLD_\") {\n\t\t\tresult = append(result, \"-e\", environ[i])\n\t\t}\n\t}\n\n\treturn result\n}\n\n// LLDBLaunch starts an instance of lldb-server and connects to it, asking\n// it to launch the specified target program with the specified arguments\n// (cmd) on the specified directory wd.","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/gdbserial/gdbserver.go#L425-L461","documentation":"ErrUnsupportedOS is a sentinel error returned by LLDBLaunch and LLDBAttach in the gdbserial backend when the host OS is Windows. The LLDB-based backend relies on lldb-server, which is not supported on Windows, so any attempt to use the lldb backend there fails immediately with this error.","triggerScenarios":"Calling gdbserial.LLDBLaunch or gdbserial.LLDBAttach on a Windows host (i.e. selecting the lldb backend, e.g. via 'dlv exec --backend=lldb' or debugging a binary compiled with cgo/lldb config).","commonSituations":"Windows users running 'dlv debug --backend=lldb', IDE configs defaulting to the lldb backend, or following documentation for macOS/Linux that does not apply on Windows.","solutions":["Use the native backend instead: dlv debug/exec/attach --backend=native (the default on Windows).","Remove explicit --backend=lldb from scripts/IDE launch configs on Windows.","If you need LLDB specifically, run delve inside WSL or a Linux/macOS environment.","Guard code with runtime.GOOS checks before choosing the backend."],"exampleFix":"// before\ndlv exec ./app.exe --backend=lldb\n// after\ndlv exec ./app.exe --backend=native","handlingStrategy":"validation","validationCode":"if runtime.GOOS == \"windows\" && backend == \"lldb\" {\n    return errors.New(\"lldb backend is unsupported on Windows; use native\")\n}","typeGuard":null,"tryCatchPattern":"if errors.Is(err, gdbserial.ErrUnsupportedOS) {\n    // fall back to native backend\n}","preventionTips":["Use --backend=native on Windows (it is the default).","Remove hardcoded --backend=lldb from cross-platform scripts and IDE configs.","Gate backend choice on runtime.GOOS."],"tags":["windows","lldb","backend","platform-support"],"backgroundTag":"unsupported-os-backend","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}