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

Unified Diff: runtime/vm/debugger_api_impl.cc

Issue 11926026: Add function for one-time stop at function entry (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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') | no next file » | 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 17321)
+++ runtime/vm/debugger_api_impl.cc (working copy)
@@ -361,6 +361,42 @@
}
+DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(
+ Dart_Handle library_in,
+ Dart_Handle class_name_in,
+ Dart_Handle function_name_in) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ UNWRAP_AND_CHECK_PARAM(Library, library, library_in);
+ UNWRAP_AND_CHECK_PARAM(String, class_name, class_name_in);
+ UNWRAP_AND_CHECK_PARAM(String, function_name, function_name_in);
+
+ const char* msg = CheckIsolateState(isolate);
+ if (msg != NULL) {
+ return Api::NewError("%s", msg);
+ }
+
+ // Resolve the breakpoint target function.
+ Debugger* debugger = isolate->debugger();
+ const Function& bp_target = Function::Handle(
+ debugger->ResolveFunction(library, class_name, function_name));
+ if (bp_target.IsNull()) {
+ const bool toplevel = class_name.Length() == 0;
+ return Api::NewError("%s: could not find function '%s%s%s'",
+ CURRENT_FUNC,
+ toplevel ? "" : class_name.ToCString(),
+ toplevel ? "" : ".",
+ function_name.ToCString());
+ }
+
+ debugger->OneTimeBreakAtEntry(bp_target);
+ return Api::True(isolate);
+}
+
+
+
+
+
DART_EXPORT Dart_Handle Dart_RemoveBreakpoint(intptr_t bp_id) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698