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
This commit is contained in:
parent
6d10c17a31
commit
d242f1c037
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue