<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"><title></title>



</head>

<body>



<table style="border-collapse: collapse;" border="0" bordercolor="#111111" cellpadding="0" cellspacing="0" width="619">

<tbody>

<tr>

<td align="left" valign="top" width="167">Document number:</td>

<td width="452">N3441=12-0131</td>

</tr>

<tr>

<td align="left" valign="top" width="167">Date:</td>

<td width="452">2012-09-20</td>

</tr>

<tr>

<td align="left" valign="top" width="167">Project:</td>

<td width="452">Programming Language C++, Library

Working Group</td>

</tr>

<tr>

<td align="left" valign="top" width="167">Reply-to:</td>

<td width="452"><i>Aurelian Melinte &lt;ame01 at gmx dot net&gt;</i></td>

</tr>

</tbody>

</table>

<br>

<h1 style="text-align: center;"><a class="mozTocH1" name="mozTocId217169"></a>Call Stack Utilities and

std::exception Extension Proposal</h1>

<h2><a class="mozTocH2" name="mozTocId795545"></a><b>I.

Table of Contents</b></h2>

<span style="background-color: red; font-weight: bold;"><br>

</span>

<ul id="mozToc">

<!--mozToc h2 2 h3 3 h4 4 h5 5 h6 6-->

<ul>

<li><a href="#mozTocId795545">I.

Table of Contents</a></li>

<li><a href="#mozTocId149609">II.

Introduction</a></li>

<li><a href="#mozTocId828570">III.

Motivation and Scope</a></li>

<li><a href="#mozTocId741955">IV.

Impact On the Standard</a>

<ul>

<li><a href="#mozTocId363342">Additions</a></li>

<li><a href="#mozTocId639971">Dependencies</a></li>

<li><a href="#mozTocId507717">Changes

to current standard components</a></li>

</ul>

</li>

<li><a href="#mozTocId594151">V.

Design Decisions</a></li>

<li><a href="#mozTocId600304">VI.

Technical Specifications</a>

<ul>

<li><a href="#mozTocId219755">call_stack</a></li>

<li><a href="#mozTocId760520">symbol_info</a></li>

<li><a href="#mozTocId818997">call_stack_info</a></li>

<li><a href="#mozTocId136795">std::exception</a></li>

<li><a href="#mozTocId559051">Example Usage</a></li>

</ul>

</li>

<li><a href="#mozTocId16316">VII. Existing

Implementation</a></li>

<li><a href="#mozTocId40405">VIII.

References</a></li>

<li><a href="#mozTocId763219">IX. Revision

History</a></li>

</ul>



</ul>

<span style="background-color: red; font-weight: bold;"><br>

</span>

<h2><a class="mozTocH2" name="mozTocId149609"></a><b>II.

Introduction</b></h2>

<p>This is a two part proposal to:&nbsp;</p>

<ul>

<li>a) standardize call stack utilities to retrieve, interpret

and format such retrieved information. This is a pure extension to the

existing standard.&nbsp;</li>

<li>b) extend <span style="font-family: monospace;">std::exception</span>

with such call stack information collected at the point where the

exception is instantiated.</li><br>

</ul>

<h2><a class="mozTocH2" name="mozTocId828570"></a><b>III.

Motivation and Scope</b></h2>



<p>To&nbsp;diagnose software defects, it&nbsp;is often

necessary to have

the call stack information and to be able to read it in a

human-readable form.&nbsp;Rare-to-occur

software conditions and transitory anomalies do happen mostly on

production machines where only release versions of the software are

installed and where no compiler or debugging facilities are installed.

Race conditions are exposed only in specific environments that are

sometimes inaccessible to a programmer. Sometimes even no core dump is

available for post-mortem analysis, either because of an administrative

policy, either because the platform does not support it. Most of the

time it is not even acceptable to dump core and terminate a server

program.</p><p>Thus,

being able to capture the call stack at any given point in time and

being able to store the information for later analysis wouldbe of valuable help and would&nbsp;ease error diagnostic with the above situations.&nbsp;

One alternative available to the C++ programmer willing to get to this

call stack and symbol information is to write its own tools using

platform-specific APIs. &nbsp;Another alternative could be to resort to

third-party vendors' libraries. In both cases, the work is to be redone

each time the software is ported to a different platform.</p>Furthermore, there are situations hard to address without support from within the library. For instance, the call stack of the

