Skip to content

HowTo: Debugging

Mario Cianciolo edited this page Jul 13, 2016 · 6 revisions

This page explains how to debug Multiload-ng.

Introduction

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.

Before debugging

Follow these steps before debugging, in any case.

  1. add debug CFLAGS in Makefile: -ggdb -O0
  2. 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.

Debugging into a panel

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.

Debugging the plugin alone

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

Clone this wiki locally