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

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

Issue 10414084: Replace linked list of loaded libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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_api_impl_test.cc ('k') | 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 "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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/debugger_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698