BloombergLP::balst::StackTraceUtil::loadStackTraceFromStack

Populate the specified result object with information about the current thread's program stack.

Synopsis

Declared in <balst_stacktraceutil.h>

static
int
loadStackTraceFromStack(
    StackTrace* result,
    int maxFrames = -1,
    bool demanglingPreferredFlag = true);

Description

Optionally specify maxFrames to indicate the maximum number of frames to take from the top of the stack. If maxFrames is not specified, the default limit is at least 1024. Optionally specify demanglingPreferredFlag to indicate whether to attempt to perform demangling, if possible. If demanglingPreferredFlag is not specified, demangling is assumed to be preferred, however, demangling is always performed on the Windows platform and never performed on Solaris using the CC compiler regardless of the value of demanglingPreferredFlag. Any frames previously contained in the stackTrace object are discarded. Return 0 on success, and a non-zero value otherwise. The behavior is undefined unless maxFrames (if specified) is greater than 0. Note that demangling may involve calling malloc.

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
resultstack-trace object to populate
maxFramesmaximum number of stack frames to capture
demanglingPreferredFlagwhether to prefer demangled symbols