[Lldb-commits] [PATCH] D58727: https://reviews.llvm.org/D58394 done right

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 27 10:41:12 PST 2019

jingham created this revision.
jingham added a reviewer: labath.
Herald added subscribers: lldb-commits, abidh.
Herald added a project: LLDB.

I was running the lit tests by hand (since you can't actually run them with the Xcode build) and missed one crucial fact.  The lit tests are all run in batch mode with command files.  Normally, in lldb, the main interpreter in in Async mode, and individual commands choose to be in sync or async mode based, for instance, on whether we are handing the inferior's stdout in our terminal or not.  But when sourcing command files, the interpreter runs in Sync mode - since it never makes sense for batch files to run in Async mode.

Normally that doesn't make any difference, but there was an error in how "run by starting stopped and then attaching" in sync mode was implemented.  It hijacked the process state events so that it could handle the initial SIGSTOP that came from the attach.  Then when it decided to continue synchronously, it didn't do so by calling ResumeSynchronous, but just kept the old hijack listener in place and waited for the events by hand.  So other code couldn't tell that a sync resume was in progress.  That was the difference that was causing the failure Pavel saw (and I should have seen had I been more careful in running the lit tests by hand.)

This is the same patch as D58394 <https://reviews.llvm.org/D58394> except that I changed how Target::Launch handles the sync case, just replacing the hand-rolled Resume with a call to ResumeSynchronous.

BTW, is it possible to re-open a closed review, I didn't see a way to do that, so I had to make another.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58727.188579.patch
Type: text/x-patch
Size: 18476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190227/6cebe0da/attachment-0001.bin>

More information about the lldb-commits mailing list