Skip to content

Feat/memory tracing - #125

Closed
RaoulSchaffranek wants to merge 3 commits into
masterfrom
feat/memory-tracing
Closed

Feat/memory tracing#125
RaoulSchaffranek wants to merge 3 commits into
masterfrom
feat/memory-tracing

Conversation

@RaoulSchaffranek

Copy link
Copy Markdown
Member

No description provided.

Debuggers need linear memory to resolve Rust variables that live in the shadow
stack (the majority at -O0, e.g. any fbreg-located local or parameter). Extend
the instruction trace record with a `mem` field: a full sparse snapshot of the
current module's linear memory, emitted only when it changed since the previous
snapshot (a `<prevMem>` cell holds the last one), else `null`.

The snapshot is a JSON array of `{ "addr", "bytes" }` runs — one per concrete
SparseBytes chunk, `bytes` lowercase hex via the Bytes2Hex hook — so only
written regions are carried; a consumer folds the most recent snapshot at or
before a step and treats unwritten bytes as 0. A `[traceInstr-nomem]` fallback
keeps tracing total for programs with no linear memory.

test_memory_tracing.py deploys the increment example and asserts the field is
present, snapshots are emitted on change (and omitted otherwise), and the folded
image is consistent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant