{"record":{"id":"6722c5ab10961a63","repo":"go-delve/delve","slug":"hardware-breakpoints-not-supported-6722c5","errorCode":null,"errorMessage":"hardware breakpoints not supported","messagePattern":"hardware breakpoints not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/proc/native/threads_windows_amd64.go","lineNumber":49,"sourceCode":"\n\treturn winutil.NewAMD64Registers(context, uint64(threadInfo.TebBaseAddress)), nil\n}\n\nfunc (t *nativeThread) setContext(context *winutil.AMD64CONTEXT) error {\n\treturn _SetThreadContext(t.os.hThread, context)\n}\n\nfunc (t *nativeThread) getContext(context *winutil.AMD64CONTEXT) error {\n\treturn _GetThreadContext(t.os.hThread, context)\n}\n\nfunc (t *nativeThread) restoreRegisters(savedRegs proc.Registers) error {\n\treturn t.setContext(savedRegs.(*winutil.AMD64Registers).Context)\n}\n\nfunc (t *nativeThread) withDebugRegisters(f func(*amd64util.DebugRegisters) error) error {\n\tif !enableHardwareBreakpoints {\n\t\treturn errors.New(\"hardware breakpoints not supported\")\n\t}\n\n\tcontext := winutil.NewAMD64CONTEXT()\n\tcontext.ContextFlags = _CONTEXT_DEBUG_REGISTERS\n\n\terr := t.getContext(context)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdrs := amd64util.NewDebugRegisters(&context.Dr0, &context.Dr1, &context.Dr2, &context.Dr3, &context.Dr6, &context.Dr7)\n\n\terr = f(drs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif drs.Dirty {","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/native/threads_windows_amd64.go#L31-L67","documentation":"withDebugRegisters refuses to operate when hardware breakpoint support is disabled at compile time. On Windows/amd64, manipulating DR0-DR7 debug registers requires the enableHardwareBreakpoints build flag; without it Delve returns this error instead of silently skipping hardware breakpoint operations.","triggerScenarios":"Setting, clearing, or restoring hardware breakpoints/watchpoints on a Windows amd64 target in a binary built without the hardware-breakpoint build tag, via any breakpoint API that routes through withDebugRegisters.","commonSituations":"Users trying to use watchpoints (data breakpoints) on Windows with a standard delve build; CI builds without the optional tag; assuming feature parity with the Linux backend.","solutions":["Build delve with the hardware breakpoint build tag enabled for windows/amd64","Use software breakpoints instead of hardware breakpoints/watchpoints","Switch to a platform whose backend supports hardware breakpoints if watchpoints are required"],"exampleFix":"// before (no tag)\ngo build ./cmd/dlv\n// after\ngo build -tags ebpf,hwbreak ./cmd/dlv // check the tag name used to set enableHardwareBreakpoints","handlingStrategy":"fallback","validationCode":"// guard at startup: detect unsupported feature before use\nif !hardwareBreakpointsAvailable {\n    log.Println(\"hardware breakpoints unavailable; falling back to software breakpoints\")\n}","typeGuard":null,"tryCatchPattern":"err := bp.EnableHardware()\nif err != nil && strings.Contains(err.Error(), \"hardware breakpoints not supported\") {\n    return useSoftwareBreakpointInstead()\n}\nreturn err","preventionTips":["Build delve with the appropriate tags for windows/amd64 hardware breakpoints","Do not assume watchpoint support on Windows; check platform feature matrix first","Provide software-breakpoint fallbacks in tooling built on delve"],"tags":["windows","amd64","hardware-breakpoints"],"backgroundTag":"feature-not-supported","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}