go-delve/delve · error

too many arguments to "config showPprofLabels"

Error message

too many arguments to "config showPprofLabels"

What it means

The DAP `config showPprofLabels` setting accepts either `-clear`, `-list`, a single label to remove (if present), or one label to add. configureSetShowPprofLabels returns this error when more than the allowed number of label arguments is supplied.

Source

Thrown at service/dap/config.go:128

	switch len(argv) {
	case 0:
		// do nothing, let caller show the current list of labels
		return nil
	case 1:
		if delete {
			for i := range args.ShowPprofLabels {
				if args.ShowPprofLabels[i] == argv[0] {
					copy(args.ShowPprofLabels[i:], args.ShowPprofLabels[i+1:])
					args.ShowPprofLabels = args.ShowPprofLabels[:len(args.ShowPprofLabels)-1]
					return nil
				}
			}
			return fmt.Errorf("could not find label %q", argv[0])
		} else {
			args.ShowPprofLabels = append(args.ShowPprofLabels, argv[0])
		}
	default:
		return errors.New("too many arguments to \"config showPprofLabels\"")
	}
	return nil
}

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Add labels one per command invocation
  2. Check the label list with `config showPprofLabels -list` before editing
  3. Use `config showPprofLabels -clear` to reset, then add labels individually

Example fix

// before
config showPprofLabels=cpu heap
// after
config showPprofLabels=cpu
config showPprofLabels=heap
Defensive patterns

Strategy: validation

Validate before calling

if len(labels) > 1 {
	for _, l := range labels { send("config showPprofLabels=" + l) }
	return
}

Prevention

When it happens

Trigger: `config showPprofLabels=<a> <b>` — two or more labels in one command; pasting a space-separated list of labels intending to add them all at once.

Common situations: Users familiar with comma/space list settings trying to set multiple labels in one go; automation scripts joining a label slice with spaces; labels containing spaces splitting into multiple tokens.

Related errors


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