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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |