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

Side by Side Diff: runtime/bin/dbg_message.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/bin/dbg_message.h ('k') | runtime/include/dart_debugger_api.h » ('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 "bin/dbg_connection.h" 5 #include "bin/dbg_connection.h"
6 #include "bin/dbg_message.h" 6 #include "bin/dbg_message.h"
7 #include "bin/dartutils.h" 7 #include "bin/dartutils.h"
8 #include "bin/thread.h" 8 #include "bin/thread.h"
9 #include "bin/utils.h" 9 #include "bin/utils.h"
10 10
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 iterator = queue; 1150 iterator = queue;
1151 queue = queue->next(); 1151 queue = queue->next();
1152 } 1152 }
1153 } 1153 }
1154 UNREACHABLE(); 1154 UNREACHABLE();
1155 } 1155 }
1156 1156
1157 1157
1158 void DbgMsgQueueList::BptResolvedHandler(Dart_IsolateId isolate_id, 1158 void DbgMsgQueueList::BptResolvedHandler(Dart_IsolateId isolate_id,
1159 intptr_t bp_id, 1159 intptr_t bp_id,
1160 Dart_Handle url, 1160 const Dart_CodeLocation& location) {
1161 intptr_t line_number) {
1162 Dart_EnterScope(); 1161 Dart_EnterScope();
1163 dart::TextBuffer msg(128); 1162 dart::TextBuffer msg(128);
1164 msg.Printf("{ \"event\": \"breakpointResolved\", \"params\": {"); 1163 msg.Printf("{ \"event\": \"breakpointResolved\", \"params\": {");
1165 msg.Printf("\"breakpointId\": %"Pd", \"url\":", bp_id); 1164 msg.Printf("\"breakpointId\": %"Pd"", bp_id);
1166 FormatEncodedString(&msg, url); 1165
1167 msg.Printf(",\"line\": %"Pd" }}", line_number); 1166 // TODO(hausner): remove url and line elements.
1167 msg.Printf(", \"url\":");
1168 FormatEncodedString(&msg, location.script_url);
1169 int line_number = GetIntValue(Dart_GetBreakpointLine(bp_id));
1170 msg.Printf(",\"line\":%d", line_number);
1171
1172 msg.Printf(", \"isolateId\":%"Pd64"", isolate_id);
1173 ASSERT(!Dart_IsNull(location.script_url));
1174 ASSERT(Dart_IsString(location.script_url));
1175 msg.Printf(", \"location\":{\"url\":");
1176 FormatEncodedString(&msg, location.script_url);
1177 msg.Printf(",\"libraryId\":%d", location.library_id);
1178 msg.Printf(",\"tokenOffset\":%d}}}", location.token_pos);
1179
1168 DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id); 1180 DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id);
1169 ASSERT(msg_queue != NULL); 1181 ASSERT(msg_queue != NULL);
1170 msg_queue->QueueOutputMsg(&msg); 1182 msg_queue->QueueOutputMsg(&msg);
1171 Dart_ExitScope(); 1183 Dart_ExitScope();
1172 } 1184 }
1173 1185
1174 1186
1175 void DbgMsgQueueList::PausedEventHandler(Dart_IsolateId isolate_id, 1187 void DbgMsgQueueList::PausedEventHandler(Dart_IsolateId isolate_id,
1176 const Dart_CodeLocation& loc) { 1188 const Dart_CodeLocation& loc) {
1177 DebuggerConnectionHandler::WaitForConnection(); 1189 DebuggerConnectionHandler::WaitForConnection();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 msg_queue->SendIsolateEvent(isolate_id, kind); 1225 msg_queue->SendIsolateEvent(isolate_id, kind);
1214 if (kind == kInterrupted) { 1226 if (kind == kInterrupted) {
1215 msg_queue->HandleMessages(); 1227 msg_queue->HandleMessages();
1216 } else { 1228 } else {
1217 ASSERT(kind == kShutdown); 1229 ASSERT(kind == kShutdown);
1218 RemoveIsolateMsgQueue(isolate_id); 1230 RemoveIsolateMsgQueue(isolate_id);
1219 } 1231 }
1220 } 1232 }
1221 Dart_ExitScope(); 1233 Dart_ExitScope();
1222 } 1234 }
OLDNEW
« no previous file with comments | « runtime/bin/dbg_message.h ('k') | runtime/include/dart_debugger_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698