Contents

CallStackTree

A tree structure representing a collection of call stacks captured during a diagnostic event.

Declaration

struct CallStackTree

Mentioned in

Discussion

Each diagnostic struct — including CrashDiagnostic, HangDiagnostic, CPUExceptionDiagnostic, DiskWriteExceptionDiagnostic, AppLaunchDiagnostic, and MemoryExceptionDiagnostic — carries a callStackTree property of this type.

The tree is organized into threads via callStackThreads. Each CallStackThread contains root CallStackFrame values that form a tree of sub-frames. Binary metadata is deduplicated in binaryInfo, keyed by UUID, so frames reference binaries by UUID rather than repeating the name.

Use forEachFrame(_:) for an optimized iterative depth-first traversal of all frames across all threads:

callStackTree.forEachFrame { frame in
    if let name = frame.binaryName(from: callStackTree) {
        print(name, frame.offsetIntoBinaryTextSegment ?? 0)
    }
}

This type replaces MXCallStackTree.

Topics

Threads and frames

Binary information

Related types

Structures

See Also

Call stack data