From aa71d787aa2a96247128d5395301c7d4a5d2c7a6 Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Thu, 9 Jul 2015 23:13:20 -0500 Subject: [PATCH] Always stop the world after trapWait in resume We do not need to verify a current breakpoint, nor do a redundant check on whether we have been asked to manually halt. Assume trapWait has done its due diligence and stop the world once it returns. --- proc/proc.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/proc/proc.go b/proc/proc.go index 61d4b3a2..465567c4 100644 --- a/proc/proc.go +++ b/proc/proc.go @@ -383,6 +383,9 @@ func (dbp *Process) resume() error { if err != nil { return err } + if err := dbp.Halt(); err != nil { + return err + } if dbp.CurrentThread != thread { dbp.SwitchThread(thread.Id) } @@ -390,7 +393,7 @@ func (dbp *Process) resume() error { if err != nil { return err } - if dbp.CurrentBreakpoint != nil || dbp.halt { + if dbp.CurrentBreakpoint() != nil || dbp.halt { return dbp.Halt() } // Check to see if we hit a runtime.breakpoint @@ -402,10 +405,8 @@ func (dbp *Process) resume() error { return err } } - return dbp.Halt() } - - return fmt.Errorf("unrecognized breakpoint %#v", pc) + return nil } // Single step, will execute a single instruction. -- GitLab