-
Notifications
You must be signed in to change notification settings - Fork 24
HowTo: Debugging
This page explains how to debug Multiload-ng.
First of all, it's worth saying that the way of debugging a panel plugin depends strictly on the panel. This document will try to guide you into debugging a problem in a panel or in the plugin.
Follow these steps before debugging, in any case.
- add debug CFLAGS in Makefile:
-ggdb -O0 - enable verbose messages running from terminal:
export G_MESSAGES_DEBUG=all
WARNING: this produces A LOT of output from virtually EVERY app, and slows down everything! Disable when not needed.
If the problem you're trying to fix is in the "glue" code between the plugin and the panel, it could be useful to debug the plugin when it's into the panel. This process is not the same in every panel:
- in panels where every plugin is a separate process, you can attach GDB to a running plugin
- in single-process panels, you can try to attach GDB to the panel itself.
If your panel has debugging options (other then build flags), enable these. --sync is a common option.
If the problem you're trying to fix is in the plugin code, you can run the plugin without panels by building standalone target of Multiload-ng, that is the plugin wrapped in a simple GtkWindow.
I strongly suggest using standalone target for debug. It has the following advantages:
- it's so much easier to debug, not being embedded in any panel
- helps isolating problems related to plugin and problems related to panels
- does not rely on panel being debuggable