go-delve/delve · error

address required

Error message

address required

What it means

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.

Source

Thrown at pkg/terminal/command.go:1873

	parseSpec := func(args []string) error {
		switch len(args) {
		case 1:
			if len(args[0]) != 0 {
				spec = argstr
			} else {
				// no arg specified
				spec = "+0"
			}
		case 2:
			if api.ValidBreakpointName(args[0]) == nil {
				requestedBp.Name = args[0]
				spec = args[1]
			} else {
				spec = argstr
			}
		default:
			return errors.New("address required")
		}
		return nil
	}

	args := config.Split2PartsBySpace(argstr)
	if err := parseSpec(args); err != nil {
		return nil, err
	}

	requestedBp.Tracepoint = tracepoint
	locs, substSpec, findLocErr := t.client.FindLocation(ctx.Scope, spec, true, t.substitutePathRules())
	if findLocErr != nil {
		r := regexp.MustCompile(`^if | if `)
		if match := r.FindStringIndex(argstr); match != nil {
			requestedBp.Name = ""
			requestedBp.Cond = argstr[match[1]:]
			argstr = argstr[:match[0]]
			args = config.Split2PartsBySpace(argstr)

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Supply a valid location: 'break main.main', 'break file.go:42', or 'break *0x401000'
  2. Check the command with 'help break' for accepted location syntaxes
  3. Verify the target function/file exists (use 'breakpoints' or 'functions' to find names)

Example fix

// before
break
// after
break main.main
Defensive patterns

Strategy: validation

Validate before calling

if spec == "" {
	return errors.New("break requires a location: function, file:line, or *address")
}

Try / catch

if err := breakCmd(...); err != nil && err.Error() == "address required" { /* prompt user for a location and retry */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31). Data as JSON: /api/errors/10dcf07adc8b43da. Report an issue: GitHub.