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

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

Issue 13940008: Add library id, location info to breakpointResolved event (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/vm/debugger.cc ('k') | tests/standalone/debugger/debug_lib.dart » ('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 "include/dart_debugger_api.h" 5 #include "include/dart_debugger_api.h"
6 6
7 #include "vm/dart_api_impl.h" 7 #include "vm/dart_api_impl.h"
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/debugger.h" 9 #include "vm/debugger.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 const Library& lib = Library::Handle(top_frame->Library()); 128 const Library& lib = Library::Handle(top_frame->Library());
129 location.library_id = lib.index(); 129 location.library_id = lib.index();
130 location.token_pos = top_frame->TokenPos(); 130 location.token_pos = top_frame->TokenPos();
131 (*paused_event_handler)(isolate_id, location); 131 (*paused_event_handler)(isolate_id, location);
132 } else if (event->type == Debugger::kBreakpointResolved) { 132 } else if (event->type == Debugger::kBreakpointResolved) {
133 if (bp_resolved_handler == NULL) { 133 if (bp_resolved_handler == NULL) {
134 return; 134 return;
135 } 135 }
136 SourceBreakpoint* bpt = event->breakpoint; 136 SourceBreakpoint* bpt = event->breakpoint;
137 ASSERT(bpt != NULL); 137 ASSERT(bpt != NULL);
138 Dart_Handle url = Api::NewHandle(isolate, bpt->SourceUrl()); 138 Dart_CodeLocation location;
139 (*bp_resolved_handler)(isolate_id, bpt->id(), url, bpt->LineNumber()); 139 Library& library = Library::Handle(isolate);
140 Script& script = Script::Handle(isolate);
141 intptr_t token_pos;
142 bpt->GetCodeLocation(&library, &script, &token_pos);
143 location.script_url = Api::NewHandle(isolate, script.url());
144 location.library_id = library.index();
145 location.token_pos = token_pos;
146 (*bp_resolved_handler)(isolate_id, bpt->id(), location);
140 } else if (event->type == Debugger::kExceptionThrown) { 147 } else if (event->type == Debugger::kExceptionThrown) {
141 if (exc_thrown_handler == NULL) { 148 if (exc_thrown_handler == NULL) {
142 return; 149 return;
143 } 150 }
144 Dart_Handle exception = Api::NewHandle(isolate, event->exception->raw()); 151 Dart_Handle exception = Api::NewHandle(isolate, event->exception->raw());
145 Dart_StackTrace trace = 152 Dart_StackTrace trace =
146 reinterpret_cast<Dart_StackTrace>(isolate->debugger()->StackTrace()); 153 reinterpret_cast<Dart_StackTrace>(isolate->debugger()->StackTrace());
147 (*exc_thrown_handler)(isolate_id, exception, trace); 154 (*exc_thrown_handler)(isolate_id, exception, trace);
148 } else if (event->type == Debugger::kIsolateCreated) { 155 } else if (event->type == Debugger::kIsolateCreated) {
149 if (isolate_event_handler != NULL) { 156 if (isolate_event_handler != NULL) {
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 776
770 777
771 DART_EXPORT char* Dart_GetVmStatus(const char* request) { 778 DART_EXPORT char* Dart_GetVmStatus(const char* request) {
772 if (strncmp(request, "/isolate/", 9) == 0) { 779 if (strncmp(request, "/isolate/", 9) == 0) {
773 return Isolate::GetStatus(request); 780 return Isolate::GetStatus(request);
774 } 781 }
775 return NULL; 782 return NULL;
776 } 783 }
777 784
778 } // namespace dart 785 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/debugger.cc ('k') | tests/standalone/debugger/debug_lib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698