Xfce Wiki

Sub domains
 

This is an old revision of the document!


Panel Plugin Debugging

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

  • In /usr/local/libexec/xfce4/panel-plugins/ (or where your plugins are installed) rename the panel binary named foo-plugin to foo-plugin.real
  • Create an executable shellscript named foo-plugin in the same place, containing :
#!/bin/sh
valgrind --log-file=/path/to/valgrind.output /path/to/panel-plugins/foo-plugin.real $@
  • Add the plugin to the panel as usual
  • Now you are able to use tail -f /path/to/valgrind.output

It'll be really slow as wrapped in valgrind, but you'll be able to hunt memory leaks.

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 and make the .valgrind script executable as well.

It will never ever be overwritten by any of your subsequent installations, and your .desktop file won't destroy anything 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 $@