Internal change

PiperOrigin-RevId: 302567603
Change-Id: I659321ad7f3ac97beef29c01a76aa3f4a3852ad6
4 files changed
tree: a3a45855c8efa0a4adf352d99c7eb6fa6cb18de5
  1. LICENSE
  2. LPStackTraceGenerator.h
  3. LPStackTraceGenerator.m
  4. README.md
README.md

A lightweight stack trace logging facility library for iOS.

Only support X86_64 and ARM64 architectures at the moment

Code Example

Get stack trace of any thread

// Buffer can be filled with up to 128 stack frames.
void *buffer[128];
int count = LPSnapshotThreadStackTrace(buffer, sizeof(buffer), anyThread);

// Get string representaion of the stack trace.
NSArray<NSString *> *result = LPStackTraceString(buffer, count);

Get stack traces of all threads

// Buffer can be filled with up to 40 threads.
LPThreadStackTrace buffer[40];
int count = LPSnapshotAllThreadsStackTrace(buffer, sizeof(buffer));

// Get string representaion of the stack trace.
NSArray<NSArray<NSString *> *> *result = LPStackTracesString(buffer, count);