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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
700 OS::PrintErr("#%04" Pd " %s\n", num++, frame->ToCString()); | 700 OS::PrintErr("#%04" Pd " %s\n", num++, frame->ToCString()); |
701 frame = iterator.NextFrame(); | 701 frame = iterator.NextFrame(); |
702 } | 702 } |
703 } | 703 } |
704 | 704 |
705 | 705 |
706 void ActivationFrame::VariableAt(intptr_t i, | 706 void ActivationFrame::VariableAt(intptr_t i, |
707 String* name, | 707 String* name, |
708 intptr_t* token_pos, | 708 intptr_t* token_pos, |
709 intptr_t* end_pos, | 709 intptr_t* end_pos, |
710 Instance* value) { | 710 Object* value) { |
711 GetDescIndices(); | 711 GetDescIndices(); |
712 ASSERT(i < desc_indices_.length()); | 712 ASSERT(i < desc_indices_.length()); |
713 intptr_t desc_index = desc_indices_[i]; | 713 intptr_t desc_index = desc_indices_[i]; |
714 ASSERT(name != NULL); | 714 ASSERT(name != NULL); |
715 *name ^= var_descriptors_.GetName(desc_index); | 715 *name ^= var_descriptors_.GetName(desc_index); |
716 RawLocalVarDescriptors::VarInfo var_info; | 716 RawLocalVarDescriptors::VarInfo var_info; |
717 var_descriptors_.GetInfo(desc_index, &var_info); | 717 var_descriptors_.GetInfo(desc_index, &var_info); |
718 ASSERT(token_pos != NULL); | 718 ASSERT(token_pos != NULL); |
719 *token_pos = var_info.begin_pos; | 719 *token_pos = var_info.begin_pos; |
720 ASSERT(end_pos != NULL); | 720 ASSERT(end_pos != NULL); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
760 *value = var_ctx.At(ctx_slot); | 760 *value = var_ctx.At(ctx_slot); |
761 } | 761 } |
762 } | 762 } |
763 } | 763 } |
764 | 764 |
765 | 765 |
766 RawArray* ActivationFrame::GetLocalVariables() { | 766 RawArray* ActivationFrame::GetLocalVariables() { |
767 GetDescIndices(); | 767 GetDescIndices(); |
768 intptr_t num_variables = desc_indices_.length(); | 768 intptr_t num_variables = desc_indices_.length(); |
769 String& var_name = String::Handle(); | 769 String& var_name = String::Handle(); |
770 Instance& value = Instance::Handle(); | 770 Object& value = Instance::Handle(); |
Ivan Posva
2014/11/21 06:21:10
?
| |
771 const Array& list = Array::Handle(Array::New(2 * num_variables)); | 771 const Array& list = Array::Handle(Array::New(2 * num_variables)); |
772 for (intptr_t i = 0; i < num_variables; i++) { | 772 for (intptr_t i = 0; i < num_variables; i++) { |
773 intptr_t ignore; | 773 intptr_t ignore; |
774 VariableAt(i, &var_name, &ignore, &ignore, &value); | 774 VariableAt(i, &var_name, &ignore, &ignore, &value); |
775 list.SetAt(2 * i, var_name); | 775 list.SetAt(2 * i, var_name); |
776 list.SetAt((2 * i) + 1, value); | 776 list.SetAt((2 * i) + 1, value); |
777 } | 777 } |
778 return list.raw(); | 778 return list.raw(); |
779 } | 779 } |
780 | 780 |
(...skipping 14 matching lines...) Expand all Loading... | |
795 } | 795 } |
796 | 796 |
797 | 797 |
798 RawObject* ActivationFrame::Evaluate(const String& expr) { | 798 RawObject* ActivationFrame::Evaluate(const String& expr) { |
799 GetDescIndices(); | 799 GetDescIndices(); |
800 const GrowableObjectArray& param_names = | 800 const GrowableObjectArray& param_names = |
801 GrowableObjectArray::Handle(GrowableObjectArray::New()); | 801 GrowableObjectArray::Handle(GrowableObjectArray::New()); |
802 const GrowableObjectArray& param_values = | 802 const GrowableObjectArray& param_values = |
803 GrowableObjectArray::Handle(GrowableObjectArray::New()); | 803 GrowableObjectArray::Handle(GrowableObjectArray::New()); |
804 String& name = String::Handle(); | 804 String& name = String::Handle(); |
805 Instance& value = Instance::Handle(); | 805 Object& value = Instance::Handle(); |
806 intptr_t num_variables = desc_indices_.length(); | 806 intptr_t num_variables = desc_indices_.length(); |
807 for (intptr_t i = 0; i < num_variables; i++) { | 807 for (intptr_t i = 0; i < num_variables; i++) { |
808 intptr_t ignore; | 808 intptr_t ignore; |
809 VariableAt(i, &name, &ignore, &ignore, &value); | 809 VariableAt(i, &name, &ignore, &ignore, &value); |
810 if (!name.Equals(Symbols::This())) { | 810 if (!name.Equals(Symbols::This())) { |
811 param_names.Add(name); | 811 param_names.Add(name); |
812 param_values.Add(value); | 812 param_values.Add(value); |
813 } | 813 } |
814 } | 814 } |
815 | 815 |
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2485 } | 2485 } |
2486 | 2486 |
2487 | 2487 |
2488 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2488 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
2489 ASSERT(bpt->next() == NULL); | 2489 ASSERT(bpt->next() == NULL); |
2490 bpt->set_next(code_breakpoints_); | 2490 bpt->set_next(code_breakpoints_); |
2491 code_breakpoints_ = bpt; | 2491 code_breakpoints_ = bpt; |
2492 } | 2492 } |
2493 | 2493 |
2494 } // namespace dart | 2494 } // namespace dart |
OLD | NEW |