{"record":{"id":"1fb48400f216e83e","repo":"go-delve/delve","slug":"no-breakpoint-at-address-x","errorCode":null,"errorMessage":"no breakpoint at address %#x","messagePattern":"no breakpoint at address %#x","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/debugger/debugger.go","lineNumber":938,"sourceCode":"\tlbp.CustomCommands = requested.CustomCommands\n\tlbp.UserData = requested.UserData\n\tlbp.RootFuncName = requested.RootFuncName\n\tlbp.TraceFollowCalls = requested.TraceFollowCalls\n\n\treturn d.target.ChangeBreakpointCondition(lbp, requested.Cond, requested.HitCond, requested.HitCondPerG)\n}\n\n// ClearBreakpoint clears a breakpoint.\nfunc (d *Debugger) ClearBreakpoint(requestedBp *api.Breakpoint) (*api.Breakpoint, error) {\n\td.targetMutex.Lock()\n\tdefer d.targetMutex.Unlock()\n\tif requestedBp.ID == 0 {\n\t\tif len(d.target.Targets()) != 1 {\n\t\t\treturn nil, ErrNotImplementedWithMultitarget\n\t\t}\n\t\tbp := d.target.Selected.Breakpoints().M[requestedBp.Addr]\n\t\tif bp == nil {\n\t\t\treturn nil, fmt.Errorf(\"no breakpoint at address %#x\", requestedBp.Addr)\n\t\t}\n\t\trequestedBp.ID = bp.LogicalID()\n\t}\n\n\tlbp := d.target.LogicalBreakpoints[requestedBp.ID]\n\tif lbp == nil {\n\t\treturn nil, fmt.Errorf(\"no breakpoint with ID %d\", requestedBp.ID)\n\t}\n\tclearedBp := d.convertBreakpoint(lbp)\n\n\terr := d.target.SetBreakpointEnabled(lbp, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdelete(d.target.LogicalBreakpoints, requestedBp.ID)\n\n\td.log.Infof(\"cleared breakpoint: %#v\", clearedBp)","sourceCodeStart":920,"sourceCodeEnd":956,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/debugger/debugger.go#L920-L956","documentation":"ClearBreakpoint normally works by breakpoint ID, but legacy clients pass a breakpoint with only an address (ID == 0). In that case delve looks up a physical breakpoint at that address in the selected target. If no breakpoint is set at that exact address, it returns \"no breakpoint at address %#x\". It also fails with ErrNotImplementedWithMultitarget when multiple targets exist.","triggerScenarios":"ClearBreakpoint called with api.Breakpoint{Addr: X} (ID 0) where no breakpoint exists at X; address computed from a stale binary layout; calling after the breakpoint was already cleared; multitarget session with ID-less clear request.","commonSituations":"Older clients or scripts that clear by address; binary rebuilt between setting and clearing so addresses shifted; double-clear after an error; specifying a line whose resolved address never had a breakpoint.","solutions":["Use the breakpoint's numeric ID instead of the address (clear by ID).","Re-read the breakpoint list to get the current address/ID before clearing.","Avoid clearing by address in multi-process (follow-exec) sessions; it is not implemented there.","Check the address matches exactly the breakpoint's Addr from ListBreakpoints (function entry offsets matter)."],"exampleFix":"// before\nbp, err := d.ClearBreakpoint(&api.Breakpoint{Addr: 0x401000})\n// after\nbps, _ := d.ListBreakpoints(false)\nbp, err := d.ClearBreakpoint(&api.Breakpoint{ID: bps[0].ID})","handlingStrategy":"validation","validationCode":"bps, _ := d.ListBreakpoints(false)\nfound := false\nfor _, bp := range bps {\n    if bp.Addr == addr {\n        found = true\n        break\n    }\n}\nif !found {\n    return fmt.Errorf(\"no breakpoint at %#x; nothing to clear\", addr)\n}","typeGuard":null,"tryCatchPattern":"_, err := d.ClearBreakpoint(&api.Breakpoint{Addr: addr})\nif err != nil && strings.Contains(err.Error(), \"no breakpoint at address\") {\n    // already cleared or stale address; resync\n    bps, _ := d.ListBreakpoints(false)\n    _ = bps\n}","preventionTips":["Prefer clearing by ID over address in new code.","Recompute addresses after any rebuild of the binary.","Skip address-based clearing when multiple targets (follow-exec) may exist."],"tags":["breakpoints","addresses","legacy-api"],"backgroundTag":"breakpoint-not-found","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}