cunit-testingdebugginggdbcheck-framework

Debugging unit test in C using check


I'm trying to use check unit testing framework for my C application. But I can't use the debugger (gdb) with it because of two points:

Does anyone has already met this problem and has a solution?


Solution

  • Look at the no-fork mode:

    Check normally forks to create a separate address space. This allows a signal or early exit to be caught and reported, rather than taking down the entire test program, and is normally very useful. However, when you are trying to debug why the segmentation fault or other program error occurred, forking makes it difficult to use debugging tools.