{"record":{"id":"088002785f12cce1","repo":"go-delve/delve","slug":"command-not-available-088002","errorCode":null,"errorMessage":"command not available","messagePattern":"command not available","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/dap/command.go","lineNumber":128,"sourceCode":"\n    x -fmt hex -count 20 -size 1 0xc00008af38\n    x -fmt hex -count 20 -size 1 -x 0xc00008af38 + 8\n    x -fmt hex -count 20 -size 1 -x &myVar\n    x -fmt hex -count 20 -size 1 -x myPtrVar`\n)\n\n// debugCommands returns a list of commands with default commands defined.\nfunc debugCommands(s *Session) []command {\n\treturn []command{\n\t\t{aliases: []string{\"help\", \"h\"}, cmdFn: s.helpMessage, helpMsg: msgHelp},\n\t\t{aliases: []string{\"config\"}, cmdFn: s.evaluateConfig, helpMsg: msgConfig},\n\t\t{aliases: []string{\"sources\", \"s\"}, cmdFn: s.sources, helpMsg: msgSources},\n\t\t{aliases: []string{\"target\"}, cmdFn: s.targetCmd, helpMsg: msgTarget},\n\t\t{aliases: []string{\"examinemem\", \"x\"}, cmdFn: s.examineMemory, helpMsg: msgExamineMemory},\n\t}\n}\n\nvar errNoCmd = errors.New(\"command not available\")\n\nfunc (s *Session) helpMessage(_, _ int, args string) (string, error) {\n\tvar buf bytes.Buffer\n\tif args != \"\" {\n\t\tfor _, cmd := range debugCommands(s) {\n\t\t\tif slices.Contains(cmd.aliases, args) {\n\t\t\t\treturn cmd.helpMsg, nil\n\t\t\t}\n\t\t}\n\t\treturn \"\", errNoCmd\n\t}\n\n\tfmt.Fprintln(&buf, \"The following commands are available:\")\n\n\tfor _, cmd := range debugCommands(s) {\n\t\th := cmd.helpMsg\n\t\tif idx := strings.Index(h, \"\\n\"); idx >= 0 {\n\t\t\th = h[:idx]","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/dap/command.go#L110-L146","documentation":"errNoCmd is the sentinel error for the DAP-side REPL command dispatcher: it is returned when the requested command alias does not match any entry in debugCommands(). noCmdAvailable, help, delveCmd, and helpMessage all surface it.","triggerScenarios":"Sending an unknown command name through the DAP REPL evaluation (e.g. a typo like `breakpoin` or a CLI-only command not present in the DAP command set), or `help <unknown-topic>`.","commonSituations":"Clients reusing terminal-frontend command names that the DAP layer does not implement; version drift where a command was renamed/removed; typos in automation scripts driving the console.","solutions":["Run `help` (or `help <cmd>`) through the DAP REPL to list available commands","Check spelling/aliases of the command (e.g. `examinemem` or `x`, `sources` or `s`)","Update client automation to commands supported in the current Delve version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"knownCmds := map[string]bool{\"x\": true, \"examinemem\": true, \"sources\": true, \"target\": true /* ... */}\nif !knownCmds[cmd] { /* show help instead of dispatching */ }","typeGuard":null,"tryCatchPattern":"out, err := evalREPL(ctx, cmd)\nif err != nil && strings.Contains(err.Error(), \"command not available\") {\n\tout, _ = evalREPL(ctx, \"help\")\n}","preventionTips":["Fetch the command list via `help` at session start","Whitelist commands in automation clients","Pin client automation to a Delve version"],"tags":["dap","repl","command-dispatch"],"backgroundTag":"unknown-command","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}