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

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

Issue 23484020: Update handling of ambiguous name references (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | « runtime/vm/dart_entry_test.cc ('k') | runtime/vm/exceptions.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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 } 822 }
823 // Signal isolate shutdown event. 823 // Signal isolate shutdown event.
824 SignalIsolateEvent(Debugger::kIsolateShutdown); 824 SignalIsolateEvent(Debugger::kIsolateShutdown);
825 } 825 }
826 826
827 827
828 static RawFunction* ResolveLibraryFunction( 828 static RawFunction* ResolveLibraryFunction(
829 const Library& library, 829 const Library& library,
830 const String& fname) { 830 const String& fname) {
831 ASSERT(!library.IsNull()); 831 ASSERT(!library.IsNull());
832 String& ambiguity_error_msg = String::Handle(); 832 const Object& object = Object::Handle(library.LookupObject(fname));
833 const Object& object = Object::Handle(
834 library.LookupObject(fname, &ambiguity_error_msg));
835 if (!object.IsNull() && object.IsFunction()) { 833 if (!object.IsNull() && object.IsFunction()) {
836 return Function::Cast(object).raw(); 834 return Function::Cast(object).raw();
837 } 835 }
838 return Function::null(); 836 return Function::null();
839 } 837 }
840 838
841 void Debugger::SetSingleStep() { 839 void Debugger::SetSingleStep() {
842 isolate_->set_single_step(true); 840 isolate_->set_single_step(true);
843 resume_action_ = kSingleStep; 841 resume_action_ = kSingleStep;
844 } 842 }
(...skipping 10 matching lines...) Expand all
855 853
856 RawFunction* Debugger::ResolveFunction(const Library& library, 854 RawFunction* Debugger::ResolveFunction(const Library& library,
857 const String& class_name, 855 const String& class_name,
858 const String& function_name) { 856 const String& function_name) {
859 ASSERT(!library.IsNull()); 857 ASSERT(!library.IsNull());
860 ASSERT(!class_name.IsNull()); 858 ASSERT(!class_name.IsNull());
861 ASSERT(!function_name.IsNull()); 859 ASSERT(!function_name.IsNull());
862 if (class_name.Length() == 0) { 860 if (class_name.Length() == 0) {
863 return ResolveLibraryFunction(library, function_name); 861 return ResolveLibraryFunction(library, function_name);
864 } 862 }
865 String& ambiguity_error_msg = String::Handle(); 863 const Class& cls = Class::Handle(library.LookupClass(class_name));
866 const Class& cls = Class::Handle(
867 library.LookupClass(class_name, &ambiguity_error_msg));
868 Function& function = Function::Handle(); 864 Function& function = Function::Handle();
869 if (!cls.IsNull()) { 865 if (!cls.IsNull()) {
870 function = cls.LookupStaticFunction(function_name); 866 function = cls.LookupStaticFunction(function_name);
871 if (function.IsNull()) { 867 if (function.IsNull()) {
872 function = cls.LookupDynamicFunction(function_name); 868 function = cls.LookupDynamicFunction(function_name);
873 } 869 }
874 } 870 }
875 return function.raw(); 871 return function.raw();
876 } 872 }
877 873
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 } 1877 }
1882 1878
1883 1879
1884 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 1880 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
1885 ASSERT(bpt->next() == NULL); 1881 ASSERT(bpt->next() == NULL);
1886 bpt->set_next(code_breakpoints_); 1882 bpt->set_next(code_breakpoints_);
1887 code_breakpoints_ = bpt; 1883 code_breakpoints_ = bpt;
1888 } 1884 }
1889 1885
1890 } // namespace dart 1886 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_entry_test.cc ('k') | runtime/vm/exceptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698