This is an archive of the discontinued LLVM Phabricator instance.

Fix the logic so stop-hooks get run after a breakpoint that ran an expression
ClosedPublic

Authored by jingham on Jul 21 2021, 5:31 PM.

Details

Summary

Code was added to Target::RunStopHook to make sure that we don't run stop hooks when you stop for an expression evaluation. But the way it was done was to check that we hadn't run an expression since the last natural stop. That failed in the case where you stopped for a breakpoint which had run an expression, because the stop-hooks get run after the breakpoint actions, and so by the time we got to running the stop-hooks, we had already run a user expression.

I fixed this by adding a target ivar tracking the last natural stop ID at which we had run a stop-hook. Then we keep track of this and make sure we run the stop-hooks only once per natural stop.

Diff Detail

Event Timeline

jingham requested review of this revision.Jul 21 2021, 5:31 PM
jingham created this revision.

Small nit, but otherwise this LGTM.

lldb/include/lldb/Target/Target.h
1432–1433

Please make these /// Doxygen comments above the variable.

1435

Same here + period.

JDevlieghere accepted this revision.Jul 21 2021, 10:55 PM
This revision is now accepted and ready to land.Jul 21 2021, 10:55 PM
This revision was landed with ongoing or failed builds.Jul 22 2021, 3:06 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2021, 3:06 PM