debugging tests running under valgrind (e.g. perfcheck)

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Apr 16 17:33:19 UTC 2016


Hey,

so I had the joy of debugging one of the perfcheck tests and noticed that
running them normally under gdb does not work (valgrind and gdb don't play
nice with each other by default). However there is a gdbserver built into
valgrind so we now have VALGRIND_GDB which if set to TRUE will start the
valgrind gdb server and wait for a connection. You can then connect to the
test from a gdb instance started with
gdb workdir/LinkTarget/Executable/cppunittester

and inside of gdb
target remote | vgdb

After that you are connected to the valgrind gdbserver and can start
debugging the test.

Regards,
Markus

P.S. In theory you can query the gdbserver for leaked memory when you run
memcheck but the last time I tried that it reported a lot of potentially
leaked memory.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20160416/33217937/attachment.html>


More information about the LibreOffice mailing list