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

Unified Diff: runtime/vm/debugger.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/vm/debugger.h ('k') | runtime/vm/debugger_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 8556)
+++ runtime/vm/debugger.cc (working copy)
@@ -477,8 +477,7 @@
resume_action_(kContinue),
last_bpt_line_(-1),
ignore_breakpoints_(false),
- pause_on_exception_(false),
- pause_on_unhandled_exception_(false) {
+ exc_pause_info_(kNoPauseOnExceptions) {
}
@@ -624,17 +623,32 @@
}
-// TODO(hausner): Determine whether the exception is handled or not, and
-// check with the settings the user specified to determine whether the
-// debugger should pause or not.
-// For now, we just pause on TypeError and AssertionError exceptions.
+void Debugger::SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info) {
+ exc_pause_info_ = pause_info;
+}
+
+
+// TODO(hausner): Determine whether the exception is handled or not.
bool Debugger::ShouldPauseOnException(DebuggerStackTrace* stack_trace,
const Object& exc) {
+ if (exc_pause_info_ == kNoPauseOnExceptions) {
+ return false;
+ }
+ if ((exc_pause_info_ & kPauseOnAllExceptions) != 0) {
+ return true;
+ }
+ // Assume TypeError and AssertionError exceptions are unhandled.
const Class& exc_class = Class::Handle(exc.clazz());
const String& class_name = String::Handle(exc_class.Name());
- // TODO(hausner): Note the poor man's type test. Replace with check for
- // actual class object or class id.
- return class_name.Equals("TypeError") || class_name.Equals("AssertionError");
+ // TODO(hausner): Note the poor man's type test. This code will go
+ // away when we have a way to determine whether an exception is unhandled.
+ if (class_name.Equals("TypeError")) {
+ return true;
+ }
+ if (class_name.Equals("AssertionError")) {
+ return true;
+ }
+ return false;
}
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/debugger_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698