feat: represent additional allocated memory (#3048)

This commit is contained in:
Matthias Seitz
2023-06-07 15:09:09 +02:00
committed by GitHub
parent 4ddec063f0
commit 4e7f31c11c
2 changed files with 10 additions and 1 deletions

View File

@ -212,6 +212,13 @@ impl TracingInspector {
self.step_stack.pop().expect("can't fill step without starting a step first");
let step = &mut self.traces.arena[trace_idx].trace.steps[step_idx];
if self.config.record_memory_snapshots {
// resize memory so opcodes that allocated memory is correctly displayed
if interp.memory.len() > step.memory.len() {
step.memory.resize(interp.memory.len());
}
}
if let Some(pc) = interp.program_counter().checked_sub(1) {
if self.config.record_state_diff {
let op = interp.contract.bytecode.bytecode()[pc];

View File

@ -445,7 +445,9 @@ pub(crate) struct CallTraceStep {
pub(crate) contract: Address,
/// Stack before step execution
pub(crate) stack: Stack,
/// Memory before step execution
/// All allocated memory in a step
///
/// This will be empty if memory capture is disabled
pub(crate) memory: Memory,
/// Size of memory
pub(crate) memory_size: usize,