Stack trace after catching exception
<p>I would like too see the stacktrace after the exception is thrown of course using debugger. Normally, when the exception is never caught, the debugger stops the program after receiving <code>SIGABRT</code> and I can see the whole stack trace and recognize the reason for the exception.  </p>

<p>However how to diagnose the cause of the exception after catching it?</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;stdexcept&gt;

void foo() {
    throw std::runtime_error("An error message");
}

int main() {
    try {
        foo();
    } catch (const std::exception &amp;e) {
        std::cerr &lt;&lt; e.what(); // add breakpoint here
    }        
    return 0;
}
</code></pre>

<p>Adding a breakpoint in the catch section naturally stops the program after catching exception however the stack trace doesn't contain <code>foo()</code> call therefore the cause of the exception cannot be diagnosed.</p>

<p>Please note that the example is really minimal and simple. With complex and nested calls the information that exception occurred somewhere in the <code>try</code> section is virtually useless. And I cannot simply avoid catching exception because if I don't catch it then it is caught by the framework I'm using and the stacktrace is lost.</p>