[Lldb-commits] [lldb] [lldb] Allow forks to occur in expression evaluation (PR #184815)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 15 12:08:14 PDT 2026
jimingham wrote:
That looks like it should work. The RunThreadPlan part of this makes sense.
It would be good to also run this by someone who is familiar with how the vfork handling is done for the ProcessGDBRemote changes. They seem sensible but I've never studied that code and don't have the time to do that right now. I can't remember whether @labath actually did the work, but he's likely to remember who did if he didn't.
I had one quibble about disabling the start breakpoint.
Also, I didn't see a test where the function called does not fork, but rather another thread does the fork while the expression is running. Shouldn't be too hard to do. Make a program with a global mutex. Have the main thread take the mutex then startup another thread that waits on the mutex, does a fork, then releases the mutex. Then have your expression function release the mutex and then wait to acquire it again. That will force the fork to happen while the expression is running. Then run an expression with "SetStopOthers" set to false. Then make sure that the fork is handled correctly. In that case, the user might want to follow into the child.
You added a bunch of logic to handle that case so it would be good to test it.
https://github.com/llvm/llvm-project/pull/184815
More information about the lldb-commits
mailing list