| 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 28 matching lines...) Expand all Loading... |
| 39 "Trace debugger stacktrace collection"); | 39 "Trace debugger stacktrace collection"); |
| 40 DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages"); | 40 DEFINE_FLAG(bool, verbose_debug, false, "Verbose debugger messages"); |
| 41 DEFINE_FLAG(bool, steal_breakpoints, false, | 41 DEFINE_FLAG(bool, steal_breakpoints, false, |
| 42 "Intercept breakpoints and other pause events before they " | 42 "Intercept breakpoints and other pause events before they " |
| 43 "are sent to the embedder and use a generic VM breakpoint " | 43 "are sent to the embedder and use a generic VM breakpoint " |
| 44 "handler instead. This handler dispatches breakpoints to " | 44 "handler instead. This handler dispatches breakpoints to " |
| 45 "the VM service."); | 45 "the VM service."); |
| 46 | 46 |
| 47 DECLARE_FLAG(bool, trace_isolates); | 47 DECLARE_FLAG(bool, trace_isolates); |
| 48 DECLARE_FLAG(bool, warn_on_pause_with_no_debugger); | 48 DECLARE_FLAG(bool, warn_on_pause_with_no_debugger); |
| 49 DECLARE_FLAG(bool, precompilation); | |
| 50 | 49 |
| 51 | 50 |
| 52 #ifndef PRODUCT | 51 #ifndef PRODUCT |
| 53 | 52 |
| 54 Debugger::EventHandler* Debugger::event_handler_ = NULL; | 53 Debugger::EventHandler* Debugger::event_handler_ = NULL; |
| 55 | 54 |
| 56 | 55 |
| 57 class RemoteObjectCache : public ZoneAllocated { | 56 class RemoteObjectCache : public ZoneAllocated { |
| 58 public: | 57 public: |
| 59 explicit RemoteObjectCache(intptr_t initial_size); | 58 explicit RemoteObjectCache(intptr_t initial_size); |
| (...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1511 for (StackFrame* frame = iterator.NextFrame(); | 1510 for (StackFrame* frame = iterator.NextFrame(); |
| 1512 frame != NULL; | 1511 frame != NULL; |
| 1513 frame = iterator.NextFrame()) { | 1512 frame = iterator.NextFrame()) { |
| 1514 ASSERT(frame->IsValid()); | 1513 ASSERT(frame->IsValid()); |
| 1515 if (FLAG_trace_debugger_stacktrace) { | 1514 if (FLAG_trace_debugger_stacktrace) { |
| 1516 OS::PrintErr("CollectStackTrace: visiting frame:\n\t%s\n", | 1515 OS::PrintErr("CollectStackTrace: visiting frame:\n\t%s\n", |
| 1517 frame->ToCString()); | 1516 frame->ToCString()); |
| 1518 } | 1517 } |
| 1519 if (frame->IsDartFrame()) { | 1518 if (frame->IsDartFrame()) { |
| 1520 code = frame->LookupDartCode(); | 1519 code = frame->LookupDartCode(); |
| 1521 if (code.is_optimized() && !FLAG_precompilation) { | 1520 if (code.is_optimized() && !FLAG_precompiled_mode) { |
| 1522 deopt_frame = DeoptimizeToArray(thread, frame, code); | 1521 deopt_frame = DeoptimizeToArray(thread, frame, code); |
| 1523 for (InlinedFunctionsIterator it(code, frame->pc()); | 1522 for (InlinedFunctionsIterator it(code, frame->pc()); |
| 1524 !it.Done(); | 1523 !it.Done(); |
| 1525 it.Advance()) { | 1524 it.Advance()) { |
| 1526 inlined_code = it.code(); | 1525 inlined_code = it.code(); |
| 1527 if (FLAG_trace_debugger_stacktrace) { | 1526 if (FLAG_trace_debugger_stacktrace) { |
| 1528 const Function& function = | 1527 const Function& function = |
| 1529 Function::Handle(zone, inlined_code.function()); | 1528 Function::Handle(zone, inlined_code.function()); |
| 1530 ASSERT(!function.IsNull()); | 1529 ASSERT(!function.IsNull()); |
| 1531 OS::PrintErr("CollectStackTrace: visiting inlined function: %s\n", | 1530 OS::PrintErr("CollectStackTrace: visiting inlined function: %s\n", |
| (...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3342 | 3341 |
| 3343 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3342 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 3344 ASSERT(bpt->next() == NULL); | 3343 ASSERT(bpt->next() == NULL); |
| 3345 bpt->set_next(code_breakpoints_); | 3344 bpt->set_next(code_breakpoints_); |
| 3346 code_breakpoints_ = bpt; | 3345 code_breakpoints_ = bpt; |
| 3347 } | 3346 } |
| 3348 | 3347 |
| 3349 #endif // !PRODUCT | 3348 #endif // !PRODUCT |
| 3350 | 3349 |
| 3351 } // namespace dart | 3350 } // namespace dart |
| OLD | NEW |