This is an archive of the discontinued LLVM Phabricator instance.

Make ignore counts work as "after stop" modifiers so they play nicely with conditions
AcceptedPublic

Authored by jingham on May 26 2021, 5:24 PM.

Details

Reviewers
JDevlieghere
Summary

Previously ignore counts were checked when we stopped to do the sync callback in Breakpoint::ShouldStop. That meant we would do all the ignore count work even when there is also a condition says the breakpoint should not stop.

That's wrong, lldb treats breakpoint hits that fail the thread or condition checks as "not having hit the breakpoint". So the ignore count check should happen after the condition and thread checks in StopInfoBreakpoint::PerformAction.

The one side-effect of doing this is that if you have a breakpoint with a synchronous callback, it will run the synchronous callback before checking the ignore count. That is probably a good thing, since this was already true of the condition and thread checks, so this removes an odd asymmetry. And breakpoints with sync callbacks are all internal lldb breakpoints and there's not a really good reason why you would want one of these to use an ignore count (but not a condition or thread check...)

Diff Detail

Event Timeline

jingham requested review of this revision.May 26 2021, 5:24 PM
jingham created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2021, 5:24 PM
JDevlieghere accepted this revision.May 28 2021, 9:17 AM

LGTM

lldb/include/lldb/Breakpoint/BreakpointLocation.h
300–305
This revision is now accepted and ready to land.May 28 2021, 9:17 AM