proc: Remove hardware assisted breakpoints

Only use software breakpoints for now. The reasoning is because it
complicates the code without justification, and is only supported on
Linux. Eventually, once watchpoints are properly implemented we will
revive some of this code. Also, if it is ever necessary to actually set
a hw breakpoint we can revive that code as well.

All future versions of this code will include support for OSX before
being merged back in.
This commit is contained in:
Derek Parker
2015-09-26 13:56:24 -07:00
parent c91ca831b7
commit 466960d95a
7 changed files with 13 additions and 180 deletions

View File

@ -50,11 +50,9 @@ func (thread *Thread) Continue() error {
}
// Check whether we are stopped at a breakpoint, and
// if so, single step over it before continuing.
if bp, ok := thread.dbp.FindBreakpoint(pc); ok {
if !bp.hardware {
if err := thread.Step(); err != nil {
return err
}
if _, ok := thread.dbp.FindBreakpoint(pc); ok {
if err := thread.Step(); err != nil {
return err
}
}
return thread.resume()
@ -78,7 +76,7 @@ func (thread *Thread) Step() (err error) {
return err
}
bp, ok := thread.dbp.Breakpoints[pc]
bp, ok := thread.dbp.FindBreakpoint(pc)
if ok {
// Clear the breakpoint so that we can continue execution.
_, err = bp.Clear(thread)
@ -88,11 +86,7 @@ func (thread *Thread) Step() (err error) {
// Restore breakpoint now that we have passed it.
defer func() {
if bp.hardware {
err = thread.dbp.setHardwareBreakpoint(bp.reg, thread.Id, bp.Addr)
} else {
err = thread.dbp.writeSoftwareBreakpoint(thread, bp.Addr)
}
err = thread.dbp.writeSoftwareBreakpoint(thread, bp.Addr)
}()
}