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

Unified Diff: runtime/vm/debugger_api_impl.cc

Issue 9316071: Dart_PropagateError, take 2. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 11 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.h » ('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 3862)
+++ runtime/vm/debugger_api_impl.cc (working copy)
@@ -8,7 +8,6 @@
#include "vm/dart_api_state.h"
#include "vm/debugger.h"
#include "vm/isolate.h"
-#include "vm/longjump.h"
#include "vm/object_store.h"
namespace dart {
@@ -141,25 +140,23 @@
return Api::NewError(msg);
}
- LongJump* base = isolate->long_jump_base();
- LongJump jump;
- isolate->set_long_jump_base(&jump);
Dart_Handle result = Api::True();
*breakpoint = NULL;
Debugger* debugger = isolate->debugger();
ASSERT(debugger != NULL);
- if (setjmp(*jump.Set()) == 0) {
- Breakpoint* bpt = debugger->SetBreakpointAtLine(script_url, line);
- if (bpt == NULL) {
+ Error& error = Error::Handle();
+ Breakpoint* bpt = debugger->SetBreakpointAtLine(script_url, line, &error);
+ if (bpt == NULL) {
+ if (!error.IsNull()) {
+ // If SetBreakpointAtLine provided an error message, use it.
+ result = Api::NewLocalHandle(error);
+ } else {
result = Api::NewError("%s: could not set breakpoint at line %d of '%s'",
CURRENT_FUNC, line, script_url.ToCString());
- } else {
- *breakpoint = reinterpret_cast<Dart_Breakpoint>(bpt);
}
} else {
- SetupErrorResult(&result);
+ *breakpoint = reinterpret_cast<Dart_Breakpoint>(bpt);
}
- isolate->set_long_jump_base(base);
return result;
}
@@ -198,24 +195,21 @@
function_name.ToCString());
}
- LongJump* base = isolate->long_jump_base();
- LongJump jump;
- isolate->set_long_jump_base(&jump);
Dart_Handle result = Api::True();
*breakpoint = NULL;
- if (setjmp(*jump.Set()) == 0) {
- Breakpoint* bpt = debugger->SetBreakpointAtEntry(bp_target);
- if (bpt == NULL) {
- const char* target_name = Debugger::QualifiedFunctionName(bp_target);
- result = Api::NewError("%s: no breakpoint location found in '%s'",
+
+ Error& error = Error::Handle();
+ Breakpoint* bpt = debugger->SetBreakpointAtEntry(bp_target, &error);
+ if (!error.IsNull()) {
+ return Api::NewLocalHandle(error);
+ }
+ if (bpt == NULL) {
+ const char* target_name = Debugger::QualifiedFunctionName(bp_target);
+ result = Api::NewError("%s: no breakpoint location found in '%s'",
CURRENT_FUNC, target_name);
- } else {
- *breakpoint = reinterpret_cast<Dart_Breakpoint>(bpt);
- }
} else {
- SetupErrorResult(&result);
+ *breakpoint = reinterpret_cast<Dart_Breakpoint>(bpt);
}
- isolate->set_long_jump_base(base);
return result;
}
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/exceptions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698