Check thread.CurrentBreakpoint instead of PC lookup

This commit is contained in:
Derek Parker 2015-06-27 12:10:04 -05:00
parent 8d4a73f7dd
commit 70aff5612c

@ -42,16 +42,13 @@ type Location struct {
// first and then resume execution. Thread will continue until
// it hits a breakpoint or is signaled.
func (thread *Thread) Continue() error {
pc, err := thread.PC()
if err != nil {
return err
}
// Check whether we are stopped at a breakpoint, and
// if so, single step over it before continuing.
if _, ok := thread.dbp.Breakpoints[pc]; ok {
if err := thread.Step(); err != nil {
return err
if thread.CurrentBreakpoint != nil {
if !thread.CurrentBreakpoint.hardware {
if err := thread.Step(); err != nil {
return err
}
}
}
return thread.resume()