Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: runtime/vm/debugger.cc

Issue 79773003: Revert "De-mangle private identifiers returned by the debugger API." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/debugger_api_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 Object& field_value = Object::Handle(); 1742 Object& field_value = Object::Handle();
1743 // Iterate over fields in class hierarchy to count all instance fields. 1743 // Iterate over fields in class hierarchy to count all instance fields.
1744 while (!cls.IsNull()) { 1744 while (!cls.IsNull()) {
1745 fields = cls.fields(); 1745 fields = cls.fields();
1746 for (intptr_t i = 0; i < fields.Length(); i++) { 1746 for (intptr_t i = 0; i < fields.Length(); i++) {
1747 field ^= fields.At(i); 1747 field ^= fields.At(i);
1748 if (!field.is_static()) { 1748 if (!field.is_static()) {
1749 field_name = field.name(); 1749 field_name = field.name();
1750 field_list.Add(field_name); 1750 field_list.Add(field_name);
1751 field_value = GetInstanceField(cls, field_name, obj); 1751 field_value = GetInstanceField(cls, field_name, obj);
1752 field_name = String::IdentifierPrettyName(field_name);
1753 field_list.Add(field_value); 1752 field_list.Add(field_value);
1754 } 1753 }
1755 } 1754 }
1756 cls = cls.SuperClass(); 1755 cls = cls.SuperClass();
1757 } 1756 }
1758 return Array::MakeArray(field_list); 1757 return Array::MakeArray(field_list);
1759 } 1758 }
1760 1759
1761 1760
1762 RawArray* Debugger::GetStaticFields(const Class& cls) { 1761 RawArray* Debugger::GetStaticFields(const Class& cls) {
1763 const GrowableObjectArray& field_list = 1762 const GrowableObjectArray& field_list =
1764 GrowableObjectArray::Handle(GrowableObjectArray::New(8)); 1763 GrowableObjectArray::Handle(GrowableObjectArray::New(8));
1765 Array& fields = Array::Handle(cls.fields()); 1764 Array& fields = Array::Handle(cls.fields());
1766 Field& field = Field::Handle(); 1765 Field& field = Field::Handle();
1767 String& field_name = String::Handle(); 1766 String& field_name = String::Handle();
1768 Object& field_value = Object::Handle(); 1767 Object& field_value = Object::Handle();
1769 for (intptr_t i = 0; i < fields.Length(); i++) { 1768 for (intptr_t i = 0; i < fields.Length(); i++) {
1770 field ^= fields.At(i); 1769 field ^= fields.At(i);
1771 if (field.is_static()) { 1770 if (field.is_static()) {
1772 field_name = field.name(); 1771 field_name = field.name();
1773 field_value = GetStaticField(cls, field_name); 1772 field_value = GetStaticField(cls, field_name);
1774 field_name = String::IdentifierPrettyName(field_name);
1775 field_list.Add(field_name); 1773 field_list.Add(field_name);
1776 field_list.Add(field_value); 1774 field_list.Add(field_value);
1777 } 1775 }
1778 } 1776 }
1779 return Array::MakeArray(field_list); 1777 return Array::MakeArray(field_list);
1780 } 1778 }
1781 1779
1782 1780
1783 void Debugger::CollectLibraryFields(const GrowableObjectArray& field_list, 1781 void Debugger::CollectLibraryFields(const GrowableObjectArray& field_list,
1784 const Library& lib, 1782 const Library& lib,
(...skipping 13 matching lines...) Expand all
1798 ASSERT(field.is_static()); 1796 ASSERT(field.is_static());
1799 field_name = field.name(); 1797 field_name = field.name();
1800 if ((field_name.CharAt(0) == '_') && !include_private_fields) { 1798 if ((field_name.CharAt(0) == '_') && !include_private_fields) {
1801 // Skip library-private field. 1799 // Skip library-private field.
1802 continue; 1800 continue;
1803 } 1801 }
1804 field_value = GetStaticField(cls, field_name); 1802 field_value = GetStaticField(cls, field_name);
1805 if (!prefix.IsNull()) { 1803 if (!prefix.IsNull()) {
1806 field_name = String::Concat(prefix, field_name); 1804 field_name = String::Concat(prefix, field_name);
1807 } 1805 }
1808 field_name = String::IdentifierPrettyName(field_name);
1809 field_list.Add(field_name); 1806 field_list.Add(field_name);
1810 field_list.Add(field_value); 1807 field_list.Add(field_value);
1811 } 1808 }
1812 } 1809 }
1813 } 1810 }
1814 1811
1815 1812
1816 RawArray* Debugger::GetLibraryFields(const Library& lib) { 1813 RawArray* Debugger::GetLibraryFields(const Library& lib) {
1817 const GrowableObjectArray& field_list = 1814 const GrowableObjectArray& field_list =
1818 GrowableObjectArray::Handle(GrowableObjectArray::New(8)); 1815 GrowableObjectArray::Handle(GrowableObjectArray::New(8));
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
2229 } 2226 }
2230 2227
2231 2228
2232 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 2229 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
2233 ASSERT(bpt->next() == NULL); 2230 ASSERT(bpt->next() == NULL);
2234 bpt->set_next(code_breakpoints_); 2231 bpt->set_next(code_breakpoints_);
2235 code_breakpoints_ = bpt; 2232 code_breakpoints_ = bpt;
2236 } 2233 }
2237 2234
2238 } // namespace dart 2235 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/debugger_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698