| 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 "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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 ASSERT_NOT_ERROR(res); | 422 ASSERT_NOT_ERROR(res); |
| 423 Dart_Handle func_name; | 423 Dart_Handle func_name; |
| 424 Dart_CodeLocation location; | 424 Dart_CodeLocation location; |
| 425 res = Dart_ActivationFrameGetLocation(frame, &func_name, &location); | 425 res = Dart_ActivationFrameGetLocation(frame, &func_name, &location); |
| 426 ASSERT_NOT_ERROR(res); | 426 ASSERT_NOT_ERROR(res); |
| 427 ASSERT(Dart_IsString(func_name)); | 427 ASSERT(Dart_IsString(func_name)); |
| 428 msg->Printf("%s{\"functionName\":", (i > 0) ? "," : ""); | 428 msg->Printf("%s{\"functionName\":", (i > 0) ? "," : ""); |
| 429 FormatEncodedString(msg, func_name); | 429 FormatEncodedString(msg, func_name); |
| 430 if (!Dart_IsNull(location.script_url)) { | 430 if (!Dart_IsNull(location.script_url)) { |
| 431 ASSERT(Dart_IsString(location.script_url)); | 431 ASSERT(Dart_IsString(location.script_url)); |
| 432 msg->Printf("\"location\": { \"url\":"); | 432 msg->Printf(",\"location\": { \"url\":"); |
| 433 FormatEncodedString(msg, location.script_url); | 433 FormatEncodedString(msg, location.script_url); |
| 434 msg->Printf(",\"libraryId\":%d,", location.library_id); | 434 msg->Printf(",\"libraryId\":%d,", location.library_id); |
| 435 msg->Printf("\"tokenOffset\":%d},", location.token_pos); | 435 msg->Printf("\"tokenOffset\":%d}", location.token_pos); |
| 436 } | 436 } |
| 437 Dart_Handle locals = Dart_GetLocalVariables(frame); | 437 Dart_Handle locals = Dart_GetLocalVariables(frame); |
| 438 ASSERT_NOT_ERROR(locals); | 438 ASSERT_NOT_ERROR(locals); |
| 439 msg->Printf("\"locals\":"); | 439 msg->Printf(",\"locals\":"); |
| 440 FormatNamedValueList(msg, locals); | 440 FormatNamedValueList(msg, locals); |
| 441 msg->Printf("}"); | 441 msg->Printf("}"); |
| 442 } | 442 } |
| 443 msg->Printf("]"); | 443 msg->Printf("]"); |
| 444 } | 444 } |
| 445 | 445 |
| 446 | 446 |
| 447 typedef bool (*CommandHandler)(DbgMessage* msg); | 447 typedef bool (*CommandHandler)(DbgMessage* msg); |
| 448 | 448 |
| 449 struct JSONDebuggerCommand { | 449 struct JSONDebuggerCommand { |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 msg_queue->SendIsolateEvent(isolate_id, kind); | 1210 msg_queue->SendIsolateEvent(isolate_id, kind); |
| 1211 if (kind == kInterrupted) { | 1211 if (kind == kInterrupted) { |
| 1212 msg_queue->HandleMessages(); | 1212 msg_queue->HandleMessages(); |
| 1213 } else { | 1213 } else { |
| 1214 ASSERT(kind == kShutdown); | 1214 ASSERT(kind == kShutdown); |
| 1215 RemoveIsolateMsgQueue(isolate_id); | 1215 RemoveIsolateMsgQueue(isolate_id); |
| 1216 } | 1216 } |
| 1217 } | 1217 } |
| 1218 Dart_ExitScope(); | 1218 Dart_ExitScope(); |
| 1219 } | 1219 } |
| OLD | NEW |