diff options
author | Ilia K <ki.stfu@gmail.com> | 2015-05-07 06:26:27 +0000 |
---|---|---|
committer | Ilia K <ki.stfu@gmail.com> | 2015-05-07 06:26:27 +0000 |
commit | 8f0db3e1f06ca7af04a85063478721c1bc5b955e (patch) | |
tree | a32c073d2ca3f1a97670dd5dad251ce7298345a1 /lldb/source/Commands/CommandObjectProcess.cpp | |
parent | 79a4d58ea19b528437cf0c316f57dd57b819bba1 (diff) | |
download | llvm-8f0db3e1f06ca7af04a85063478721c1bc5b955e.zip llvm-8f0db3e1f06ca7af04a85063478721c1bc5b955e.tar.gz llvm-8f0db3e1f06ca7af04a85063478721c1bc5b955e.tar.bz2 |
Don't call the Process::SyncIOHandler in Target::Launch
Summary: This patch moves synchronization of iohandler to CommandObjectProcessLaunch::DoExecute like it was done in CommandObjectProcessContinue::DoExecute.
Reviewers: jingham, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits, clayborg, jingham
Differential Revision: http://reviews.llvm.org/D9373
llvm-svn: 236699
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index a249c4e..c157411 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -264,13 +264,18 @@ protected: if (error.Success()) { - const char *archname = exe_module_sp->GetArchitecture().GetArchitectureName(); ProcessSP process_sp (target->GetProcessSP()); if (process_sp) { + // There is a race condition where this thread will return up the call stack to the main command + // handler and show an (lldb) prompt before HandlePrivateEvent (from PrivateStateThread) has + // a chance to call PushProcessIOHandler(). + process_sp->SyncIOHandler(2000); + const char *data = stream.GetData(); if (data && strlen(data) > 0) result.AppendMessage(stream.GetData()); + const char *archname = exe_module_sp->GetArchitecture().GetArchitectureName(); result.AppendMessageWithFormat ("Process %" PRIu64 " launched: '%s' (%s)\n", process_sp->GetID(), exe_module_sp->GetFileSpec().GetPath().c_str(), archname); result.SetStatus (eReturnStatusSuccessFinishResult); result.SetDidChangeProcessState (true); |