| 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 // longer depends on line number info. | 405 // longer depends on line number info. |
| 406 res = Dart_ActivationFrameInfo(frame, NULL, NULL, &line_number, NULL); | 406 res = Dart_ActivationFrameInfo(frame, NULL, NULL, &line_number, NULL); |
| 407 ASSERT_NOT_ERROR(res); | 407 ASSERT_NOT_ERROR(res); |
| 408 res = Dart_ActivationFrameGetLocation( | 408 res = Dart_ActivationFrameGetLocation( |
| 409 frame, &script_url, &library_id, &token_number); | 409 frame, &script_url, &library_id, &token_number); |
| 410 ASSERT_NOT_ERROR(res); | 410 ASSERT_NOT_ERROR(res); |
| 411 if (!Dart_IsNull(script_url)) { | 411 if (!Dart_IsNull(script_url)) { |
| 412 ASSERT(Dart_IsString(script_url)); | 412 ASSERT(Dart_IsString(script_url)); |
| 413 msg->Printf("\"location\": { \"url\":"); | 413 msg->Printf("\"location\": { \"url\":"); |
| 414 FormatEncodedString(msg, script_url); | 414 FormatEncodedString(msg, script_url); |
| 415 msg->Printf("\"libraryId\":%"Pd"},", library_id); | 415 msg->Printf(",\"libraryId\":%"Pd"},", library_id); |
| 416 msg->Printf(",\"tokenOffset\":%"Pd",", token_number); | 416 msg->Printf("\"tokenOffset\":%"Pd",", token_number); |
| 417 msg->Printf("\"lineNumber\":%"Pd"},", line_number); | 417 msg->Printf("\"lineNumber\":%"Pd"},", line_number); |
| 418 } | 418 } |
| 419 } | 419 } |
| 420 | 420 |
| 421 | 421 |
| 422 static void FormatCallFrames(dart::TextBuffer* msg, Dart_StackTrace trace) { | 422 static void FormatCallFrames(dart::TextBuffer* msg, Dart_StackTrace trace) { |
| 423 intptr_t trace_len = 0; | 423 intptr_t trace_len = 0; |
| 424 Dart_Handle res = Dart_StackTraceLength(trace, &trace_len); | 424 Dart_Handle res = Dart_StackTraceLength(trace, &trace_len); |
| 425 ASSERT_NOT_ERROR(res); | 425 ASSERT_NOT_ERROR(res); |
| 426 msg->Printf("\"callFrames\" : [ "); | 426 msg->Printf("\"callFrames\" : [ "); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 445 msg->Printf(",\"libraryId\": %"Pd",", library_id); | 445 msg->Printf(",\"libraryId\": %"Pd",", library_id); |
| 446 | 446 |
| 447 res = Dart_ActivationFrameGetLocation( | 447 res = Dart_ActivationFrameGetLocation( |
| 448 frame, &script_url, NULL, &token_number); | 448 frame, &script_url, NULL, &token_number); |
| 449 ASSERT_NOT_ERROR(res); | 449 ASSERT_NOT_ERROR(res); |
| 450 if (!Dart_IsNull(script_url)) { | 450 if (!Dart_IsNull(script_url)) { |
| 451 ASSERT(Dart_IsString(script_url)); | 451 ASSERT(Dart_IsString(script_url)); |
| 452 msg->Printf("\"location\": { \"url\":"); | 452 msg->Printf("\"location\": { \"url\":"); |
| 453 FormatEncodedString(msg, script_url); | 453 FormatEncodedString(msg, script_url); |
| 454 msg->Printf(",\"libraryId\": %"Pd",", library_id); | 454 msg->Printf(",\"libraryId\": %"Pd",", library_id); |
| 455 msg->Printf(",\"tokenOffset\":%"Pd",", token_number); | 455 msg->Printf("\"tokenOffset\":%"Pd",", token_number); |
| 456 msg->Printf("\"lineNumber\":%"Pd"},", line_number); | 456 msg->Printf("\"lineNumber\":%"Pd"},", line_number); |
| 457 } | 457 } |
| 458 | 458 |
| 459 Dart_Handle locals = Dart_GetLocalVariables(frame); | 459 Dart_Handle locals = Dart_GetLocalVariables(frame); |
| 460 ASSERT_NOT_ERROR(locals); | 460 ASSERT_NOT_ERROR(locals); |
| 461 msg->Printf("\"locals\":"); | 461 msg->Printf("\"locals\":"); |
| 462 FormatNamedValueList(msg, locals); | 462 FormatNamedValueList(msg, locals); |
| 463 msg->Printf("}"); | 463 msg->Printf("}"); |
| 464 } | 464 } |
| 465 msg->Printf("]"); | 465 msg->Printf("]"); |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 msg_queue->SendIsolateEvent(isolate_id, kind); | 1236 msg_queue->SendIsolateEvent(isolate_id, kind); |
| 1237 if (kind == kInterrupted) { | 1237 if (kind == kInterrupted) { |
| 1238 msg_queue->HandleMessages(); | 1238 msg_queue->HandleMessages(); |
| 1239 } else { | 1239 } else { |
| 1240 ASSERT(kind == kShutdown); | 1240 ASSERT(kind == kShutdown); |
| 1241 RemoveIsolateMsgQueue(isolate_id); | 1241 RemoveIsolateMsgQueue(isolate_id); |
| 1242 } | 1242 } |
| 1243 } | 1243 } |
| 1244 Dart_ExitScope(); | 1244 Dart_ExitScope(); |
| 1245 } | 1245 } |
| OLD | NEW |