-
Notifications
You must be signed in to change notification settings - Fork 235
Add support for breakpoint hit count #298
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
Comments
Sounds good! That will be a nice addition. |
Investigated and ran into a snag. Enh request for PowerShell here: PowerShell/PowerShell#2594 Initial work is committed to my fork: rkeithhill@f56a683 Might be able to track the |
Even if this improves in PowerShell 6.0+, we'd still have to make it work for older versions. I think we'll have to do it ourselves for now. Maybe we can augment the user's condition code if it helps? |
True enough. I'll experiment with maintaining the hit count in a global variable. Do we have a naming convention for globals created by the debugger? Maybe something like |
OK, this seems to work although it does inject a global into the debug session. I think that should be OK. if (<user expression>) { if (++$global:__psEditorServices_BreakHitCounter_1 -eq <user hit count>) { break } } Note that I maintain a static "breakpointHitCounter" that gets incremented each time a breakpoint like this is set. So the next hit count breakpoint would look like this: if (<user expression>) { if (++$global:__psEditorServices_BreakHitCounter_2 -eq <user hit count>) { break } } Where the global variable has a different name Not done with this yet. If there is no "condition" then we won't need to create a global. We can use the breakpoint's HitCount property e.g.: if ($_.HitCount -eq <user hit count>) { break } I hope to check this in by Saturday. |
This is done right? Should we close it? |
Yes, it has been implemented. |
Just saw this in the 1.7 insider's release notes. Sounds like debugger extensions must be modified to support this. I suspect this should be easy to support.
The text was updated successfully, but these errors were encountered: