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

Unified Diff: runtime/vm/debugger.cc

Issue 1191133002: UI for setting/clearing closure-specific breakpoints. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index e3b24458f8e30372752224dc9c2a205a25dbc5e1..0364ac8281541cec2f5a0e26e9d6976a441c0082 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -1966,17 +1966,39 @@ Breakpoint* Debugger::SetBreakpointAtEntry(const Function& target_function,
}
-Breakpoint* Debugger::SetBreakpointAtActivation(
- const Instance& closure) {
+Breakpoint* Debugger::SetBreakpointAtActivation(const Instance& closure) {
if (!closure.IsClosure()) {
return NULL;
}
const Function& func = Function::Handle(Closure::function(closure));
const Script& script = Script::Handle(func.script());
- BreakpointLocation* bpt = SetBreakpoint(script,
- func.token_pos(),
- func.end_token_pos());
- return bpt->AddPerClosure(this, closure);
+ BreakpointLocation* bpt_location = SetBreakpoint(script,
+ func.token_pos(),
+ func.end_token_pos());
+ return bpt_location->AddPerClosure(this, closure);
+}
+
+
+Breakpoint* Debugger::BreakpointAtActivation(const Instance& closure) {
+ if (!closure.IsClosure()) {
+ return NULL;
+ }
+
+ BreakpointLocation* loc = breakpoint_locations_;
+ while (loc != NULL) {
+ Breakpoint* bpt = loc->breakpoints();
+ while (bpt != NULL) {
+ if (bpt->IsPerClosure()) {
+ if (closure.raw() == bpt->closure()) {
+ return bpt;
+ }
+ }
+ bpt = bpt->next();
+ }
+ loc = loc->next();
+ }
+
+ return NULL;
}
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698