Fix Debugger::HandleProcessEvent in case when ProcessIOHandler doesn't exist

Summary:
Previously the Debugger::HandleProcessEvent hid a top IOHandler if the
process's IOHandler was inactive and later refreshed it. Usually the
IOHandler.Refresh() prints the (lldb) prompt. The problem was in case of
iOS remote platform when trying to execute 'command source' command.
On this platform the process's IOHandler is empty, therefore the
Debugger::HandleProcessEvent hid a top IOHandler and later refreshed it.
So that the (lldb) prompt was printed with a program output in mixed
order:
was:
```
  longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
  longlonglonglonglonglonglonglonglonglonglonglonglonglonglon(lldb)
  glonglonglonglonglonglonglonglonglonglonglonglong string
```

now:
```
  longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
  longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
  longlonglonglonglonglonglonglonglong string
```

Reviewers: zturner, jingham, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, jingham, zturner, clayborg

Differential Revision: http://reviews.llvm.org/D8929

llvm-svn: 234517
This commit is contained in:
Ilia K
2015-04-09 18:18:10 +00:00
parent 4e8ddf5333
commit 1355c047ab
2 changed files with 7 additions and 1 deletions

View File

@@ -3258,6 +3258,12 @@ protected:
bool
ProcessIOHandlerIsActive ();
bool
ProcessIOHandlerExists () const
{
return static_cast<bool>(m_process_input_reader);
}
Error
HaltForDestroyOrDetach(lldb::EventSP &exit_event_sp);

View File

@@ -1519,7 +1519,7 @@ Debugger::HandleProcessEvent (const EventSP &event_sp)
StreamFileSP error_stream_sp (GetOutputFile());
bool top_io_handler_hid = false;
if (process_sp->ProcessIOHandlerIsActive() == false)
if (process_sp->ProcessIOHandlerExists() && process_sp->ProcessIOHandlerIsActive() == false)
top_io_handler_hid = HideTopIOHandler();
if (output_stream.GetSize())