diff options
| author | Greg Clayton <gclayton@apple.com> | 2011-02-09 01:08:52 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2011-02-09 01:08:52 +0000 |
| commit | 51b1e2d271a4749654c2168aad7b24321bbb2897 (patch) | |
| tree | ba30fa1dae5d98f59f4b43af59459e9279bb22da /lldb/source/Interpreter/CommandInterpreter.cpp | |
| parent | 7eaacc517bc312d43d511856f359e7bd68c344f1 (diff) | |
| download | bcm5719-llvm-51b1e2d271a4749654c2168aad7b24321bbb2897.tar.gz bcm5719-llvm-51b1e2d271a4749654c2168aad7b24321bbb2897.zip | |
Use Host::File in lldb_private::StreamFile and other places to cleanup host
layer a bit more.
llvm-svn: 125149
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
| -rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index e239c5596a0..8a302feccab 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1102,24 +1102,27 @@ CommandInterpreter::SetPrompt (const char *new_prompt) } size_t -CommandInterpreter::GetConfirmationInputReaderCallback (void *baton, - InputReader &reader, - lldb::InputReaderAction action, - const char *bytes, - size_t bytes_len) +CommandInterpreter::GetConfirmationInputReaderCallback +( + void *baton, + InputReader &reader, + lldb::InputReaderAction action, + const char *bytes, + size_t bytes_len +) { - FILE *out_fh = reader.GetDebugger().GetOutputFileHandle(); + File &out_file = reader.GetDebugger().GetOutputFile(); bool *response_ptr = (bool *) baton; switch (action) { case eInputReaderActivate: - if (out_fh) + if (out_file.IsValid()) { if (reader.GetPrompt()) { - ::fprintf (out_fh, "%s", reader.GetPrompt()); - ::fflush (out_fh); + out_file.Printf ("%s", reader.GetPrompt()); + out_file.Flush (); } } break; @@ -1128,10 +1131,10 @@ CommandInterpreter::GetConfirmationInputReaderCallback (void *baton, break; case eInputReaderReactivate: - if (out_fh && reader.GetPrompt()) + if (out_file.IsValid() && reader.GetPrompt()) { - ::fprintf (out_fh, "%s", reader.GetPrompt()); - ::fflush (out_fh); + out_file.Printf ("%s", reader.GetPrompt()); + out_file.Flush (); } break; @@ -1152,11 +1155,10 @@ CommandInterpreter::GetConfirmationInputReaderCallback (void *baton, } else { - if (out_fh && !reader.IsDone() && reader.GetPrompt()) + if (out_file.IsValid() && !reader.IsDone() && reader.GetPrompt()) { - ::fprintf (out_fh, "Please answer \"y\" or \"n\"\n"); - ::fprintf (out_fh, "%s", reader.GetPrompt()); - ::fflush (out_fh); + out_file.Printf ("Please answer \"y\" or \"n\"\n%s", reader.GetPrompt()); + out_file.Flush (); } } break; |

