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

Unified Diff: runtime/vm/stack_trace.h

Issue 2603383004: Sane asynchronous debugging and stack traces (Closed)
Patch Set: rebase 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
« no previous file with comments | « runtime/vm/service/service.md ('k') | runtime/vm/stack_trace.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_trace.h
diff --git a/runtime/vm/stack_trace.h b/runtime/vm/stack_trace.h
new file mode 100644
index 0000000000000000000000000000000000000000..392788209d825111e16810e3d62bf5328f29821f
--- /dev/null
+++ b/runtime/vm/stack_trace.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef RUNTIME_VM_STACK_TRACE_H_
+#define RUNTIME_VM_STACK_TRACE_H_
+
+#include "vm/allocation.h"
+#include "vm/flag_list.h"
+#include "vm/object.h"
+
+namespace dart {
+
+DECLARE_FLAG(bool, show_invisible_frames);
+
+class StackTraceUtils : public AllStatic {
+ public:
+ /// Counts the number of stack frames.
+ /// Skips over the first |skip_frames|.
+ /// If |async_function| is not null, stops at the function that has
+ /// |async_function| as its parent.
+ static intptr_t CountFrames(
+ int skip_frames,
+ const Function& async_function,
+ bool count_invisible_frames = FLAG_show_invisible_frames);
+
+ /// Collects |count| frames into |code_array| and |pc_offset_array|.
+ /// Writing begins at |array_offset|.
+ /// Skips over the first |skip_frames|.
+ /// Returns the number of frames collected.
+ static intptr_t CollectFrames(
+ const Array& code_array,
+ const Array& pc_offset_array,
+ intptr_t array_offset,
+ intptr_t count,
+ int skip_frames,
+ bool collect_invisible_frames = FLAG_show_invisible_frames);
+
+ /// If |thread| has no async_stack_trace, does nothing.
+ /// Populates |async_function| with the top function of the async stack
+ /// trace. Populates |async_code_array| and |async_pc_offset_array| with
+ /// the thread's async_stack_trace.
+ /// Returns the length of the asynchronous stack trace.
+ static intptr_t ExtractAsyncStackTraceInfo(Thread* thread,
+ Function* async_function,
+ Array* async_code_array,
+ Array* async_pc_offset_array);
+};
+
+} // namespace dart
+
+#endif // RUNTIME_VM_STACK_TRACE_H_
« no previous file with comments | « runtime/vm/service/service.md ('k') | runtime/vm/stack_trace.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698