Modify Step() to not print, delegate to command

This commit is contained in:
Derek Parker
2014-05-27 10:51:38 -05:00
parent 821313d6cf
commit 73ddaa2653
2 changed files with 24 additions and 6 deletions

View File

@ -135,7 +135,11 @@ func (dbp *DebuggedProcess) Step() error {
bp, ok := dbp.PCtoBP(regs.PC())
if ok {
dbp.restoreInstruction(regs.PC(), bp.OriginalData)
err = dbp.restoreInstruction(regs.PC(), bp.OriginalData)
if err != nil {
return err
}
}
err = dbp.handleResult(syscall.PtraceSingleStep(dbp.Pid))
@ -143,11 +147,9 @@ func (dbp *DebuggedProcess) Step() error {
return fmt.Errorf("step failed: ", err.Error())
}
f, l, fn := dbp.GoSymTable.PCToLine(regs.PC())
fmt.Printf("Stopped at: %s %s:%d\n", fn.Name, f, l)
// Restore breakpoint
if ok {
_, err = dbp.Break(bp.FunctionName)
_, err := dbp.Break(bp.FunctionName)
if err != nil {
return err
}