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 "vm/code_generator.h" | 7 #include "vm/code_generator.h" |
8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 const Function& target_function) { | 718 const Function& target_function) { |
719 ASSERT(!target_function.IsNull()); | 719 ASSERT(!target_function.IsNull()); |
720 return SetBreakpoint(target_function, target_function.token_index()); | 720 return SetBreakpoint(target_function, target_function.token_index()); |
721 } | 721 } |
722 | 722 |
723 | 723 |
724 SourceBreakpoint* Debugger::SetBreakpointAtLine(const String& script_url, | 724 SourceBreakpoint* Debugger::SetBreakpointAtLine(const String& script_url, |
725 intptr_t line_number) { | 725 intptr_t line_number) { |
726 Library& lib = Library::Handle(); | 726 Library& lib = Library::Handle(); |
727 Script& script = Script::Handle(); | 727 Script& script = Script::Handle(); |
728 lib = isolate_->object_store()->registered_libraries(); | 728 const GrowableObjectArray& libs = |
729 while (!lib.IsNull()) { | 729 GrowableObjectArray::Handle(isolate_->object_store()->libraries()); |
| 730 for (int i = 0; i < libs.Length(); i++) { |
| 731 lib ^= libs.At(i); |
730 script = lib.LookupScript(script_url); | 732 script = lib.LookupScript(script_url); |
731 if (!script.IsNull()) { | 733 if (!script.IsNull()) { |
732 break; | 734 break; |
733 } | 735 } |
734 lib = lib.next_registered(); | |
735 } | 736 } |
736 if (script.IsNull()) { | 737 if (script.IsNull()) { |
737 if (verbose) { | 738 if (verbose) { |
738 OS::Print("Failed to find script with url '%s'\n", | 739 OS::Print("Failed to find script with url '%s'\n", |
739 script_url.ToCString()); | 740 script_url.ToCString()); |
740 } | 741 } |
741 return NULL; | 742 return NULL; |
742 } | 743 } |
743 intptr_t token_index_at_line = script.TokenIndexAtLine(line_number); | 744 intptr_t token_index_at_line = script.TokenIndexAtLine(line_number); |
744 if (token_index_at_line < 0) { | 745 if (token_index_at_line < 0) { |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 } | 1197 } |
1197 | 1198 |
1198 | 1199 |
1199 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 1200 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
1200 ASSERT(bpt->next() == NULL); | 1201 ASSERT(bpt->next() == NULL); |
1201 bpt->set_next(code_breakpoints_); | 1202 bpt->set_next(code_breakpoints_); |
1202 code_breakpoints_ = bpt; | 1203 code_breakpoints_ = bpt; |
1203 } | 1204 } |
1204 | 1205 |
1205 } // namespace dart | 1206 } // namespace dart |
OLD | NEW |