Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing debugger inspector that wasn't updating when the debugger entered a new optimized scope #472

Conversation

adri09070
Copy link
Contributor

Fixes #450 .

When the debugger entered/left an inlined block with a step, the debugger inspector wouldn't update. As a consequence, if new temporaries were declared in this optimized scope, their values wouldn't be displayed in the inspector (unless this context was deselected and then selected again in the stack).

To fix that, in the debugger action model, before performing a step I store the AST scope of the context we step into/over/through.
Then, after updating the stack of the StDebugger, I compare if the interrupted context after stepping is still the context that was selected before stepping. If this is the case, I ask the raw inspection presenter to update its nodes from the old AST scope with the nodes from the current AST scope.
To do that, I use methods on collections to remove all temp nodes that were in the old scope and that aren't anymore in the new scope (in case we leave an inlined block) and I also add all temp nodes that are in the new scope and that were not in the old scope (in case we enter an inlined block).
Using methods on collections allows to do nothing in case both scopes are the same or in case both scopes aren't the same but have the same temps.

Copy link
Member

@StevenCostiou StevenCostiou left a comment

Choose a reason for hiding this comment

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

Changes look good and tests are passing-shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debugger inspector doesn't update when entering inlined blocks, which hides its temporaries
2 participants