[#BloombergLP-balst-StackTraceUtil-loadStackTraceFromStack] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balst.adoc[balst]::xref:BloombergLP/balst/StackTraceUtil.adoc[StackTraceUtil]::loadStackTraceFromStack :relfileprefix: ../../../ :mrdocs: Populate the specified `result` object with information about the current thread's program stack. 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 specfied, 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`. == Synopsis Declared in `<balst_stacktraceutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int loadStackTraceFromStack( xref:BloombergLP/balst/StackTrace.adoc[StackTrace]* result, int maxFrames = ‐1, bool demanglingPreferredFlag = true); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#