Panel Plugin Debugging

An easy way to debug an external panel-plugin with Valgrind :

#!/bin/sh
valgrind --log-file=/path/to/valgrind.output /path/to/panel-plugins/foo-plugin.real $@

Note. It'll be really slow as wrapped in valgrind, but you'll be able to hunt memory leaks using tail -f /path/to/valgrind.output

Alternative way

Edit your .desktop file of the plugin (for most easy results, directly in the source directory) and append .valgrind to the xfce-exec line. Then create a file like described above, but named xfce4-my-plugin.valgrind in the same location. It will never ever be overwritten by any of your subsequent installations, and your .desktop file won't destroy anything as well. Ah, make the .valgrind script executable as well.

Pay attention to edit the xfce-exec line before checking into subversion or making a release.

More senseful call to Valgrind

valgrind --tool=memcheck --leak-check=full --show-reachable=yes -v --log-file=/home/user/valgrind.txt /usr/local/libexec/xfce4/panel-plugins/xfce4-sensors-plugin $@