Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 7f85580c24ae48780918ff7f8048dbcd8bc39296..9bac3a1a6d30a62aee4ee59a2a4cb9c41be29368 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -22638,8 +22638,16 @@ const char* StackTrace::ToCStringInternal(intptr_t* frame_index, |
intptr_t total_len = 0; |
GrowableArray<char*> frame_strings; |
for (intptr_t i = 0; (i < Length()) && (*frame_index < max_frames); i++) { |
+ code = CodeAtFrame(i); |
function = FunctionAtFrame(i); |
- if (function.IsNull()) { |
+ if (code.raw() == StubCode::AsynchronousGapMarker_entry()->code()) { |
+ const char* kAsynchronousGap = "<asynchronous suspension>\n"; |
rmacnak
2017/01/26 18:05:58
No need to dup the string.
Cutch
2017/01/31 23:45:31
Done.
|
+ intptr_t asynchronous_gap_len = strlen(kAsynchronousGap) + 1; |
+ char* chars = zone->Alloc<char>(asynchronous_gap_len); |
+ OS::SNPrint(chars, asynchronous_gap_len, "%s", kAsynchronousGap); |
+ frame_strings.Add(chars); |
+ total_len += asynchronous_gap_len; |
+ } else if (function.IsNull()) { |
// Check for a null function, which indicates a gap in a StackOverflow or |
// OutOfMemory trace. |
if ((i < (Length() - 1)) && |
@@ -22655,7 +22663,6 @@ const char* StackTrace::ToCStringInternal(intptr_t* frame_index, |
(*frame_index) += Smi::Value(PcOffsetAtFrame(i)); |
} |
} else { |
- code = CodeAtFrame(i); |
ASSERT(function.raw() == code.function()); |
uword pc = code.PayloadStart() + Smi::Value(PcOffsetAtFrame(i)); |
if (code.is_optimized() && expand_inlined() && |