exact place&nbsp;where an <span style="font-family: monospace;">std::exception</span> has been thrown is not currently

available&nbsp;at the place where exception is caught.&nbsp;<br><h2><a class="mozTocH2" name="mozTocId741955"></a><b>IV.

Impact On the Standard</b></h2>



<h3><a class="mozTocH3" name="mozTocId363342"></a>Additions</h3>

<p>The proposal adds four new classes to standardize call stack

information, for part a) of the proposal:</p>

<ol>

<li>A raw call stack container.&nbsp;</li>

<li>Two&nbsp;tools to resolve call stack addresses to

symbol information.

Implementations could provide more such resolvers.</li>

<li>A tool to combine a call stack container with an address

resolver for "cooked" call

stack information.</li><br>

</ol>

<h3><a class="mozTocH3" name="mozTocId639971"></a>Dependencies</h3>

<p>The

proposed functionality uses existing standard containers to keep the

raw call stack and the symbol information. The choice of the containers

is platform-dependent (in practice&nbsp;<span style="font-family: monospace;">std::array</span>

proved to be a good choice for GNU/Linux). &nbsp;It makes usage of

platform specific APIs to extract the call stack and to resolve symbols

but these APIs &nbsp;should not add any new link dependencies.</p><p></p>



<h3><a class="mozTocH3" name="mozTocId507717"></a>Changes

to current standard components</h3>

<ol>

<li>A one method extension to <span style="font-family: monospace;">std::exception</span>.

Only if part b) of the proposal is adopted.</li>

</ol>

<br>

<h2><a class="mozTocH2" name="mozTocId594151"></a><b>V.

Design Decisions</b></h2>

<p>The proposed set of utilities does: </p>

<ul>

<li>Abstract away&nbsp;the platform-specific information on

how the call stack information is retrieved.</li>

<li>Minimize side effects of the call stack retrieval process</li>

<ul>

<li>In

particular, there are&nbsp;dynamic storage allocation restrictions

when

retrieving/walking the call

stack. This because of the intended usage within&nbsp;an <span style="font-family: monospace;">std::exception</span>.

Retrieving&nbsp;the call stack could be in the context of an <span style="font-family: monospace;">std::bad_alloc</span>,

hence the restriction.</li>

</ul>

<li>Abstract away the platform-specific information on how

addresses are resolved to symbol information.&nbsp;</li>

<li>Offers functionality to process call stack and symbol

information in a platform-independent way.</li>

<li>Have minimal impact on the existing standard. Only <span style="font-family: monospace;">std::exception</span>

needs a method added to the interface and only if part b) of the

proposal is adopted. </li>

</ul>

<span style="font-style: italic;"><br>

</span>

<h2><a class="mozTocH2" name="mozTocId600304"></a><b>VI.

Technical Specifications</b></h2>

<h3><a class="mozTocH3" name="mozTocId219755"></a>call_stack</h3>

<p>This class contains the raw call stack

information and it offers an interface to access this information in a

platform-independent way. &nbsp;</p>

<p><span style="font-family: monospace;">call_stack</span>:

</p>

<ul>

<li>Is not allowed to allocate&nbsp;from the dynamic

storage to either retrieve or store raw

call stack information. The amount of memory is limited through a

template parameter; this also limits the depth of the retrieved stack.

Thus, all the memory needed is available when the class is

instantiated. This limitation stems from the intended usage within an <span style="font-family: monospace;">std::exception</span>

as explained above.</li>

<li>The&nbsp;information about the call stack

is&nbsp;retrieved when the <span style="font-family: monospace;">call_stack</span>

object is instantiated. The platform-specific API used to retrieve the

call stack cannot allocate dynamic storage. </li>

<li>Retrieving the call stack is an operation that is costly.

Consequently,

neither the default constructor nor the copy/move constructors do

retrieve this information. The constructor has been parameterized with

a bool to explicitly request retrieval of the stack information from

the OS.</li>

<li>None of the constructors nor the destructor can throw. This

limitation stems from the intended usage within an <span style="font-family: monospace;">std::exception.</span></li>

</ul>

<p><span style="font-family: monospace;">call_stack</span>

exposes a standard container interface [1<span style="color: red;"></span>]

to the call stack. However, part of the standard&nbsp;interface is

