title: How can I print stack trace for caught exceptions in C++ & code injection in C++
body: <p>I want to have stack trace not for my exceptions only but also for any descendants of <code>std::exception</code></p>
  
  <p>As I understand, stack trace is completely lost when exception is caught because of stack unwinding (unrolling). </p>
  
  <p>So the only way I see to grab it is injection of code saving context info (stack trace) at the place of <code>std::exception</code> constructor call. Am I right?</p>
  
  <p>If it is the case, please tell me how code injection can be done (if it can) in C++. Your method may be not  completely safe because I need it for Debug version of my app only. May be I need to use assembler?</p>
  
  <p>I'm interested only in solution for GCC. It can use c++0x features</p>