go-delve/delve · error
filter not supported on breakpoint
Error message
filter not supported on breakpoint
What it means
When the 'args' command is used inside an 'on <bp>' breakpoint context, it only records a load configuration on the breakpoint; per-variable name filtering (the -r regex option parsed by parseVarArguments) is not supported in that mode, so Delve returns this error when a non-empty filter is detected.
Source
Thrown at pkg/terminal/command.go:2353
return t.printSortedStrings(t.client.ListTypes(args))
}
func parseVarArguments(args string, t *Term) (filter string, cfg api.LoadConfig) {
if v := config.Split2PartsBySpace(args); len(v) >= 1 && v[0] == "-v" {
if len(v) == 2 {
return v[1], t.loadConfig()
} else {
return "", t.loadConfig()
}
}
return args, ShortLoadConfig
}
func args(t *Term, ctx callContext, args string) error {
filter, cfg := parseVarArguments(args, t)
if ctx.Prefix == onPrefix {
if filter != "" {
return errors.New("filter not supported on breakpoint")
}
ctx.Breakpoint.LoadArgs = &cfg
return nil
}
vars, err := t.client.ListFunctionArgs(ctx.Scope, cfg)
if err != nil {
return err
}
return t.printFilteredVariables("args", vars, filter, cfg)
}
func locals(t *Term, ctx callContext, args string) error {
filter, cfg := parseVarArguments(args, t)
if ctx.Prefix == onPrefix {
if filter != "" {
return errors.New("filter not supported on breakpoint")
}
ctx.Breakpoint.LoadLocals = &cfgView on GitHub (pinned to a23773e6c3)
Solutions
- Drop the filter flag: 'on <bp> args' optionally with other load-config flags.
- Apply the regex filter when you run args normally at a stopped point instead.
- Use 'on <bp> print <expr>' for per-expression output at breakpoint hits.
Example fix
// before (dlv) on 1 args -r user.* // after (dlv) on 1 args
Defensive patterns
Strategy: validation
Validate before calling
// before recording breakpoint commands in 'on' context
func validateOnArgsCmd(ctxPrefix, args string) error {
if ctxPrefix == "on" && strings.Contains(args, "-r") {
return errors.New("filter (-r) not allowed with 'on <bp> args'")
}
return nil
} Try / catch
if err := cmd.Args(term, ctx, args); err != nil {
if err.Error() == "filter not supported on breakpoint" {
// retry without the filter flag
return cmd.Args(term, ctx, stripFilterFlags(args))
}
return err
} Prevention
- Do not use -r/filter flags in 'on <bp>' blocks
- Apply regex filtering only to interactive 'args' at a stop point
- Use 'on <bp> print <expr>' for selective output at hits
When it happens
Trigger: Running 'on <bp> args -r <pattern>' (any filter flag parsed by parseVarArguments yielding filter != "") with ctx.Prefix == onPrefix in args() (pkg/terminal/command.go).
Common situations: Users copying their usual 'args -r foo.*' invocation into an 'on' block without realizing filters only apply to live listing, not breakpoint-configured argument loading.
Related errors
- too many arguments to trace
- argument of deferred must be a number greater than 0 (use 's
- too many arguments to restart
- Invalid next count
- missing filename after -save flag
AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31).
Data as JSON: /api/errors/894f7a0188ba3ae4.
Report an issue: GitHub.