proc,dwarf/line: support is_stmt and prologue_end flags

Go1.11 uses the is_stmt flag of .debug_line to communicate which
assembly instructions are good places for breakpoints, we should
respect this flag.

These changes were introduced by:
* https://go-review.googlesource.com/c/go/+/102435/

Additionally when setting next breakpoints ignore all PC addresses that
belong to the same line as the one currently under at the cursor. This
matches the behavior of gdb and avoids stopping multiple times at the
heading line of a for statement with go1.11.

Change: https://go-review.googlesource.com/c/go/+/110416 adds the
prologue_end flag to the .debug_line section to communicate the end of
the stack-split prologue. We should use it instead of pattern matching
the disassembly when available.

Fixes #550

type of interfaces
'c7cde8b'.
This commit is contained in:
aarzilli
2018-03-25 10:04:32 +02:00
committed by Derek Parker
parent 77056de757
commit 5155ef047f
23 changed files with 210 additions and 68 deletions

View File

@ -209,7 +209,7 @@ func next(dbp Process, stepInto, inlinedStepOut bool) error {
if selg != nil {
deferPCEntry := selg.DeferPC()
if deferPCEntry != 0 {
_, _, deferfn := dbp.BinInfo().PCToLine(deferPCEntry)
deferfn := dbp.BinInfo().PCToFunc(deferPCEntry)
var err error
deferpc, err = FirstPCAfterPrologue(dbp, deferfn, false)
if err != nil {
@ -231,7 +231,7 @@ func next(dbp Process, stepInto, inlinedStepOut bool) error {
}
// Add breakpoints on all the lines in the current function
pcs, err := topframe.Current.Fn.cu.lineInfo.AllPCsBetween(topframe.Current.Fn.Entry, topframe.Current.Fn.End-1)
pcs, err := topframe.Current.Fn.cu.lineInfo.AllPCsBetween(topframe.Current.Fn.Entry, topframe.Current.Fn.End-1, topframe.Current.File, topframe.Current.Line)
if err != nil {
return err
}