Chromium Code Reviews| Index: runtime/vm/debugger.cc |
| =================================================================== |
| --- runtime/vm/debugger.cc (revision 15742) |
| +++ runtime/vm/debugger.cc (working copy) |
| @@ -956,7 +956,7 @@ |
| EnsureFunctionIsDeoptimized(target_function); |
| CodeBreakpoint* cbpt = NULL; |
| - SourceBreakpoint* bpt = NULL; |
| + SourceBreakpoint* source_bpt = NULL; |
| if (target_function.HasCode()) { |
| cbpt = MakeCodeBreakpoint(target_function, first_token_pos, last_token_pos); |
| if (cbpt != NULL) { |
| @@ -973,35 +973,50 @@ |
| first_token_pos = cbpt->token_pos(); |
| } |
| } else { |
| - bpt = GetSourceBreakpoint(target_function, first_token_pos); |
| - if (bpt != NULL) { |
| + source_bpt = GetSourceBreakpoint(target_function, first_token_pos); |
| + if (source_bpt != NULL) { |
| // A source breakpoint for this uncompiled location already |
| // exists. |
| - return bpt; |
| + return source_bpt; |
| } |
| } |
| - bpt = new SourceBreakpoint(nextId(), target_function, first_token_pos); |
| - RegisterSourceBreakpoint(bpt); |
| + source_bpt = new SourceBreakpoint(nextId(), target_function, first_token_pos); |
| + RegisterSourceBreakpoint(source_bpt); |
| if (FLAG_verbose_debug && !target_function.HasCode()) { |
| OS::Print("Registering breakpoint for " |
| "uncompiled function '%s' at line %"Pd"\n", |
| target_function.ToFullyQualifiedCString(), |
| - bpt->LineNumber()); |
| + source_bpt->LineNumber()); |
| } |
| if (cbpt != NULL) { |
| ASSERT(cbpt->src_bpt() == NULL); |
| - cbpt->set_src_bpt(bpt); |
| - SignalBpResolved(bpt); |
| + cbpt->set_src_bpt(source_bpt); |
| + SignalBpResolved(source_bpt); |
| } else { |
| if (FLAG_verbose_debug) { |
| OS::Print("Failed to set breakpoint at '%s' line %"Pd"\n", |
| - String::Handle(bpt->SourceUrl()).ToCString(), |
| - bpt->LineNumber()); |
| + String::Handle(source_bpt->SourceUrl()).ToCString(), |
| + source_bpt->LineNumber()); |
| } |
| } |
| - bpt->Enable(); |
| - return bpt; |
| + |
| + if (target_function.implicit_closure_function() != Function::null()) { |
|
regis
2012/12/05 22:54:34
You use implicit_closure_function() and ImplicitCl
hausner
2012/12/05 23:04:13
Done.
|
| + // There is a closureized version of this function. If the closure |
|
regis
2012/12/05 22:54:34
closurized
hausner
2012/12/05 23:04:13
Done.
|
| + // is already compiled, we need to set a code breakpoint in its |
| + // code. |
| + const Function& closure = |
| + Function::Handle(target_function.ImplicitClosureFunction()); |
| + if (closure.HasCode()) { |
| + CodeBreakpoint* closure_bpt = |
| + MakeCodeBreakpoint(closure, first_token_pos, last_token_pos); |
| + if ((closure_bpt != NULL) && (closure_bpt->src_bpt() == NULL)) { |
| + closure_bpt->set_src_bpt(source_bpt); |
| + } |
| + } |
| + } |
| + source_bpt->Enable(); |
| + return source_bpt; |
| } |