Launching a unit test for debugging in GDB
While building a new feature it is a good idea to test it with the help of unit tests. But it may also happen that the feature is not yet linked to the UI and you have no way to debug it. I tried to work around this problem by trying to use the unit test to gain entry to the code and set breakpoints there.
In LibreOffice we can launch a unit test in gdb by
In LibreOffice we can launch a unit test in gdb by
make
<name of the makefile of the unit test> CPPUNITTRACE="gdb --args"
e.g.
make
CppunitTest_sc_dataprovider
CPPUNITTRACE="gdb --args"
Then you can set breakpoints in gdb and then run.
Comments
Post a Comment