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

[#1336] Discard cached state after program starts stepping. #1337

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

gareth-rees
Copy link
Contributor

@gareth-rees gareth-rees commented Aug 15, 2022

Description

In AD7DebugSession.StepInternal, discard cached state after program starts stepping, rather than before.

Previously the cached state was discarded before calling Step, but this meant that if Step failed then MIEngine was left with no cached state, causing a subsequent call to GetDebugPropertyFromExpression to fail with a fatal error.

Fixes #1336 (Evaluating a variable after a failed Step Out causes a fatal error, leaving debug session unusable).

Note

BeforeContinue is also called by HandleContinueRequestAsync, HandleIDebugEntryPointEvent2 and HandleIDebugEntryPointEvent2, so similar changes might make sense in some or all of those functions, but I didn't make those changes here because the Continue request doesn't have the same possibility of harmless failure as the Step Out request.

Previously the cached state was discarded before calling `Step`, but
this meant that if `Step` failed then MIEngine was left with no cached
state, causing a subsequent call to `GetDebugPropertyFromExpression`
to fail with a fatal error.
Copy link
Member

@WardenGnaw WardenGnaw left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for your contribution @gareth-rees!

This will be targeted for the next VS Code C/C++ Extension Release.

@WardenGnaw WardenGnaw merged commit f91dec6 into microsoft:main Aug 15, 2022
@gareth-rees
Copy link
Contributor Author

Thank you for the quick review and merge!

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.

Evaluating a variable after a failed Step Out causes a fatal error, leaving debug session unusable
2 participants