summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/tools/driver/Driver.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index ec8f26b20c9..808035f9a96 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -1080,10 +1080,19 @@ Driver::EditLineInputReaderCallback
case eInputReaderInterrupt:
if (driver->m_io_channel_ap.get() != NULL)
{
- driver->m_io_channel_ap->OutWrite ("^C\n", 3, NO_ASYNC);
- // I wish I could erase the entire input line, but there's no public API for that.
- driver->m_io_channel_ap->EraseCharsBeforeCursor();
- driver->m_io_channel_ap->RefreshPrompt();
+ SBProcess process = driver->GetDebugger().GetSelectedTarget().GetProcess();
+ if (!driver->m_io_channel_ap->EditLineHasCharacters()
+ && process.IsValid() && process.GetState() == lldb::eStateRunning)
+ {
+ process.Stop();
+ }
+ else
+ {
+ driver->m_io_channel_ap->OutWrite ("^C\n", 3, NO_ASYNC);
+ // I wish I could erase the entire input line, but there's no public API for that.
+ driver->m_io_channel_ap->EraseCharsBeforeCursor();
+ driver->m_io_channel_ap->RefreshPrompt();
+ }
}
break;
OpenPOWER on IntegriCloud