BloombergLP::balst::StackTraceUtil::loadStackTraceFromAddressArray

Populate the specified result with stack-trace information from the stack, described by the specified array of addresses of length numAddresses.

Synopsis

Declared in <balst_stacktraceutil.h>

static
int
loadStackTraceFromAddressArray(
    StackTrace* result,
    void const const* addresses[],
    int numAddresses,
    bool demanglingPreferredFlag = true);

Description

Optionally specify demanglingPreferredFlag to indicate whether or not to attempt to perform demangling, however, demangling is always performed on the Windows platform and never performed on Solaris using the CC compiler regardless of the value of demanglingPreferredFlag. If demanglingPreferredFlag is not specified, demangling is performed on those platforms that support it. Return 0 on success, and a non-zero value otherwise. Any frames previously contained in the stack-trace object are discarded. The behavior is undefined unless addresses contains at least numAddresses addresses. Note that the return addresses from the stack can be obtained by calling bsls::StackAddressUtil::getStackAddresses, and that demangling sometimes involves calling malloc.

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
resultstack-trace object to populate
addressesarray of return addresses from the stack
numAddressesnumber of addresses in addresses
demanglingPreferredFlagwhether to prefer demangled symbols