Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: runtime/bin/dbg_connection.cc

Issue 10540121: Add API to configure debugger pause on exception (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/dbg_connection.h ('k') | runtime/include/dart_debugger_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_connection.cc
===================================================================
--- runtime/bin/dbg_connection.cc (revision 8556)
+++ runtime/bin/dbg_connection.cc (working copy)
@@ -625,6 +625,28 @@
}
+void DebuggerConnectionHandler::HandlePauseOnExcCmd(const char* json_msg) {
+ int msg_id = msgbuf_->MessageId();
+ char* exc_chars = msgbuf_->GetStringParam("exceptions");
+ Dart_ExceptionPauseInfo info = kNoPauseOnExceptions;
+ if (strcmp(exc_chars, "none") == 0) {
+ info = kNoPauseOnExceptions;
+ } else if (strcmp(exc_chars, "all") == 0) {
+ info = kPauseOnAllExceptions;
+ } else if (strcmp(exc_chars, "unhandled") == 0) {
+ info = kPauseOnUnhandledExceptions;
+ } else {
+ SendError(msg_id, "illegal value for parameter 'exceptions'");
+ return;
+ }
+ Dart_Handle res = Dart_SetExceptionPauseInfo(info);
+ ASSERT_NOT_ERROR(res);
+ dart::TextBuffer msg(32);
+ msg.Printf("{ \"id\": %d }", msg_id);
+ SendMsg(&msg);
+}
+
+
void DebuggerConnectionHandler::HandleRemBpCmd(const char* json_msg) {
int msg_id = msgbuf_->MessageId();
int bpt_id = msgbuf_->GetIntParam("breakpointId");
@@ -707,6 +729,7 @@
{ "getScriptSource", HandleGetSourceCmd },
{ "getStackTrace", HandleGetStackTraceCmd },
{ "setBreakpoint", HandleSetBpCmd },
+ { "setPauseOnException", HandlePauseOnExcCmd },
{ "removeBreakpoint", HandleRemBpCmd },
{ "stepInto", HandleStepIntoCmd },
{ "stepOut", HandleStepOutCmd },
« no previous file with comments | « runtime/bin/dbg_connection.h ('k') | runtime/include/dart_debugger_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698