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

Unified Diff: runtime/vm/object.cc

Issue 2646443005: Track async causal stack traces (Closed)
Patch Set: Observatory UI support Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
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() &&

Powered by Google App Engine
This is Rietveld 408576698