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

@@ -468,6 +468,29 @@ CommandObjectBreakpointCommandAdd::GenerateBreakpointCommandCallback
}
break;
case eInputReaderInterrupt:
{
// Finish, and cancel the breakpoint command.
reader.SetIsDone (true);
BreakpointOptions *bp_options = (BreakpointOptions *) baton;
if (bp_options)
{
Baton *bp_options_baton = bp_options->GetBaton ();
if (bp_options_baton)
{
((BreakpointOptions::CommandData *) bp_options_baton->m_data)->user_source.Clear();
((BreakpointOptions::CommandData *) bp_options_baton->m_data)->script_source.Clear();
}
}
::fprintf (out_fh, "Warning: No command attached to breakpoint.\n");
::fflush (out_fh);
}
break;
case eInputReaderEndOfFile:
reader.SetIsDone (true);
break;
case eInputReaderDone:
break;
}