mirror of
https://github.com/intel/llvm.git
synced 2026-01-15 12:25:46 +08:00
Add the ability to catch and do the right thing with Interrupts (often control-c)
and end-of-file (often control-d). llvm-svn: 119837
This commit is contained in:
@@ -1478,10 +1478,6 @@ Process::Halt ()
|
||||
}
|
||||
else
|
||||
{
|
||||
// Since we are eating the event, we need to update our state
|
||||
// otherwise the process state will not match reality...
|
||||
SetPublicState(state);
|
||||
|
||||
if (StateIsStoppedState (state))
|
||||
{
|
||||
// We caused the process to interrupt itself, so mark this
|
||||
@@ -1508,7 +1504,7 @@ Process::Halt ()
|
||||
// stopped the process, intercepted the event and set the interrupted
|
||||
// bool in the event.
|
||||
if (event_sp)
|
||||
BroadcastEvent(event_sp);
|
||||
m_private_state_broadcaster.BroadcastEvent(event_sp);
|
||||
|
||||
}
|
||||
return error;
|
||||
@@ -2175,6 +2171,14 @@ Process::ProcessInputReaderCallback (void *baton,
|
||||
}
|
||||
break;
|
||||
|
||||
case eInputReaderInterrupt:
|
||||
process->Halt ();
|
||||
break;
|
||||
|
||||
case eInputReaderEndOfFile:
|
||||
process->AppendSTDOUT ("^D", 2);
|
||||
break;
|
||||
|
||||
case eInputReaderDone:
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user