Open
Description
When debugging it would be useful to have a single option for enabling symbols and debugging information and avoid stripping the binary. Now that stacktraces work again it can also be useful with symbols from libcxx and musl. One solution could be to use dontStrip and enableDebugging in nix to control it, see https://nixos.wiki/wiki/Debug_Symbols.
Some debugging options I have found are listed below.
In cmake:
- If you use
set(ELF_SYMBOLS true
, symbols will be added to the final binary (via https://github.com/includeos/IncludeOS/blob/v0.16.0-release/cmake/os.cmake#L206) - You can set the library debug option: https://github.com/includeos/IncludeOS/blob/v0.16.0-release/cmake/library.cmake#L44
- There's also CMAKE_BUILD_TYPE=Debug:
- ...and a hardcoded NO_DEBUG, which disables the DEBUG-output macro https://github.com/includeos/IncludeOS/blob/v0.16.0-release/cmake/includeos.cmake#L40
Musl and musl-unpatched uses --enable-debug
- https://github.com/includeos/IncludeOS/blob/v0.16.0-release/deps/musl/default.nix#L37
- https://github.com/includeos/IncludeOS/blob/v0.16.0-release/deps/musl-unpatched/default.nix#L20
There could be more :-)