dwarf/op: use readMemory function (#3391)

dwarf/op gained the ability to execute DW_OP_deref opcodes a while ago
but because we didn't save the readMemory function in the context
structure it never worked.
This commit is contained in:
Alessandro Arzilli 2023-05-26 19:04:37 +02:00 committed by GitHub
parent c2bfdfc76b
commit 47989248ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,8 +7,8 @@ import (
"fmt"
"io"
"github.com/go-delve/delve/pkg/dwarf/leb128"
"github.com/go-delve/delve/pkg/dwarf"
"github.com/go-delve/delve/pkg/dwarf/leb128"
)
// Opcode represent a DWARF stack program instruction.
@ -67,6 +67,7 @@ func ExecuteStackProgram(regs DwarfRegisters, instructions []byte, ptrSize int,
stack: make([]int64, 0, 3),
DwarfRegisters: regs,
ptrSize: ptrSize,
readMemory: readMemory,
}
for tick := 0; tick < len(instructions)*arbitraryExecutionLimitFactor; tick++ {