| 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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 447 |
| 448 RawContext* ActivationFrame::GetSavedEntryContext() { | 448 RawContext* ActivationFrame::GetSavedEntryContext() { |
| 449 // Attempt to find a saved context. | 449 // Attempt to find a saved context. |
| 450 GetVarDescriptors(); | 450 GetVarDescriptors(); |
| 451 intptr_t var_desc_len = var_descriptors_.Length(); | 451 intptr_t var_desc_len = var_descriptors_.Length(); |
| 452 for (intptr_t i = 0; i < var_desc_len; i++) { | 452 for (intptr_t i = 0; i < var_desc_len; i++) { |
| 453 RawLocalVarDescriptors::VarInfo var_info; | 453 RawLocalVarDescriptors::VarInfo var_info; |
| 454 var_descriptors_.GetInfo(i, &var_info); | 454 var_descriptors_.GetInfo(i, &var_info); |
| 455 if (var_info.kind == RawLocalVarDescriptors::kSavedEntryContext) { | 455 if (var_info.kind == RawLocalVarDescriptors::kSavedEntryContext) { |
| 456 if (FLAG_trace_debugger_stacktrace) { | 456 if (FLAG_trace_debugger_stacktrace) { |
| 457 OS::PrintErr("\tFound saved entry ctx at index %" Pd "\n", | 457 OS::PrintErr("\tFound saved entry ctx at index %d\n", var_info.index); |
| 458 var_info.index); | |
| 459 } | 458 } |
| 460 return GetLocalContextVar(var_info.index); | 459 return GetLocalContextVar(var_info.index); |
| 461 } | 460 } |
| 462 } | 461 } |
| 463 | 462 |
| 464 // No saved context. Return the current context. | 463 // No saved context. Return the current context. |
| 465 return ctx_.raw(); | 464 return ctx_.raw(); |
| 466 } | 465 } |
| 467 | 466 |
| 468 | 467 |
| 469 // Get the saved context if the callee of this activation frame is a | 468 // Get the saved context if the callee of this activation frame is a |
| 470 // closure function. | 469 // closure function. |
| 471 RawContext* ActivationFrame::GetSavedCurrentContext() { | 470 RawContext* ActivationFrame::GetSavedCurrentContext() { |
| 472 GetVarDescriptors(); | 471 GetVarDescriptors(); |
| 473 intptr_t var_desc_len = var_descriptors_.Length(); | 472 intptr_t var_desc_len = var_descriptors_.Length(); |
| 474 for (intptr_t i = 0; i < var_desc_len; i++) { | 473 for (intptr_t i = 0; i < var_desc_len; i++) { |
| 475 RawLocalVarDescriptors::VarInfo var_info; | 474 RawLocalVarDescriptors::VarInfo var_info; |
| 476 var_descriptors_.GetInfo(i, &var_info); | 475 var_descriptors_.GetInfo(i, &var_info); |
| 477 if (var_info.kind == RawLocalVarDescriptors::kSavedCurrentContext) { | 476 if (var_info.kind == RawLocalVarDescriptors::kSavedCurrentContext) { |
| 478 if (FLAG_trace_debugger_stacktrace) { | 477 if (FLAG_trace_debugger_stacktrace) { |
| 479 OS::PrintErr("\tFound saved current ctx at index %" Pd "\n", | 478 OS::PrintErr("\tFound saved current ctx at index %d\n", var_info.index); |
| 480 var_info.index); | |
| 481 } | 479 } |
| 482 return GetLocalContextVar(var_info.index); | 480 return GetLocalContextVar(var_info.index); |
| 483 } | 481 } |
| 484 } | 482 } |
| 485 UNREACHABLE(); | 483 UNREACHABLE(); |
| 486 return Context::null(); | 484 return Context::null(); |
| 487 } | 485 } |
| 488 | 486 |
| 489 | 487 |
| 490 const char* DebuggerEvent::EventTypeToCString(EventType type) { | 488 const char* DebuggerEvent::EventTypeToCString(EventType type) { |
| (...skipping 2072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2563 } | 2561 } |
| 2564 | 2562 |
| 2565 | 2563 |
| 2566 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2564 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2567 ASSERT(bpt->next() == NULL); | 2565 ASSERT(bpt->next() == NULL); |
| 2568 bpt->set_next(code_breakpoints_); | 2566 bpt->set_next(code_breakpoints_); |
| 2569 code_breakpoints_ = bpt; | 2567 code_breakpoints_ = bpt; |
| 2570 } | 2568 } |
| 2571 | 2569 |
| 2572 } // namespace dart | 2570 } // namespace dart |
| OLD | NEW |