Debugging Feel++

Discuss on a particular application

1. Debug mode

To debug Feel++ code, it is best to work within the cmake Debug environment:

Command line to configure Feel++ in Debug mode
configure -d

you recompile Feel++ or just the application you are interested in.

2. Using the Address sanitizer

It is strongly advise to use the Address Sanitizer

Command line to configure Feel++ in Debug mode
configure -d --enable-asan

GDB can be used as usual with applications built with AddressSanitizer support. When AddressSanitizer finds a bug you can set a breakpoint

  • right before it generates the error report by setting a breakpoint on __asan::ReportGenericError

  • right after the error generation by setting a breakpoint on __asan::Die

you can also set the environment variable ASAN_OPTIONS=abort_on_error=1 to get the same effect as in the second case

> ASAN_OPTIONS=abort_on_error=1  gdb <executable to debug>

It is advised to disable the leak detection while looking for a bug as follows

> ASAN_OPTIONS=detect_leaks=0  gdb <executable to debug>

To combine multiple address sanitizer options in the command line, separate them with a : like below

> ASAN_OPTIONS=detect_leaks=0:abort_on_error=1  gdb <executable to debug>