proc: bugs setting next breakpoints

1. A running goroutine is by definition not parked waiting for a
chan recv
2. The FDE end address is intended to be exclusive, the code
interpreted as inclusive and sometimes ended up setting a breakpoint
on a function other than the current one.
This commit is contained in:
aarzilli
2016-01-31 13:03:53 +01:00
parent 51e87386da
commit b370e20cd5
5 changed files with 88 additions and 7 deletions

View File

@ -882,7 +882,7 @@ func printcontextThread(t *Term, th *api.Thread) {
fn := th.Function
if th.Breakpoint == nil {
fmt.Printf("> %s() %s:%d\n", fn.Name, ShortenFilePath(th.File), th.Line)
fmt.Printf("> %s() %s:%d (PC: %#v)\n", fn.Name, ShortenFilePath(th.File), th.Line, th.PC)
return
}
@ -896,21 +896,23 @@ func printcontextThread(t *Term, th *api.Thread) {
}
if hitCount, ok := th.Breakpoint.HitCount[strconv.Itoa(th.GoroutineID)]; ok {
fmt.Printf("> %s(%s) %s:%d (hits goroutine(%d):%d total:%d)\n",
fmt.Printf("> %s(%s) %s:%d (hits goroutine(%d):%d total:%d) (PC: %#v)\n",
fn.Name,
args,
ShortenFilePath(th.File),
th.Line,
th.GoroutineID,
hitCount,
th.Breakpoint.TotalHitCount)
th.Breakpoint.TotalHitCount,
th.PC)
} else {
fmt.Printf("> %s(%s) %s:%d (hits total:%d)\n",
fmt.Printf("> %s(%s) %s:%d (hits total:%d) (PC: %#v)\n",
fn.Name,
args,
ShortenFilePath(th.File),
th.Line,
th.Breakpoint.TotalHitCount)
th.Breakpoint.TotalHitCount,
th.PC)
}
if th.BreakpointInfo != nil {