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

Unified Diff: runtime/vm/debugger.cc

Issue 470353003: Detect compile errors when setting breakpoint (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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 39377)
+++ runtime/vm/debugger.cc (working copy)
@@ -1176,18 +1176,17 @@
}
-void Debugger::SetInternalBreakpoints(const Function& target_function) {
+RawError* Debugger::SetInternalBreakpoints(const Function& target_function) {
if (target_function.is_native()) {
- // Can't instrument native functions.
- return;
+ // Can't instrument native functions. Fail silently.
+ return Error::null();
}
Isolate* isolate = Isolate::Current();
if (!target_function.HasCode()) {
- Compiler::CompileFunction(isolate, target_function);
- // If there were any errors, ignore them silently and return without
- // adding breakpoints to target.
- if (!target_function.HasCode()) {
- return;
+ const Error& error = Error::Handle(
+ Compiler::CompileFunction(isolate, target_function));
+ if (!error.IsNull()) {
+ return error.raw();
}
}
// Hang on to the code object before deoptimizing, in case deoptimization
@@ -1213,6 +1212,7 @@
bpt->Enable();
}
}
+ return Error::null();
}
@@ -1872,13 +1872,15 @@
}
-void Debugger::OneTimeBreakAtEntry(const Function& target_function) {
- SetInternalBreakpoints(target_function);
- if (target_function.HasImplicitClosureFunction()) {
+RawError* Debugger::OneTimeBreakAtEntry(const Function& target_function) {
+ Error& err = Error::Handle();
+ err = SetInternalBreakpoints(target_function);
+ if (err.IsNull() && target_function.HasImplicitClosureFunction()) {
const Function& closure_func =
Function::Handle(target_function.ImplicitClosureFunction());
- SetInternalBreakpoints(closure_func);
+ err = SetInternalBreakpoints(closure_func);
}
+ return err.raw();
}
« 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