[#BloombergLP-bsls-StackAddressUtil-getStackAddresses] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/StackAddressUtil.adoc[StackAddressUtil]::getStackAddresses :relfileprefix: ../../../ :mrdocs: Get an sequence of return addresses from the current thread's function call stack, ordered from most recent call to least recent, and load them into the specified array `*buffer`, which is at least the specified `maxFrames` in length. A return address is an address stored on the stack that points to the first instruction that will be executed after the called subroutine returns. If there are more than `maxFrames` frames on the stack, only the return addresses for the `maxFrames` most recent routine calls are stored. When this routine completes, `buffer` will contain an ordered sequence of return addresses, sorted such that recent calls occur in the array before calls that took place before them. Return the number of stack frames stored into `buffer` on success, and a negative value otherwise. The behavior is undefined unless `maxFrames >= 0` and `buffer` has room for at least `maxFrames` addresses. Note that this routine may fill `buffer` with garbage if the stack is corrupt, or on Windows if some stack frames represent optimized routines. == Synopsis Declared in `<bsls_stackaddressutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int getStackAddresses( void** buffer, int maxFrames); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#