提交 5722de6d 编写于 作者: D Derek Parker

Improve Dwarf frame establishing function

Remove reliance on order of dwarf instructions.
上级 94453b46
...@@ -157,12 +157,14 @@ func (frame *FrameContext) ExecuteUntilPC(instructions []byte) { ...@@ -157,12 +157,14 @@ func (frame *FrameContext) ExecuteUntilPC(instructions []byte) {
// We only need to execute the instructions until // We only need to execute the instructions until
// ctx.loc > ctx.addess (which is the address we // ctx.loc > ctx.addess (which is the address we
// are currently at in the traced process). // are currently at in the traced process).
for frame.address >= frame.loc && frame.buf.Len() > 0 { for frame.address != frame.loc && frame.buf.Len() > 0 {
executeDwarfInstruction(frame) executeDwarfInstruction(frame)
} }
// make sure we get the update cfa offset // make sure we get the update cfa offset
if frame.buf.Len() > 0 { cfa := frame.CFAOffset()
for ncfa := cfa; ncfa == cfa && frame.buf.Len() > 0; {
executeDwarfInstruction(frame) executeDwarfInstruction(frame)
ncfa = frame.CFAOffset()
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册