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

Unified Diff: runtime/vm/debugger_api_impl.cc

Issue 10537065: Debugger break on TypeError, AssertionError (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/vm/debugger.cc ('k') | runtime/vm/exceptions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger_api_impl.cc
===================================================================
--- runtime/vm/debugger_api_impl.cc (revision 8456)
+++ runtime/vm/debugger_api_impl.cc (working copy)
@@ -106,6 +106,7 @@
static Dart_BreakpointResolvedHandler* bp_resolved_handler = NULL;
+static Dart_ExceptionThrownHandler* exc_thrown_handler = NULL;
static void DebuggerEventHandler(Debugger::DebuggerEvent* event) {
Isolate* isolate = Isolate::Current();
@@ -118,6 +119,14 @@
ASSERT(bpt != NULL);
Dart_Handle url = Api::NewHandle(isolate, bpt->SourceUrl());
(*bp_resolved_handler)(bpt->id(), url, bpt->LineNumber());
+ } else if (event->type == Debugger::kExceptionThrown) {
+ if (exc_thrown_handler == NULL) {
+ return;
+ }
+ Dart_Handle exception = Api::NewHandle(isolate, event->exception->raw());
+ Dart_StackTrace trace =
+ reinterpret_cast<Dart_StackTrace>(isolate->debugger()->StackTrace());
+ (*exc_thrown_handler)(exception, trace);
} else {
UNIMPLEMENTED();
}
@@ -133,6 +142,15 @@
}
+DART_EXPORT void Dart_SetExceptionThrownHandler(
+ Dart_ExceptionThrownHandler handler) {
+ exc_thrown_handler = handler;
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ isolate->debugger()->SetEventHandler(DebuggerEventHandler);
+}
+
+
DART_EXPORT Dart_Handle Dart_GetStackTrace(Dart_StackTrace* trace) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/exceptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698