Add ability to unwind stack for the current thread

Bug: webrtc:10308
Change-Id: Ia82cb7512524bede8da69bbc747ece6e718733ab
Reviewed-on: https://webrtc-review.googlesource.com/c/124993
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26945}
This commit is contained in:
Karl Wiberg
2019-02-28 17:06:54 +01:00
committed by Commit Bot
parent 8b8d01ada3
commit c130d42aab
3 changed files with 46 additions and 20 deletions

View File

@ -33,6 +33,9 @@ struct StackTraceElement {
// on top of unwind.h and unwinds native (C++) stack traces only.
std::vector<StackTraceElement> GetStackTrace(int tid);
// Unwind the stack of the current thread.
std::vector<StackTraceElement> GetStackTrace();
// Get a string representation of the stack trace in a format ndk-stack accepts.
std::string StackTraceToString(
const std::vector<StackTraceElement>& stack_trace);