[#BloombergLP-bsls-StackAddressUtil-formatCheapStack]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/StackAddressUtil.adoc[StackAddressUtil]::formatCheapStack
:relfileprefix: ../../../
:mrdocs:

Format Bloomberg &quot;cheapstack&quot; contents into the specified buffer&period;

== Synopsis

Declared in `&lt;bsls&lowbar;stackaddressutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
formatCheapStack(
    char* output,
    int length,
    char const* taskname = 0);
----

== Description

Load the specified `output` buffer having the specified `length` with the Bloomberg standard &quot;cheapstack&quot; contents as a null&hyphen;terminated string&period; On successfully obtaining the current call stack, this will be instructions on how to run the Bloomberg tool `showfunc&period;tsk` (with the optionally specified `taskname`, otherwise with an attempt to obtain the system&hyphen;specific process name) to get details of the current call stack where `formatCheapStack` was called&period; On failure, text indicating that the call stack was not obtainable will be written to `output`&period; If `length` is not long enough for the entire output it will be truncated&period; The behavior is undefined unless `0 &lt;&equals; length` and `output` has the capacity for at least `length` bytes&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *output*
| buffer to receive the null&hyphen;terminated cheapstack text
| *length*
| capacity of `output` in bytes
| *taskname*
| optional process or binary name for `showfunc&period;tsk`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
