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:
Caroline Tice
2010-11-19 20:47:54 +00:00
parent 601e72c88a
commit efed613172
18 changed files with 226 additions and 53 deletions

View File

@@ -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;