| 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 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 Object& field_value = Object::Handle(); | 1743 Object& field_value = Object::Handle(); |
| 1744 // Iterate over fields in class hierarchy to count all instance fields. | 1744 // Iterate over fields in class hierarchy to count all instance fields. |
| 1745 while (!cls.IsNull()) { | 1745 while (!cls.IsNull()) { |
| 1746 fields = cls.fields(); | 1746 fields = cls.fields(); |
| 1747 for (intptr_t i = 0; i < fields.Length(); i++) { | 1747 for (intptr_t i = 0; i < fields.Length(); i++) { |
| 1748 field ^= fields.At(i); | 1748 field ^= fields.At(i); |
| 1749 if (!field.is_static()) { | 1749 if (!field.is_static()) { |
| 1750 field_name = field.name(); | 1750 field_name = field.name(); |
| 1751 field_list.Add(field_name); | 1751 field_list.Add(field_name); |
| 1752 field_value = GetInstanceField(cls, field_name, obj); | 1752 field_value = GetInstanceField(cls, field_name, obj); |
| 1753 field_name = String::IdentifierPrettyName(field_name); |
| 1753 field_list.Add(field_value); | 1754 field_list.Add(field_value); |
| 1754 } | 1755 } |
| 1755 } | 1756 } |
| 1756 cls = cls.SuperClass(); | 1757 cls = cls.SuperClass(); |
| 1757 } | 1758 } |
| 1758 return Array::MakeArray(field_list); | 1759 return Array::MakeArray(field_list); |
| 1759 } | 1760 } |
| 1760 | 1761 |
| 1761 | 1762 |
| 1762 RawArray* Debugger::GetStaticFields(const Class& cls) { | 1763 RawArray* Debugger::GetStaticFields(const Class& cls) { |
| 1763 const GrowableObjectArray& field_list = | 1764 const GrowableObjectArray& field_list = |
| 1764 GrowableObjectArray::Handle(GrowableObjectArray::New(8)); | 1765 GrowableObjectArray::Handle(GrowableObjectArray::New(8)); |
| 1765 Array& fields = Array::Handle(cls.fields()); | 1766 Array& fields = Array::Handle(cls.fields()); |
| 1766 Field& field = Field::Handle(); | 1767 Field& field = Field::Handle(); |
| 1767 String& field_name = String::Handle(); | 1768 String& field_name = String::Handle(); |
| 1768 Object& field_value = Object::Handle(); | 1769 Object& field_value = Object::Handle(); |
| 1769 for (intptr_t i = 0; i < fields.Length(); i++) { | 1770 for (intptr_t i = 0; i < fields.Length(); i++) { |
| 1770 field ^= fields.At(i); | 1771 field ^= fields.At(i); |
| 1771 if (field.is_static()) { | 1772 if (field.is_static()) { |
| 1772 field_name = field.name(); | 1773 field_name = field.name(); |
| 1773 field_value = GetStaticField(cls, field_name); | 1774 field_value = GetStaticField(cls, field_name); |
| 1775 field_name = String::IdentifierPrettyName(field_name); |
| 1774 field_list.Add(field_name); | 1776 field_list.Add(field_name); |
| 1775 field_list.Add(field_value); | 1777 field_list.Add(field_value); |
| 1776 } | 1778 } |
| 1777 } | 1779 } |
| 1778 return Array::MakeArray(field_list); | 1780 return Array::MakeArray(field_list); |
| 1779 } | 1781 } |
| 1780 | 1782 |
| 1781 | 1783 |
| 1782 void Debugger::CollectLibraryFields(const GrowableObjectArray& field_list, | 1784 void Debugger::CollectLibraryFields(const GrowableObjectArray& field_list, |
| 1783 const Library& lib, | 1785 const Library& lib, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1797 ASSERT(field.is_static()); | 1799 ASSERT(field.is_static()); |
| 1798 field_name = field.name(); | 1800 field_name = field.name(); |
| 1799 if ((field_name.CharAt(0) == '_') && !include_private_fields) { | 1801 if ((field_name.CharAt(0) == '_') && !include_private_fields) { |
| 1800 // Skip library-private field. | 1802 // Skip library-private field. |
| 1801 continue; | 1803 continue; |
| 1802 } | 1804 } |
| 1803 field_value = GetStaticField(cls, field_name); | 1805 field_value = GetStaticField(cls, field_name); |
| 1804 if (!prefix.IsNull()) { | 1806 if (!prefix.IsNull()) { |
| 1805 field_name = String::Concat(prefix, field_name); | 1807 field_name = String::Concat(prefix, field_name); |
| 1806 } | 1808 } |
| 1809 field_name = String::IdentifierPrettyName(field_name); |
| 1807 field_list.Add(field_name); | 1810 field_list.Add(field_name); |
| 1808 field_list.Add(field_value); | 1811 field_list.Add(field_value); |
| 1809 } | 1812 } |
| 1810 } | 1813 } |
| 1811 } | 1814 } |
| 1812 | 1815 |
| 1813 | 1816 |
| 1814 RawArray* Debugger::GetLibraryFields(const Library& lib) { | 1817 RawArray* Debugger::GetLibraryFields(const Library& lib) { |
| 1815 const GrowableObjectArray& field_list = | 1818 const GrowableObjectArray& field_list = |
| 1816 GrowableObjectArray::Handle(GrowableObjectArray::New(8)); | 1819 GrowableObjectArray::Handle(GrowableObjectArray::New(8)); |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 } | 2230 } |
| 2228 | 2231 |
| 2229 | 2232 |
| 2230 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2233 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2231 ASSERT(bpt->next() == NULL); | 2234 ASSERT(bpt->next() == NULL); |
| 2232 bpt->set_next(code_breakpoints_); | 2235 bpt->set_next(code_breakpoints_); |
| 2233 code_breakpoints_ = bpt; | 2236 code_breakpoints_ = bpt; |
| 2234 } | 2237 } |
| 2235 | 2238 |
| 2236 } // namespace dart | 2239 } // namespace dart |
| OLD | NEW |