summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
authorCaroline Tice <ctice@apple.com>2010-11-19 20:47:54 +0000
committerCaroline Tice <ctice@apple.com>2010-11-19 20:47:54 +0000
commitefed613172d902cf2ce49f68dd36f15a29a34dab (patch)
tree9f2dd7ec50382f4e1c2ca600e0d06d60a9bee4c6 /lldb/source/Commands
parent601e72c88a65fddc4525a3d5a19b51495a68ce82 (diff)
downloadbcm5719-llvm-efed613172d902cf2ce49f68dd36f15a29a34dab.tar.gz
bcm5719-llvm-efed613172d902cf2ce49f68dd36f15a29a34dab.zip
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
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.cpp23
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp11
2 files changed, 34 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index e8bd399b131..aad7158d28f 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -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;
}
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 436b2e7540c..32236f8c917 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -199,7 +199,18 @@ CommandObjectExpression::MultiLineExpressionCallback
// ::fprintf (out_fh, "%3u: ", cmd_object_expr->m_expr_line_count);
break;
+ case eInputReaderInterrupt:
+ cmd_object_expr->m_expr_lines.clear();
+ reader.SetIsDone (true);
+ reader.GetDebugger().GetOutputStream().Printf("%s\n", "Expression evaluation cancelled.");
+ break;
+
+ case eInputReaderEndOfFile:
+ reader.SetIsDone (true);
+ break;
+
case eInputReaderDone:
+ if (cmd_object_expr->m_expr_lines.size() > 0)
{
cmd_object_expr->EvaluateExpression (cmd_object_expr->m_expr_lines.c_str(),
reader.GetDebugger().GetOutputStream(),
OpenPOWER on IntegriCloud