diff options
author | Greg Clayton <gclayton@apple.com> | 2014-01-30 18:17:31 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2014-01-30 18:17:31 +0000 |
commit | 31480e64eeec19f98424be8947d30c49ee1827da (patch) | |
tree | 57f30370ce3a4ab8cbc94a04133821e22b5340dd /lldb/source/Interpreter | |
parent | 5944ecd64c6863ab278425c39149014993ef5c4d (diff) | |
download | bcm5719-llvm-31480e64eeec19f98424be8947d30c49ee1827da.tar.gz bcm5719-llvm-31480e64eeec19f98424be8947d30c49ee1827da.zip |
"script help (lldb.SBThread)" output stops before all output is displayed. Fixed now.
<rdar://problem/15942977>
llvm-svn: 200476
Diffstat (limited to 'lldb/source/Interpreter')
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index a2740cf96e1..fe81e67c73c 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -571,7 +571,7 @@ ScriptInterpreterPython::ExecuteOneLine (const char *command, CommandReturnObjec int err = pipe(pipe_fds); if (err == 0) { - std::unique_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor(pipe_fds[0], false)); + std::unique_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor(pipe_fds[0], true)); if (conn_ap->IsConnected()) { output_comm.SetConnection(conn_ap.release()); @@ -654,13 +654,15 @@ ScriptInterpreterPython::ExecuteOneLine (const char *command, CommandReturnObjec if (pipe_fds[0] != -1) { - // Close write end of pipe so our communication thread exits + // Close the write end of the pipe since we are done with our + // one line script. This should cause the read thread that + // output_comm is using to exit + output_file_sp->GetFile().Close(); + // The close above should cause this thread to exit when it gets + // to the end of file, so let it get all its data + output_comm.JoinReadThread(); + // Now we can close the read end of the pipe output_comm.Disconnect(); - output_comm.StopReadThread(); - // Close the read end of the pipe and don't close the write end - // since we called fdopen on it and gave the ownership to the - // connection in "output_comm" - ::close (pipe_fds[0]); } |