Skip to content

Latest commit

 

History

History
28 lines (16 loc) · 1 KB

debug-friendly-run.md

File metadata and controls

28 lines (16 loc) · 1 KB

Debug Friendly Run

In order to get more accurate stack traces, set

build_type="Debug"

in config.sh, compile (if not compiled already) and run FreeCAD under gdb:

  1. Add the following into .bashrc [1]:

    alias bt='echo 0 | gdb -batch-silent -ex "run" -ex "set logging overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo backtrace:\n" -ex "backtrace full" -ex "echo \n\nregisters:\n" -ex "info registers" -ex "echo \n\ncurrent instructions:\n" -ex "x/16i \$pc" -ex "echo \n\nthreads backtrace:\n" -ex "thread apply all backtrace" -ex "set logging off" -ex "quit" --args'
  2. Run FreeCAD:

    bt ~/fc-build/Debug/bin/FreeCAD
    
  3. After crash, debug output will be at ~/gdb.bt

Tips

  • You can use create-gist.sh for uploading the dump files to Gist:

    create-gist.sh ~/gdb.bt