Skip to content

DRAFT: Vars supports#81

Draft
piotmag769 wants to merge 3 commits intohehefrom
vars
Draft

DRAFT: Vars supports#81
piotmag769 wants to merge 3 commits intohehefrom
vars

Conversation

@piotmag769
Copy link
Collaborator

No description provided.

Comment on lines +10 to +12
cairo-lang-sierra = "=2.12.3"
cairo-lang-sierra-to-casm = "=2.12.3"
cairo-lang-casm = "=2.12.3"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I pin to the same version snforge does to see cargo resolver errors as early as possible 🤷

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is really ugly and I will rework it together with #35 (this way we can get rid of the Option - there is no vm during initialization)

@piotmag769 piotmag769 changed the base branch from main to hehe February 17, 2026 11:48
// TODO(#16)
.zip(iter::repeat_with(|| FunctionVariables {}))
// ctx.get_values_of_variables(statement_idx, vm),
.zip(iter::repeat_with(FunctionVariables::default))
Copy link
Collaborator Author

@piotmag769 piotmag769 Feb 17, 2026

Choose a reason for hiding this comment

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

We should construct FunctionVariables for each StackFrame, but currently we don't care about inlining (we are fine with the logic being wrong if there are more frames than 1 in a substack) since:

  1. We are in MVP stage.
  2. Only cases where inlining is present are #[inline(always)] cases and they are rare (user can always comment out the attribute if they want to debug such a function).

To handle inlines, do as follows:

  1. Complete Handle inline locations when producing sierra function debug info (compiler side) #41 first.
  2. When creating FunctionVariables when we are on the given statement, we would still be, from sierra POV, in a body of a ONE function which may contain bodies of OTHER function that were inlined. For each statement from beginning of the function to the current statement: compare profiler mappings and current sierra call stack to tell if a statement is a part of inlined function body or "real" function body. Then based on that, assign the variable value to the proper function (so we would in fact return Vec<FunctionVariables>).

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

Comments