This patch was produced by Shawn Best to fix the issue where the (lldb) prompt is overwritten at times after lldb stops. The code has been tested a lot on linux 64 bit by Matthew Gardiner, and partially reviewed by Greg Clayton. It would be good to test it on OSX, and if ok, get it submitted.
Details
Diff Detail
Event Timeline
I would have liked to reproduce the prompt race condition again and then verify this fix, but unfortunately am now unable to reproduce it on FreeBSD. In any case, LLDB still behaves as expected with this patch.
include/lldb/Target/Process.h | ||
---|---|---|
2667 | It's the only purpose of this, yes? | |
2679 | Do we anticipate different callers needing different timeouts? It seems to me the timeout ought to just be set in SyncIOHandler itself. | |
source/Commands/CommandObjectProcess.cpp | ||
781 | We probably don't need this comment at each SyncIOHandler() call, and in any case race condition no longer exists with the SyncIOHandler call there. | |
source/Target/Process.cpp | ||
908 | This log (the !timed_out case) will spam the log quite a bit, and seems unnecessary (or perhaps include it in verbose); the timed_out case above is definitely important though. |
Ok, thanks Matthew. I'll run it through OSX and my Linux. I'll get it in
if it looks good.
I thought I caught the tail end of the thread and that maybe you saw issues
with it in some process states (e.g. attaching or something like that?).
Was it not an issue, or was it just not worse than it was before?
(Ed - clearly the fact that we have a patch that might address this has spooked the behavior on FreeBSD so it no longer shows --- wish that worked the same for Linux from time to time! :-P)
Yep, the unfortunate nature of race conditions :(
In any case, in case I wasn't clear: I do believe this patch should go in, and it looks good to me other than the minor nits I commented on.
This issue is the one item that held me back from updating the copy of LLDB in the FreeBSD base system and so am very happy to see it fixed.
Verified on:
Ubuntu 14.04 x86_64, clang-built lldb. All tests passed.
MacOSX 10.9.4, Xcode 6 Beta 5-built lldb. All tests passed.
svn commit
Sending include/lldb/Target/Process.h
Sending source/Commands/CommandObjectProcess.cpp
Sending source/Commands/CommandObjectThread.cpp
Sending source/Target/Process.cpp
Sending source/Target/Target.cpp
Transmitting file data .....
Committed revision 215446.
Replying to Ed's review.
I agree regarding the SyncIOHandler function signature. It should be parameterless, and the timeout value should be a value private to this routine. And yes, the "success" log statement is unnecessary noise.
It's the only purpose of this, yes?