Skip to content

Add support for HitCount and HitCondition#1548

Open
WardenGnaw wants to merge 1 commit intomainfrom
dev/waan/hit-condition-validation
Open

Add support for HitCount and HitCondition#1548
WardenGnaw wants to merge 1 commit intomainfrom
dev/waan/hit-condition-validation

Conversation

@WardenGnaw
Copy link
Member

This PR adds in showing the Hit count for a breakpoint and for setting a HitCondition.

Enables m_supportsHitConditionalBreakpoints, OpenDebugAD7 now properly builds a AD7BreakpointRequest with a hitCondition, AD7BoundBreakpoint now properly tracks hits and will prevent a break event if theres a condition set.

Added CppTests and updated DebuggerTesting for associated commands.

Addresses: #472

This PR adds in showing the Hit count for a breakpoint and for setting a
HitCondition.

Enables m_supportsHitConditionalBreakpoints, OpenDebugAD7 now properly
builds a AD7BreakpointRequest with a hitCondition, AD7BoundBreakpoint
now properly tracks hits and will prevent a break event if theres a
condition set.

Added CppTests and updated DebuggerTesting for associated commands.

Addresses: #472
/// Must be called after IncrementHitCount.
/// </summary>
internal bool ShouldBreak()
{
Copy link
Member

Choose a reason for hiding this comment

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

{

Instead of just implementing this in our layer, should we be using -break-after?

Copy link
Member

Choose a reason for hiding this comment

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

If Copilot is correct, if we wanted to do that, we could figure out the current hit count by looking at the ignore value from a -break-info command.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I totally missed the ignore. I mainly used this route because I was worried the HitCount number would actually be wrong. Let me look into it more.

Copy link
Member

Choose a reason for hiding this comment

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

If Copilot is correct, I think could use a hitCountOffset value in addition to the ignore value to compute the current hit count.

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.

2 participants