Skip to content

Adjust and fix SerializableAllFunctionsDebugInfo#10192

Open
piotmag769 wants to merge 1 commit into
mainfrom
pm/fix-debugger-debug-info
Open

Adjust and fix SerializableAllFunctionsDebugInfo#10192
piotmag769 wants to merge 1 commit into
mainfrom
pm/fix-debugger-debug-info

Conversation

@piotmag769

Copy link
Copy Markdown
Collaborator
  1. Sierra to Cairo variables in FunctionDebugInfo is now a multimap to account for cases where sierra var ids are reused (such as store_temp).
  2. Replace the heuristic lookup of Cairo variables via stable locations with semantic walk in FunctionDebugInfo.

Replace the heuristic lookup of Cairo variables with semantic walk in `FunctionDebugInfo`
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Large refactor of debugger-facing serialized JSON (field rename and multimap shape) may break consumers expecting the old single-map format; logic is complex but confined to optional debug annotations.

Overview
Improves cairo-debugger annotations by rebuilding how Sierra variables are tied back to Cairo source names and spans.

The serialized shape changes from one Cairo variable per Sierra id to sierra_to_cairo_variables, a multimap (Vec of name/span pairs) so reused Sierra slots (e.g. after store_temp) can list every Cairo binding that ever used that id.

Mapping logic drops syntax/heuristic identifier lookup and instead walks the function’s semantic body (BindingCollector): params, lets, assignments, match/if-let, compound ops, with Sierra vars resolved via a per-pointer introduction index and types inferred from the function’s Sierra statements slice.

Call sites now pass the compiled program into extract_serializable_debug_info (per-function statement ranges derived from entry points). Starknet contract compile also runs replace_function_ids on debug info before serialization so keys match canonical Sierra ids.

Reviewed by Cursor Bugbot for commit 519aa73. Bugbot is set up for automated code reviews on this repo. Configure here.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 519aa73. Configure here.

@piotmag769 piotmag769 requested a review from orizi July 6, 2026 10:14

@orizi orizi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@orizi reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on piotmag769).

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.

4 participants