summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-06-01 01:07:02 +0000
committerJim Ingham <jingham@apple.com>2012-06-01 01:07:02 +0000
commitd242f1c0378508875ffddaaf7f23ef646d7a1649 (patch)
tree5a0900d622ff81fdeb5cd2ba4a704d2b7ecf1c5b
parent6d10c17a31122cda3fd04398eb95be441f6d8f0c (diff)
downloadbcm5719-llvm-d242f1c0378508875ffddaaf7f23ef646d7a1649.tar.gz
bcm5719-llvm-d242f1c0378508875ffddaaf7f23ef646d7a1649.zip
If the Driver's input reader gets an Interrupt and the current command line is empty, then treat that interrupt as an instruction to Stop the process of the currently selected target.
llvm-svn: 157790
-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