Search code examples
debuggingapportable

How to see stack trace when app is crashed by C/C++ exception?


Currently, Apportable doesn't show any stack trace on crash by C/C++ exception.

How can I make it to print stack-trace when it is crashed?


Solution

  • You can use apportable debug to attach a gdb debugger to the app. Then use the command continue to get to the crash; backtrace to see the trace; up, down, and frame {number} to navigate through the trace; and print {expression} to examine state.

    More information in the docs page.

    For C++ exceptions in particular, you will get a confusing stack trace. We'll investigate adding better debugger support for these. In the meantime you could set a breakpoint on the throw(break __cxa_throw).