ui: resolve argument values in call stack display#206
Merged
gnidan merged 1 commit intocall-returnfrom Apr 2, 2026
Merged
Conversation
Contributor
|
78e0e7b to
ecc5b19
Compare
Store argument pointers on call stack frames and resolve them against historical machine state at each frame's invoke step. Display as "add(a: 3, b: 4)" in both CallStackDisplay and TraceDrawer breadcrumbs. When the compiler emits duplicate invoke contexts (caller JUMP + callee JUMPDEST), use the callee entry step for resolution since argument pointers reference stack slots valid at the JUMPDEST, not the JUMP. Fix stack peek indexing in both traceStepToMachineState and traceStepToState: depth 0 should read from the top of the stack (last array element), not the bottom. The evm package stores stacks bottom-first. Values are cached by step index to avoid re-resolving unchanged frames. Small values (<=9999) display as decimal, larger values as hex.
ecc5b19 to
f772814
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CallStackDisplay(programs-react) andTraceDrawer(web)Changes
packages/programs-react/src/utils/mockTrace.ts— addargumentPointerstoCallFrame, replaceextractArgNameswithextractArgInfothat returns both names and pointerspackages/programs-react/src/components/TraceContext.tsx— addResolvedCallFrametype, async resolution effect with caching, exposeresolvedCallStackonTraceStatepackages/programs-react/src/components/CallStackDisplay.tsx— use resolved values in breadcrumb displaypackages/web/src/theme/ProgramExample/TraceDrawer.tsx— add machine state adapter, pointer resolution, and resolved values in call stack display