[Lldb-commits] [PATCH] D147587: Fix the check in StopInfoBreakpoint for "are we running an expression"

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 4 18:44:18 PDT 2023


jingham created this revision.
jingham added reviewers: JDevlieghere, kastiglione, bulbazord, augusto2112.
Herald added a project: All.
jingham requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

If you hit a breakpoint while running an expression we don't want to run other commands that might end up running expressions again because that doesn't currently work recursively.  But the code that was checking there was checking "WasTheLastResumeForUserExpression" which isn't quite right, since that expression might have already completed - because it was part of the handling of the breakpoint before we got to the StopInfo.  We are tracking whether we are currently running an expression, however, which is the correct thing to check.  So I made a function to check that and changed the StopInfoBreakpoint to use it.

It's actually pretty hard to get into a situation where this causes problems, because the expression has to happen internally in lldb between the stop and the fetching of the stop event.  However, that's just what the objc_exception_throw frame recognizer does.  Some code that was added to the StopInfoBreakpoint turned this "oops I'm running an expression" into a resume - which was necessary for some Windows fix, but caused us to fail to stop for the objc_exception_throw breakpoint.

So I added a test for the built-in objc_exception_throw built-in recognizer.  Without the fix the test would fail because we didn't stop at the exception throw point.  This also tests that we got all the values right.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147587

Files:
  lldb/include/lldb/Target/Process.h
  lldb/source/Target/StopInfo.cpp
  lldb/test/API/macosx/objc_exception_recognizer/Makefile
  lldb/test/API/macosx/objc_exception_recognizer/TestObjCRecognizer.py
  lldb/test/API/macosx/objc_exception_recognizer/main.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147587.510984.patch
Type: text/x-patch
Size: 6242 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230405/40339a2b/attachment.bin>


More information about the lldb-commits mailing list