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

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

Issue 10009023: Fix static field inspection in debugger (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 months 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_test.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 "vm/code_index_table.h" 7 #include "vm/code_index_table.h"
8 #include "vm/code_generator.h" 8 #include "vm/code_generator.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 result = isolate_->object_store()->sticky_error(); 730 result = isolate_->object_store()->sticky_error();
731 } 731 }
732 ignore_breakpoints_ = saved_ignore_flag; 732 ignore_breakpoints_ = saved_ignore_flag;
733 isolate_->set_long_jump_base(base); 733 isolate_->set_long_jump_base(base);
734 return result.raw(); 734 return result.raw();
735 } 735 }
736 736
737 737
738 RawObject* Debugger::GetStaticField(const Class& cls, 738 RawObject* Debugger::GetStaticField(const Class& cls,
739 const String& field_name) { 739 const String& field_name) {
740 const Field& fld = Field::Handle(cls.LookupStaticField(field_name));
741 if (!fld.IsNull()) {
742 // Return the value in the field if it has been initialized already.
743 const Instance& value = Instance::Handle(fld.value());
744 ASSERT(value.raw() != Object::transition_sentinel());
745 if (value.raw() != Object::sentinel()) {
746 return value.raw();
747 }
748 }
749 // There is no field or the field has not been initialized yet.
750 // We must have a getter. Run the getter.
740 const Function& getter_func = 751 const Function& getter_func =
741 Function::Handle(cls.LookupGetterFunction(field_name)); 752 Function::Handle(cls.LookupGetterFunction(field_name));
742 ASSERT(!getter_func.IsNull()); 753 ASSERT(!getter_func.IsNull());
754 if (getter_func.IsNull()) {
regis 2012/04/05 22:33:05 This contradicts the assert above. Left over debug
hausner 2012/04/05 22:45:30 I did this on purpose. Maybe it's not good style.
regis 2012/04/05 23:03:07 Don't you want to know that something is fishy in
755 return Object::null();
756 }
743 757
744 Object& result = Object::Handle(); 758 Object& result = Object::Handle();
745 LongJump* base = isolate_->long_jump_base(); 759 LongJump* base = isolate_->long_jump_base();
746 LongJump jump; 760 LongJump jump;
747 isolate_->set_long_jump_base(&jump); 761 isolate_->set_long_jump_base(&jump);
748 bool saved_ignore_flag = ignore_breakpoints_; 762 bool saved_ignore_flag = ignore_breakpoints_;
749 ignore_breakpoints_ = true; 763 ignore_breakpoints_ = true;
750 if (setjmp(*jump.Set()) == 0) { 764 if (setjmp(*jump.Set()) == 0) {
751 GrowableArray<const Object*> noArguments; 765 GrowableArray<const Object*> noArguments;
752 const Array& noArgumentNames = Array::Handle(); 766 const Array& noArgumentNames = Array::Handle();
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 } 1098 }
1085 1099
1086 1100
1087 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 1101 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
1088 ASSERT(bpt->next() == NULL); 1102 ASSERT(bpt->next() == NULL);
1089 bpt->set_next(code_breakpoints_); 1103 bpt->set_next(code_breakpoints_);
1090 code_breakpoints_ = bpt; 1104 code_breakpoints_ = bpt;
1091 } 1105 }
1092 1106
1093 } // namespace dart 1107 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/debugger_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698