mirror of
https://github.com/go-delve/delve.git
synced 2025-11-02 04:36:29 +08:00
Fix stack frame calculation bug
There were certain instances where the calculation of the stack frame was incorrect, causing for garbage to be returned by a print command.
This commit is contained in:
@ -157,15 +157,9 @@ func (frame *FrameContext) ExecuteUntilPC(instructions []byte) {
|
||||
// We only need to execute the instructions until
|
||||
// ctx.loc > ctx.addess (which is the address we
|
||||
// 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)
|
||||
}
|
||||
// make sure we get the update cfa offset
|
||||
cfa := frame.CFAOffset()
|
||||
for ncfa := cfa; ncfa == cfa && frame.buf.Len() > 0; {
|
||||
executeDwarfInstruction(frame)
|
||||
ncfa = frame.CFAOffset()
|
||||
}
|
||||
}
|
||||
|
||||
func executeDwarfInstruction(frame *FrameContext) {
|
||||
|
||||
Reference in New Issue
Block a user