proc: refactor Continue to work on any Process implementation

This commit is contained in:
aarzilli
2017-02-22 09:35:21 +01:00
committed by Derek Parker
parent 510b7db2a7
commit 3dacc25d2e
11 changed files with 326 additions and 284 deletions

View File

@ -412,7 +412,7 @@ func (d *Debugger) Command(command *api.DebuggerCommand) (*api.DebuggerState, er
switch command.Name {
case api.Continue:
log.Print("continuing")
err = d.target.Continue()
err = proc.Continue(d.target)
if err != nil {
if exitedErr, exited := err.(proc.ProcessExitedError); exited {
state := &api.DebuggerState{}
@ -432,16 +432,16 @@ func (d *Debugger) Command(command *api.DebuggerCommand) (*api.DebuggerState, er
case api.Next:
log.Print("nexting")
err = d.target.Next()
err = proc.Next(d.target)
case api.Step:
log.Print("stepping")
err = d.target.Step()
err = proc.Step(d.target)
case api.StepInstruction:
log.Print("single stepping")
err = d.target.StepInstruction()
case api.StepOut:
log.Print("step out")
err = d.target.StepOut()
err = proc.StepOut(d.target)
case api.SwitchThread:
log.Printf("switching to thread %d", command.ThreadID)
err = d.target.SwitchThread(command.ThreadID)
@ -714,7 +714,7 @@ func (d *Debugger) Goroutines() ([]*api.Goroutine, error) {
defer d.processMutex.Unlock()
goroutines := []*api.Goroutine{}
gs, err := d.target.GoroutinesInfo()
gs, err := proc.GoroutinesInfo(d.target)
if err != nil {
return nil, err
}