diff --git a/pkg/proc/breakpoints.go b/pkg/proc/breakpoints.go index f98835de..30f811e7 100644 --- a/pkg/proc/breakpoints.go +++ b/pkg/proc/breakpoints.go @@ -72,9 +72,8 @@ func (bp *Breakpoint) String() string { return fmt.Sprintf("Breakpoint %d at %#v %s:%d (%d)", bp.ID, bp.Addr, bp.File, bp.Line, bp.TotalHitCount) } -// Clear this breakpoint appropriately depending on whether it is a -// hardware or software breakpoint. -func (bp *Breakpoint) Clear(thread *Thread) (*Breakpoint, error) { +// ClearBreakpoint clears the specified breakpoint. +func (thread *Thread) ClearBreakpoint(bp *Breakpoint) (*Breakpoint, error) { if _, err := thread.writeMemory(uintptr(bp.Addr), bp.OriginalData); err != nil { return nil, fmt.Errorf("could not clear breakpoint %s", err) } diff --git a/pkg/proc/proc.go b/pkg/proc/proc.go index f01cce1a..041dd1d3 100644 --- a/pkg/proc/proc.go +++ b/pkg/proc/proc.go @@ -295,7 +295,7 @@ func (dbp *Process) ClearBreakpoint(addr uint64) (*Breakpoint, error) { return nil, NoBreakpointError{addr: addr} } - if _, err := bp.Clear(dbp.currentThread); err != nil { + if _, err := dbp.currentThread.ClearBreakpoint(bp); err != nil { return nil, err } diff --git a/pkg/proc/threads.go b/pkg/proc/threads.go index ccf1594a..1ddf8407 100644 --- a/pkg/proc/threads.go +++ b/pkg/proc/threads.go @@ -83,7 +83,7 @@ func (thread *Thread) StepInstruction() (err error) { bp, ok := thread.dbp.FindBreakpoint(pc) if ok { // Clear the breakpoint so that we can continue execution. - _, err = bp.Clear(thread) + _, err = thread.ClearBreakpoint(bp) if err != nil { return err }