mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: represent additional allocated memory (#3048)
This commit is contained in:
@ -212,6 +212,13 @@ impl TracingInspector {
|
|||||||
self.step_stack.pop().expect("can't fill step without starting a step first");
|
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];
|
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 let Some(pc) = interp.program_counter().checked_sub(1) {
|
||||||
if self.config.record_state_diff {
|
if self.config.record_state_diff {
|
||||||
let op = interp.contract.bytecode.bytecode()[pc];
|
let op = interp.contract.bytecode.bytecode()[pc];
|
||||||
|
|||||||
@ -445,7 +445,9 @@ pub(crate) struct CallTraceStep {
|
|||||||
pub(crate) contract: Address,
|
pub(crate) contract: Address,
|
||||||
/// Stack before step execution
|
/// Stack before step execution
|
||||||
pub(crate) stack: Stack,
|
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,
|
pub(crate) memory: Memory,
|
||||||
/// Size of memory
|
/// Size of memory
|
||||||
pub(crate) memory_size: usize,
|
pub(crate) memory_size: usize,
|
||||||
|
|||||||
Reference in New Issue
Block a user