Skip to content
Gaute Hope edited this page May 31, 2017 · 11 revisions

Debugging using gdb

Compile without --release argument to enable debugging:

$ scons

Then run astroid using gdb (here without starting the automatic polling):

$ gdb --args ./astroid --no-auto-poll

after a crash, type e.g. bt at the gdb prompt to get a backtrace.

Profiling using gprof

Compile with the --profiler option:

$ scons --profiler

To profile, run astroid:

$ astroid --no-auto-poll # no automatic polling

this creates the file gmon.out in the current directory. Use gprof to parse the output, and gprof2dot and dot (part of graphviz) to graph the output:

$ gprof astroid | gprof2dot -s | dot -Tpng -o prof.png
Clone this wiki locally