{"record":{"id":"10dcf07adc8b43da","repo":"go-delve/delve","slug":"address-required","errorCode":null,"errorMessage":"address required","messagePattern":"address required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/terminal/command.go","lineNumber":1873,"sourceCode":"\n\tparseSpec := func(args []string) error {\n\t\tswitch len(args) {\n\t\tcase 1:\n\t\t\tif len(args[0]) != 0 {\n\t\t\t\tspec = argstr\n\t\t\t} else {\n\t\t\t\t// no arg specified\n\t\t\t\tspec = \"+0\"\n\t\t\t}\n\t\tcase 2:\n\t\t\tif api.ValidBreakpointName(args[0]) == nil {\n\t\t\t\trequestedBp.Name = args[0]\n\t\t\t\tspec = args[1]\n\t\t\t} else {\n\t\t\t\tspec = argstr\n\t\t\t}\n\t\tdefault:\n\t\t\treturn errors.New(\"address required\")\n\t\t}\n\t\treturn nil\n\t}\n\n\targs := config.Split2PartsBySpace(argstr)\n\tif err := parseSpec(args); err != nil {\n\t\treturn nil, err\n\t}\n\n\trequestedBp.Tracepoint = tracepoint\n\tlocs, substSpec, findLocErr := t.client.FindLocation(ctx.Scope, spec, true, t.substitutePathRules())\n\tif findLocErr != nil {\n\t\tr := regexp.MustCompile(`^if | if `)\n\t\tif match := r.FindStringIndex(argstr); match != nil {\n\t\t\trequestedBp.Name = \"\"\n\t\t\trequestedBp.Cond = argstr[match[1]:]\n\t\t\targstr = argstr[:match[0]]\n\t\t\targs = config.Split2PartsBySpace(argstr)","sourceCodeStart":1855,"sourceCodeEnd":1891,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/terminal/command.go#L1855-L1891","documentation":"When setting a breakpoint, the location spec (address, function name, file:line) is required. In parseSpec for the 'break' command, a recognized first token (such as a name option) is followed by a spec in args[1]; if the switch falls through to the default case, no valid address/location was supplied and 'address required' is returned.","triggerScenarios":"Running 'break' with an unrecognized or missing location, or using a flag-form where the spec token is absent (args has a first element handled by a case but args[1] missing/unrecognized, hitting `default: return errors.New(\"address required\")`) at pkg/terminal/command.go:1873.","commonSituations":"Typing 'break' without a location; misordered flags leaving no spec; typo'd location syntax that fails to match any known form; scripts that build the break command from an empty location variable.","solutions":["Supply a valid location: 'break main.main', 'break file.go:42', or 'break *0x401000'","Check the command with 'help break' for accepted location syntaxes","Verify the target function/file exists (use 'breakpoints' or 'functions' to find names)"],"exampleFix":"// before\nbreak\n// after\nbreak main.main","handlingStrategy":"validation","validationCode":"if spec == \"\" {\n\treturn errors.New(\"break requires a location: function, file:line, or *address\")\n}","typeGuard":null,"tryCatchPattern":"if err := breakCmd(...); err != nil && err.Error() == \"address required\" { /* prompt user for a location and retry */ }","preventionTips":["Always supply a location spec to 'break'","Use 'functions'/'breakpoints' to confirm symbol names","Validate script variables feeding location specs are non-empty"],"tags":["terminal","breakpoints","cli-usage","argument-parsing"],"backgroundTag":"missing-argument","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}