{"record":{"id":"69f562eb84007b52","repo":"go-delve/delve","slug":"no-breakpoint-with-id-d","errorCode":null,"errorMessage":"no breakpoint with ID %d","messagePattern":"no breakpoint with ID (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/debugger/debugger.go","lineNumber":865,"sourceCode":"}\n\nfunc (d *Debugger) CreateEBPFTracepoint(fnName string) error {\n\td.targetMutex.Lock()\n\tdefer d.targetMutex.Unlock()\n\tif len(d.target.Targets()) != 1 {\n\t\treturn ErrNotImplementedWithMultitarget\n\t}\n\tp := d.target.Selected\n\treturn p.SetEBPFTracepoint(fnName)\n}\n\n// amendBreakpoint will update the breakpoint with the matching ID.\n// It also enables or disables the breakpoint.\n// We can consume this function to avoid locking a goroutine.\nfunc (d *Debugger) amendBreakpoint(amend *api.Breakpoint) error {\n\toriginal := d.target.LogicalBreakpoints[amend.ID]\n\tif original == nil {\n\t\treturn fmt.Errorf(\"no breakpoint with ID %d\", amend.ID)\n\t}\n\tif d.isWatchpoint(original) && amend.Disabled {\n\t\treturn errors.New(\"can not disable watchpoints\")\n\t}\n\terr := d.copyLogicalBreakpointInfo(original, amend)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = d.target.SetBreakpointEnabled(original, !amend.Disabled)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (d *Debugger) isWatchpoint(lbp *proc.LogicalBreakpoint) bool {\n\tt := proc.ValidTargets{Group: d.target}","sourceCodeStart":847,"sourceCodeEnd":883,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/debugger/debugger.go#L847-L883","documentation":"amendBreakpoint looks up d.target.LogicalBreakpoints[amend.ID]; if no logical breakpoint with that ID exists, it returns this error. AmendBreakpoint is used by clients to update (enable/disable, change condition, hitcount) an existing breakpoint, so it requires a previously created breakpoint ID.","triggerScenarios":"Calling Debugger.AmendBreakpoint (or RPC2/DAP equivalent) with an api.Breakpoint whose ID was never assigned by delve, an ID from a previous session, ID 0, or an ID of a breakpoint already cleared.","commonSituations":"IDE state out of sync after a restart that discarded breakpoints; client caching stale breakpoint IDs across `clear` or restart; constructing a Breakpoint manually with a guessed ID; race where another client deleted the breakpoint.","solutions":["List current breakpoints (ListBreakpoints / `breakpoints` command) and use a valid ID.","Create the breakpoint first via SetBreakpoint/ClearBreakpoint flow, then amend its returned ID.","Re-sync client breakpoint state after restart; discarded breakpoints cannot be amended.","Guard against amend.ID == 0 — delve-assigned IDs start at 1."],"exampleFix":"// before\nbp := &api.Breakpoint{ID: 42, Disabled: true}\nd.AmendBreakpoint(bp)\n// after\nbps, _ := d.ListBreakpoints(false)\nif len(bps) > 0 {\n    bp := &api.Breakpoint{ID: bps[0].ID, Disabled: true}\n    d.AmendBreakpoint(bp)\n}","handlingStrategy":"validation","validationCode":"bps, err := d.ListBreakpoints(false)\nif err != nil {\n    return err\n}\nknown := map[int]bool{}\nfor _, bp := range bps {\n    known[bp.ID] = true\n}\nif !known[amend.ID] {\n    return fmt.Errorf(\"breakpoint %d not live; refresh state\", amend.ID)\n}","typeGuard":null,"tryCatchPattern":"if err := d.AmendBreakpoint(bp); err != nil && strings.Contains(err.Error(), \"no breakpoint with ID\") {\n    // refresh local breakpoint cache and re-resolve the ID\n    bps, _ := d.ListBreakpoints(false)\n    _ = bps\n}","preventionTips":["Always obtain IDs from SetBreakpoint/ListBreakpoints, never invent them.","Refresh breakpoint state after restart or clear operations.","Treat ID 0 as 'not yet created' in client code."],"tags":["breakpoints","state-sync","api-misuse"],"backgroundTag":"breakpoint-not-found","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}