Add command to print every thread status

This commit is contained in:
Derek Parker
2014-11-07 23:55:25 -06:00
parent 6b2ee09163
commit 665ff49181
3 changed files with 25 additions and 0 deletions

View File

@ -48,6 +48,16 @@ func (thread *ThreadContext) CurrentPC() (uint64, error) {
return regs.PC(), nil
}
func (thread *ThreadContext) PrintInfo() error {
pc, err := thread.CurrentPC()
if err != nil {
return err
}
f, l, fn := thread.Process.GoSymTable.PCToLine(pc)
fmt.Printf("Thread %d at %#v %s:%d %s\n", thread.Id, pc, f, l, fn.Name)
return nil
}
// Sets a software breakpoint at addr, and stores it in the process wide
// break point table. Setting a break point must be thread specific due to
// ptrace actions needing the thread to be in a signal-delivery-stop in order