I launch gdb in &quot;batch mode&quot; from a shell file with &quot;gdb --batch -x command.txt&quot; to get the callstack under exception.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;vmorgulys&#x2F;sandbox&#x2F;blob&#x2F;master&#x2F;stackcity&#x2F;tool&#x2F;gdb&#x2F;command.txt" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vmorgulys&#x2F;sandbox&#x2F;blob&#x2F;master&#x2F;stackcity&#x2F;t...</a><p><pre><code>    set pagination off
    catch throw
    run
    bt 50
    quit</code></pre>