DEV IN PROGRESS

Libraries with debug symbols

There are some advantages from having recompiled dependencies:

  • translation of all addresses in debug session;
  • instrumentation of code easing bahaviour understanding;
  • support for Valgrind while tracking memory usages.

As not all Linux distributions offer packages with debug version of libraries, it may be usefull to recompile manually these libraries in order to benefit all the quoted advantages.

The page documents the process for the main Chrysalide's dependencies.

GLib

The GLib includes support for better tracking memory allocations and frees using Valgrind.

Sources

The GLib's homepage provides links to packaged source code. However, the current version used by a distribution can be retrieved from command line, for instance with Debian:

apt-get source libglib2.0-0

Compilation

The compilation can be setup and run with the following commands:

cd glib2.0-*

meson setup _build

meson configure \
    -Dbuildtype=debug \
    -Doptimization=g \
    -Dprefix=/tmp/sys \
    -Dtests=false \
    -Dxattr=false \
    -Dglib_debug=enabled _build

ninja -C _build install

Usage

Newly compiled libraries can be used by exporting their location before launching Chrysalide:

export LD_LIBRARY_PATH=/tmp/sys/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH