Debug-info

Debug-info

How to generate debug-info

To build your library with debug-info you should add -g -Og options of the compiler.

If you are using Autotools to build your library then you can add required options to CXXFLAGS and CFLAGS variables when configuring your library:

./configure CXXFLAGS="-g -Og" CFLAGS="-g -Og"

In case of CMake you can set CMAKE_CXX_FLAGS and CMAKE_C_FLAGS options:

cmake . -DCMAKE_CXX_FLAGS="-g -Og" -DCMAKE_C_FLAGS="-g -Og"

In case of Meson you can set CXXFLAGS and CFLAGS environment variables:

CXXFLAGS="-g -Og" CFLAGS="-g -Og" meson . build_dir --buildtype=plain

You can check if the library contains the debug-info by this command:

readelf -S YOUR_LIBRARY.SO | grep ".debug_info"


github.com/lvc
Facebook Twitter Vkontakte Reddit Github Email Skype QZone Weibo