| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/debugger.h" | 5 #include "vm/debugger.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 return true; | 845 return true; |
| 846 } | 846 } |
| 847 if (class_name.Equals("AssertionErrorImplementation")) { | 847 if (class_name.Equals("AssertionErrorImplementation")) { |
| 848 return true; | 848 return true; |
| 849 } | 849 } |
| 850 return false; | 850 return false; |
| 851 } | 851 } |
| 852 | 852 |
| 853 | 853 |
| 854 void Debugger::SignalExceptionThrown(const Object& exc) { | 854 void Debugger::SignalExceptionThrown(const Object& exc) { |
| 855 // We ignore this exception event when the VM is executing code invoked |
| 856 // by the debugger to evaluate variables values, when we see a nested |
| 857 // breakpoint or exception event, or if the debugger is not |
| 858 // interested in exception events. |
| 855 if (ignore_breakpoints_ || | 859 if (ignore_breakpoints_ || |
| 860 (stack_trace_ != NULL) || |
| 856 (event_handler_ == NULL) || | 861 (event_handler_ == NULL) || |
| 857 (exc_pause_info_ == kNoPauseOnExceptions)) { | 862 (exc_pause_info_ == kNoPauseOnExceptions)) { |
| 858 return; | 863 return; |
| 859 } | 864 } |
| 860 DebuggerStackTrace* stack_trace = CollectStackTrace(); | 865 DebuggerStackTrace* stack_trace = CollectStackTrace(); |
| 861 if (!ShouldPauseOnException(stack_trace, exc)) { | 866 if (!ShouldPauseOnException(stack_trace, exc)) { |
| 862 return; | 867 return; |
| 863 } | 868 } |
| 864 // No single-stepping possible after this pause event. | 869 // No single-stepping possible after this pause event. |
| 865 last_bpt_line_ = -1; | 870 last_bpt_line_ = -1; |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 (fkind == RawFunction::kConstImplicitGetter)) { | 1330 (fkind == RawFunction::kConstImplicitGetter)) { |
| 1326 return false; | 1331 return false; |
| 1327 } | 1332 } |
| 1328 const Class& cls = Class::Handle(func.Owner()); | 1333 const Class& cls = Class::Handle(func.Owner()); |
| 1329 const Library& lib = Library::Handle(cls.library()); | 1334 const Library& lib = Library::Handle(cls.library()); |
| 1330 return lib.IsDebuggable(); | 1335 return lib.IsDebuggable(); |
| 1331 } | 1336 } |
| 1332 | 1337 |
| 1333 | 1338 |
| 1334 void Debugger::SignalBpReached() { | 1339 void Debugger::SignalBpReached() { |
| 1335 if (ignore_breakpoints_) { | 1340 // We ignore this breakpoint when the VM is executing code invoked |
| 1341 // by the debugger to evaluate variables values, or when we see a nested |
| 1342 // breakpoint or exception event. |
| 1343 if (ignore_breakpoints_ || (stack_trace_ != NULL)) { |
| 1336 return; | 1344 return; |
| 1337 } | 1345 } |
| 1338 DebuggerStackTrace* stack_trace = CollectStackTrace(); | 1346 DebuggerStackTrace* stack_trace = CollectStackTrace(); |
| 1339 ASSERT(stack_trace->Length() > 0); | 1347 ASSERT(stack_trace->Length() > 0); |
| 1340 ActivationFrame* top_frame = stack_trace->ActivationFrameAt(0); | 1348 ActivationFrame* top_frame = stack_trace->ActivationFrameAt(0); |
| 1341 ASSERT(top_frame != NULL); | 1349 ASSERT(top_frame != NULL); |
| 1342 CodeBreakpoint* bpt = GetCodeBreakpoint(top_frame->pc()); | 1350 CodeBreakpoint* bpt = GetCodeBreakpoint(top_frame->pc()); |
| 1343 ASSERT(bpt != NULL); | 1351 ASSERT(bpt != NULL); |
| 1344 if (FLAG_verbose_debug) { | 1352 if (FLAG_verbose_debug) { |
| 1345 OS::Print(">>> hit %s breakpoint at %s:%"Pd" (Address %#"Px")\n", | 1353 OS::Print(">>> hit %s breakpoint at %s:%"Pd" (Address %#"Px")\n", |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1629 } | 1637 } |
| 1630 | 1638 |
| 1631 | 1639 |
| 1632 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 1640 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 1633 ASSERT(bpt->next() == NULL); | 1641 ASSERT(bpt->next() == NULL); |
| 1634 bpt->set_next(code_breakpoints_); | 1642 bpt->set_next(code_breakpoints_); |
| 1635 code_breakpoints_ = bpt; | 1643 code_breakpoints_ = bpt; |
| 1636 } | 1644 } |
| 1637 | 1645 |
| 1638 } // namespace dart | 1646 } // namespace dart |
| OLD | NEW |