Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
lldb/source/Core/IOHandler.cpp
Show First 20 Lines • Show All 323 Lines • ▼ Show 20 Lines | if (in) { | ||||
if (m_multi_line && m_curr_line_idx > 0) | if (m_multi_line && m_curr_line_idx > 0) | ||||
prompt = GetContinuationPrompt(); | prompt = GetContinuationPrompt(); | ||||
if (prompt == nullptr) | if (prompt == nullptr) | ||||
prompt = GetPrompt(); | prompt = GetPrompt(); | ||||
if (prompt && prompt[0]) { | if (prompt && prompt[0]) { | ||||
FILE *out = GetOutputFILE(); | if (m_output_sp) { | ||||
if (out) { | m_output_sp->Printf("%s", prompt); | ||||
labath: It looks like this could actually use the `Stream` interface to write this stuff (*m_output_sp… | |||||
::fprintf(out, "%s", prompt); | m_output_sp->Flush(); | ||||
::fflush(out); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
char buffer[256]; | char buffer[256]; | ||||
bool done = false; | bool done = false; | ||||
bool got_line = false; | bool got_line = false; | ||||
m_editing = true; | m_editing = true; | ||||
while (!done) { | while (!done) { | ||||
▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
bool done = false; | bool done = false; | ||||
Status error; | Status error; | ||||
while (!done) { | while (!done) { | ||||
// Show line numbers if we are asked to | // Show line numbers if we are asked to | ||||
std::string line; | std::string line; | ||||
if (m_base_line_number > 0 && GetIsInteractive()) { | if (m_base_line_number > 0 && GetIsInteractive()) { | ||||
FILE *out = GetOutputFILE(); | if (m_output_sp) { | ||||
if (out) | m_output_sp->Printf("%u%s", | ||||
same here. labath: same here. | |||||
::fprintf(out, "%u%s", m_base_line_number + (uint32_t)lines.GetSize(), | m_base_line_number + (uint32_t)lines.GetSize(), | ||||
GetPrompt() == nullptr ? " " : ""); | GetPrompt() == nullptr ? " " : ""); | ||||
} | } | ||||
} | |||||
m_curr_line_idx = lines.GetSize(); | m_curr_line_idx = lines.GetSize(); | ||||
bool interrupted = false; | bool interrupted = false; | ||||
if (GetLine(line, interrupted) && !interrupted) { | if (GetLine(line, interrupted) && !interrupted) { | ||||
lines.AppendString(line); | lines.AppendString(line); | ||||
done = m_delegate.IOHandlerIsInputComplete(*this, lines); | done = m_delegate.IOHandlerIsInputComplete(*this, lines); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 4,090 Lines • Show Last 20 Lines |
It looks like this could actually use the Stream interface to write this stuff (*m_output_sp << prompt). Ideally, I guess we wouldn't even have formatted output capabilities on the File class, and things would always go through streams for stuff like this..