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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 return NULL; | 440 return NULL; |
441 } | 441 } |
442 | 442 |
443 | 443 |
444 static void FormatLocationFromTrace(dart::TextBuffer* msg, | 444 static void FormatLocationFromTrace(dart::TextBuffer* msg, |
445 Dart_StackTrace trace, | 445 Dart_StackTrace trace, |
446 const char* prefix) { | 446 const char* prefix) { |
447 intptr_t trace_len = 0; | 447 intptr_t trace_len = 0; |
448 Dart_Handle res = Dart_StackTraceLength(trace, &trace_len); | 448 Dart_Handle res = Dart_StackTraceLength(trace, &trace_len); |
449 ASSERT_NOT_ERROR(res); | 449 ASSERT_NOT_ERROR(res); |
| 450 if (trace_len == 0) { |
| 451 return; |
| 452 } |
450 Dart_ActivationFrame frame; | 453 Dart_ActivationFrame frame; |
451 res = Dart_GetActivationFrame(trace, 0, &frame); | 454 res = Dart_GetActivationFrame(trace, 0, &frame); |
452 ASSERT_NOT_ERROR(res); | 455 ASSERT_NOT_ERROR(res); |
453 Dart_CodeLocation location; | 456 Dart_CodeLocation location; |
454 res = Dart_ActivationFrameGetLocation(frame, NULL, NULL, &location); | 457 res = Dart_ActivationFrameGetLocation(frame, NULL, NULL, &location); |
455 ASSERT_NOT_ERROR(res); | 458 ASSERT_NOT_ERROR(res); |
456 if (!Dart_IsNull(location.script_url)) { | 459 if (!Dart_IsNull(location.script_url)) { |
457 ASSERT(Dart_IsString(location.script_url)); | 460 ASSERT(Dart_IsString(location.script_url)); |
458 msg->Printf("%s\"location\": { \"url\":", prefix); | 461 msg->Printf("%s\"location\": { \"url\":", prefix); |
459 FormatEncodedString(msg, location.script_url); | 462 FormatEncodedString(msg, location.script_url); |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 } else { | 1411 } else { |
1409 ASSERT(kind == kShutdown); | 1412 ASSERT(kind == kShutdown); |
1410 RemoveIsolateMsgQueue(isolate_id); | 1413 RemoveIsolateMsgQueue(isolate_id); |
1411 } | 1414 } |
1412 } | 1415 } |
1413 Dart_ExitScope(); | 1416 Dart_ExitScope(); |
1414 } | 1417 } |
1415 | 1418 |
1416 } // namespace bin | 1419 } // namespace bin |
1417 } // namespace dart | 1420 } // namespace dart |
OLD | NEW |