go-delve/delve · warning

hardware breakpoints not supported

Error message

hardware breakpoints not supported

What it means

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.

Source

Thrown at pkg/proc/native/threads_windows_amd64.go:49

	return winutil.NewAMD64Registers(context, uint64(threadInfo.TebBaseAddress)), nil
}

func (t *nativeThread) setContext(context *winutil.AMD64CONTEXT) error {
	return _SetThreadContext(t.os.hThread, context)
}

func (t *nativeThread) getContext(context *winutil.AMD64CONTEXT) error {
	return _GetThreadContext(t.os.hThread, context)
}

func (t *nativeThread) restoreRegisters(savedRegs proc.Registers) error {
	return t.setContext(savedRegs.(*winutil.AMD64Registers).Context)
}

func (t *nativeThread) withDebugRegisters(f func(*amd64util.DebugRegisters) error) error {
	if !enableHardwareBreakpoints {
		return errors.New("hardware breakpoints not supported")
	}

	context := winutil.NewAMD64CONTEXT()
	context.ContextFlags = _CONTEXT_DEBUG_REGISTERS

	err := t.getContext(context)
	if err != nil {
		return err
	}

	drs := amd64util.NewDebugRegisters(&context.Dr0, &context.Dr1, &context.Dr2, &context.Dr3, &context.Dr6, &context.Dr7)

	err = f(drs)
	if err != nil {
		return err
	}

	if drs.Dirty {

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Build delve with the hardware breakpoint build tag enabled for windows/amd64
  2. Use software breakpoints instead of hardware breakpoints/watchpoints
  3. Switch to a platform whose backend supports hardware breakpoints if watchpoints are required

Example fix

// before (no tag)
go build ./cmd/dlv
// after
go build -tags ebpf,hwbreak ./cmd/dlv // check the tag name used to set enableHardwareBreakpoints
Defensive patterns

Strategy: fallback

Validate before calling

// guard at startup: detect unsupported feature before use
if !hardwareBreakpointsAvailable {
    log.Println("hardware breakpoints unavailable; falling back to software breakpoints")
}

Try / catch

err := bp.EnableHardware()
if err != nil && strings.Contains(err.Error(), "hardware breakpoints not supported") {
    return useSoftwareBreakpointInstead()
}
return err

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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