missing, as it makes little

sense to allow mutator operations to the call stack. Only read-only

access is provided to the call stack information, with the exception of

the <span style="font-family: monospace;">swap()</span>

method. </p>

The call stack information is accessed through a bidirectional <span style="font-family: monospace;">const_iterator</span>,

as well as through a const subscript operator. <br>

<br>

<div style="margin-left: 40px;"><span style="font-family: monospace;">typedef <span style="font-style: italic;">platform-specific</span>&nbsp;&nbsp;

raw_frame_type; &nbsp; &nbsp; &nbsp; // void*</span><br style="font-family: monospace;">

<span style="font-family: monospace;">typedef <span style="font-style: italic;">platform-specific</span>&nbsp;&nbsp;

const_raw_frame_type; // const void*</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">template &lt;

std::size_t MaxDepth&gt; class call_stack</span><br style="font-family: monospace;">

<span style="font-family: monospace;">class call_stack</span><br style="font-family: monospace;">

<span style="font-family: monospace;">{</span><br style="font-family: monospace;">

<span style="font-family: monospace;">public:</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

typedef raw_frame_type &nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

value_type;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

typedef <span style="font-style: italic;">platform-specific</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

size_type;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

typedef <span style="font-style: italic;">platform-specific</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

difference_type;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

typedef&nbsp;</span><span style="font-family: monospace;">const_raw_frame_type&amp;</span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;

const_reference; &nbsp; &nbsp; &nbsp; &nbsp; // no

reference</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

typedef&nbsp;</span><span style="font-family: monospace;"></span><span style="font-family: monospace;">const_raw_frame_type*</span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;

const_pointer; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

// no pointer</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

typedef <span style="font-style: italic;">platform-specific</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const_iterator; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;// no iterator</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

typedef <span style="font-style: italic;">platform-specific</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const_reverse_iterator; &nbsp;// no </span><span style="font-family: monospace;">reverse_iterator</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;

&nbsp; /**<br>

&nbsp; &nbsp; &nbsp;* &nbsp;Get the call stack

information upon instantiation<br>

&nbsp; &nbsp; &nbsp;* &nbsp;if @param capture is true.<br>

&nbsp; &nbsp; &nbsp;*/<br>

&nbsp;&nbsp;&nbsp;

call_stack(bool capture = false) &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp;noexcept;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

call_stack(call_stack&amp;&amp; other) &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp;noexcept;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

call_stack(const call_stack&amp; other) &nbsp; &nbsp;

&nbsp; noexcept;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

call_stack&amp; operator=(call_stack&amp;&amp; other)

noexcept;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

call_stack&amp; operator=(call_stack other) &nbsp; noexcept;<br>

&nbsp; &nbsp; </span><span style="font-family: monospace;">~call_stack() &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; noexcept;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

size_type depth()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

size_type max_depth()&nbsp; const </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

size_type

size()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const </span><span style="font-family: monospace;">noexcept

</span><span style="font-family: monospace;">{

return depth(); }</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

size_type max_size()&nbsp;&nbsp; const </span><span style="font-family: monospace;">noexcept </span><span style="font-family: monospace;">{ return max_depth(); }</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

bool

empty()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const </span><span style="font-family: monospace;">noexcept

</span><span style="font-family: monospace;">{

return depth() == 0; }</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><br>

<span style="font-family: monospace;">&nbsp;

&nbsp; /* </span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

&nbsp;* </span><span style="font-family: monospace;">const_iterator

allows access to the </span><span style="font-family: monospace;">const_raw_frame_type <br>

&nbsp; &nbsp; &nbsp;* constituting the call stack

information.<br style="font-family: monospace;">

</span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

&nbsp;*/</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_iterator begin()&nbsp; const;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_iterator end()&nbsp;&nbsp;&nbsp; const;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_iterator cbegin() const;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_iterator cend()&nbsp;&nbsp; const;</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_reverse_iterator crbegin() const;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_reverse_iterator crend()&nbsp;&nbsp; const;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_reverse_iterator rbegin()&nbsp; const;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_reverse_iterator rend()&nbsp;&nbsp;&nbsp; const;</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_reference operator [] (size_type idx) const;<br>

&nbsp; &nbsp; const_reference at(size_type idx) const;<br style="font-family: monospace;">

</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

bool operator ==(const call_stack&amp; other) const; // no

&lt;, &lt;=, &gt;, &gt;=</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

bool operator !=(const call_stack&amp; other) const;</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

void <span style="color: black;">swap</span>(call_stack&amp;

other) noexcept;</span><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">}; //call_stack</span><br>

</div>

<p></p>

<h3><a class="mozTocH3" name="mozTocId760520"></a>symbol_info</h3>

<p><span style="font-family: monospace;">symbol_info</span>&nbsp;resolves

a given address to human-readable symbol information and

offers facilities for outputting the information to streams.&nbsp;</p>

<p>The resolution is using the API offered by default by the

platform that does not add link dependencies. For instance, for <span style="font-family: monospace;">gcc</span>-based

platforms,<span style="font-family: monospace;">

symbol_info</span> would use the <span style="font-family: monospace;">glibc</span> API.

However, libraries such as <span style="font-family: monospace;">libbfd</span>

(The Binary File Descriptor Library)

[2] do offer better resolution (source file, line number) than <span style="font-family: monospace;">glibc</span>, but such

libraries are independent of <span style="font-family: monospace;">gcc</span>

and might have not been installed on a given machine. On GNU/Linux a <span style="font-family: monospace;">libbfd_symbol_info</span>

can be written and used whenever <span style="font-family: monospace;">libbfd</span> is

available, at the price of adding a&nbsp;dependency on a library

that might not be installed by default. The choice to use a different

symbol resolver is left to the programmer.</p>

<p>In the process of resolving, <span style="font-family: monospace;">symbol_info</span> can

allocate dynamic storage as needed. This is undesirable in the context

of an

exception such as <span style="font-family: monospace;">std::bad_alloc</span>

being caught, so a simpler version, <span style="font-family: monospace;">symbol_info_base</span>,

with the same interface should exists. <span style="font-family: monospace;">symbol_info_base</span>&nbsp;is

not allowed to allocate dynamic storage and consequently would not be

able to

resolve much symbol information, but it would allow a very basic call

stack information to be printed. <span style="font-family: monospace;">symbol_info_base</span>

can only use platform-specific symbol resolution APIs that do not

allocate dynamic storage. &nbsp;At a minimum, &nbsp;<span style="font-family: monospace;">symbol_info_base </span>will

only offer the call stack frame address.&nbsp;</p>

<p>Again, only read-only access is provided to the frame

information, with the exception of the <span style="font-family: monospace;">swap()</span> and <span style="font-family: monospace;">resolve()</span>

methods. No method is allowed to throw.</p>

<p>The <span style="font-family: monospace;">resolve()

</span>method allows for reuse of a constructed&nbsp;<span style="font-family: monospace;">symbol_info</span>

object, for example by an iterator that iterates over a <span style="font-family: monospace;">call_stack</span> and

is the only mutator aside&nbsp;<span style="font-family: monospace;"><span style="color: black;">swap</span>()</span>.</p>

<p></p>

<div style="margin-left: 40px;"><span style="font-family: monospace;">class symbol_info //</span><span style="font-family: monospace;">symbol_info_base</span><br style="font-family: monospace;">

<span style="font-family: monospace;">{</span><br style="font-family: monospace;">

<span style="font-family: monospace;">public:</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

symbol_info(const_raw_frame_type addr) &nbsp; &nbsp;&nbsp; </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;<br>

<br style="font-family: monospace;">

</span><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

symbol_info(symbol_info const&amp; other) &nbsp;

&nbsp;&nbsp; &nbsp;</span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

symbol_info&amp; operator=(symbol_info other)&nbsp; &nbsp;</span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

symbol_info(symbol_info&amp;&amp; other) &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp;&nbsp; </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

symbol_info&amp; operator=(symbol_info&amp;&amp; other) </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

void <span style="color: black;">resolve</span>(const_raw_frame_type

addr) &nbsp; &nbsp; noexcept;<br>

</span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

void <span style="color: black;">swap</span>(symbol_info&amp;

other) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; noexcept;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><span style="font-family: monospace;"> &nbsp; &nbsp; //

The address the symbol info is for.<br>

&nbsp;&nbsp;&nbsp;

const_raw_frame_type&nbsp;&nbsp; addr() &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; const </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const char*&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; binary_file() &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; const </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const char* &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; raw_function_name() &nbsp; &nbsp;

&nbsp; const </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const char* &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; demangled_function_name() const </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

delta_sign() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp;const </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

long&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; delta()

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; const </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const char* &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; source_file() &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; const </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

unsigned int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

line_number() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; const </span><span style="font-family: monospace;">noexcept</span><span style="font-family: monospace;">;</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<br>

<span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

friend inline std::ostream&amp;

operator&lt;&lt;(std::ostream&amp; os,</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const symbol_info&amp; frm)</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

{</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

os &lt;&lt; "[" &lt;&lt; std::hex &lt;&lt;

frm.addr() &lt;&lt; "] "</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&lt;&lt; frm.demangled_function_name()</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&lt;&lt; " (" &lt;&lt; frm.binary_file()

&lt;&lt; frm.delta_sign()

&lt;&lt; "0x" &lt;&lt; std::hex &lt;&lt;

frm.delta() &lt;&lt; ")"</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&lt;&lt; " in " &lt;&lt; frm.source_file()

&lt;&lt; ":" &lt;&lt;

std::dec &lt;&lt; frm.line_number()</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

return os;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

}</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><span style="font-family: monospace;">}; //symbol_info</span><br style="font-family: monospace;">

</div>

<p><br>

</p>

<h3><a class="mozTocH3" name="mozTocId818997"></a>call_stack_info</h3>

<p><span style="font-family: monospace;">call_stack_info</span>

binds together a <span style="font-family: monospace;">call_stack</span>

with a symbol resolver. &nbsp;<span style="font-family: monospace;">call_stack_info</span>

offers human-readable&nbsp;information to the call stack and offers

facilities for outputting the information to streams.&nbsp;</p>

<p>Only read-only

access is offered by

<span style="font-family: monospace;">call_stack_info</span>.

&nbsp;A bidirectional <span style="font-family: monospace;">const_iterator</span>&nbsp;

provides read-only frame-by-frame access to the stack information, as

well as a <span style="font-family: monospace;">const</span>

subscript operator. Both allow to resolve call stack frames to symbol

information using the <span style="font-family: monospace;">AddrResolver

</span>template parameter.</p>

<p></p>

<div style="margin-left: 40px;"><span style="font-family: monospace;">template

&lt; typename

CallStack&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

//= call_stack&lt;40u&gt;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

, typename

AddrResolver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

= symbol_info</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&gt;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">class call_stack_info</span><br style="font-family: monospace;">

<span style="font-family: monospace;">{</span><br style="font-family: monospace;">

<span style="font-family: monospace;">public:</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

typedef

CallStack&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

stack_type;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

typedef

AddrResolver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

symbol_info_type;</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

call_stack_info() &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; noexcept</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

call_stack_info(const stack_type&amp; stack) &nbsp; &nbsp;

&nbsp; &nbsp;&nbsp; &nbsp; noexcept;<br>

<br style="font-family: monospace;">

</span><span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

call_stack_info(call_stack_info&amp;&amp; other) &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;noexcept;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

call_stack_info&amp; operator=(call_stack_info&amp;&amp;

other) noexcept;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

call_stack_info(const call_stack_info&amp; other) &nbsp;

&nbsp; &nbsp;&nbsp;noexcept;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

call_stack_info&amp; operator=(call_stack_info other) &nbsp;

noexcept;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

void swap(call_stack_info&amp; other) noexcept;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

friend inline std::ostream&amp;

operator&lt;&lt;(std::ostream&amp; os,</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const call_stack_info&amp; stk)</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

{</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

for (const auto&amp; frm : stk._stack)</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

{</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

AddrResolver frmInfo(frm);</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

os &lt;&lt; frmInfo &lt;&lt; "\n";</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

}</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

os &lt;&lt; std::flush;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

return os;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

}</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

std::string as_string() const;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

class const_iterator</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

: public std::iterator&lt; std::bidirectional_iterator_tag</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

, ptrdiff_t</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&gt;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

{</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

public:</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const_iterator(const typename stack_type::const_iterator&amp; it);</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

bool operator==(const const_iterator&amp; other) const;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

bool operator!=(const const_iterator&amp; x) &nbsp; &nbsp;

const;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const symbol_info_type&amp; operator*() &nbsp;const;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const symbol_info_type* operator-&gt;() const;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const_iterator&amp; operator++();</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const_iterator operator++(int);</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const_iterator&amp; operator--();</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

const_iterator operator--(int);</span><span style="font-family: monospace;"></span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

}; //const_iterator</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_iterator begin()&nbsp; const;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_iterator cbegin() const;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_iterator end() &nbsp; &nbsp;const;</span><br style="font-family: monospace;">

<span style="font-family: monospace;"></span><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const_iterator cend() &nbsp; const;</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">private:</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

stack_type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

_stack;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">};</span><br style="font-family: monospace;">

</div>

<p></p>

<span style="font-family: monospace;"></span>

<h3><a class="mozTocH3" name="mozTocId136795"></a>std::exception</h3>

<p><span style="font-family: monospace;">std::exception</span>

is extended to capture the call stack when it is instantiated.

&nbsp;It offers access to the call stack through its <span style="font-family: monospace;">where()</span>

method:&nbsp;</p>

<div style="margin-left: 40px;"><span style="font-family: monospace;">class std::exception</span><br style="font-family: monospace;">

<span style="font-family: monospace;">{</span><br style="font-family: monospace;">

<span style="font-family: monospace;">public: </span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

typedef std::call_stack&lt; default_stack_depth/*40*/ &gt;

stack_type;<br>

<br>

&nbsp; &nbsp; </span><span style="font-family: monospace;">exception() noexcept :

_where(<span style="font-weight: bold;">true</span>)

{...}</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

const stack_type&amp; where() const noexcept</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

{</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

return _where;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

}</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">private: </span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

stack_type&nbsp; _where;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">};</span><br style="font-family: monospace;">

</div>

<p></p>

<span style="font-family: monospace;"></span>

<h3><a class="mozTocH3" name="mozTocId559051"></a>Example

Usage</h3>

<p></p><p>Example 1:</p>

<p><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

typedef call_stack&lt;40&gt; stack_type;</span><br style="font-family: monospace;">

<br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

stack_type; here(true); <span style="font-style: italic;">&nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; // Get the call stack</span></span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

std::cout &lt;&lt; here.depth() &lt;&lt; " frames:\n"</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&lt;&lt; call_stack_info&lt;

stack_type,&nbsp;symbol_info &gt;(here)

&lt;&lt; std::endl;</span><br style="font-family: monospace;">

</p>

<p></p><p>Example 2: usage within the context of an exception:</p>

<p><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

try</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

{</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

...</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

}</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

catch (std::exception&amp; ex)</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

{</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

std::cerr &lt;&lt; ex.what() &lt;&lt; std::endl;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

std::cerr &lt;&lt; "\nAt: \n"</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&lt;&lt; lpt::stack::call_stack_info&lt; stack_type,

symbol_info_base

&gt;(ex.where()) &lt;&lt; std::endl;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

std::cerr &lt;&lt; "\nAt: \n"</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&lt;&lt; lpt::stack::call_stack_info&lt; stack_type,

symbol_info

&gt;(ex.where()) &lt;&lt; std::endl;</span><br style="font-family: monospace;">

<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;

}</span><br style="font-family: monospace;">

</p>

<br>

<h2><a class="mozTocH2" name="mozTocId16316"></a><b>VII.

Existing Implementation</b></h2>

<ul>

<li>GNU/Linux&nbsp;&nbsp;</li><ul><li>http://freeshell.de/~amelinte/lpt.tgz</li><li>http://freeshell.de/~amelinte//lpt/lpt/include/lpt/call_stack.hpp</li></ul><br>

</ul>

<h2><a class="mozTocH2" name="mozTocId40405"></a><b>VIII.

References</b></h2>

<ul>

<li><a name="biblio.josuttis">[1] Nicolai M.

Josuttis, The C++ Standard Library - A Tutorial and Reference, 2012,

Addison Wesley Longman ISBN&nbsp;0-321-62321-5</a></li>

<li><a name="biblio.josuttis"></a>[2]

http://en.wikipedia.org/wiki/Binary_File_Descriptor_library</li>

</ul>

<br>

<h2><a class="mozTocH2" name="mozTocId763219"></a><b><b>IX.

Revision History</b></b></h2>2012-09-20.&nbsp;Incorporated feedback from Alisdair Meredith.

</body></html>
