Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork247
Debug symbols in various languages and build systems
matu3ba edited this pageJul 25, 2021 ·1 revision
For debugging advanced language features like macros, check the build system/compiler documentation.
clang/gcc/tcc.. -g# simpler C compilers like tcc dont have optimisation levelsclang/gcc -O0/O1/-O2/-O3# prefer -O0 for getting more debugging symbols
clang/gcc -gclang/gcc -O0/O1/-O2/-O3# prefer -O0 for getting more debugging symbolsRUSTFLAGS=-g cargo build# better use profiles in `Cargo.toml`RUSTFLAGS='-g --opt-level=1' cargo build# Both are slow to write and force debugging info for all projects.
zig build-exe -O Debug
# `CMakeLists.txt` can require hard to understand stuff like `set(CMAKE_BUILD_TYPE "Release" CACHE STRING FORCE)` for debugging.cmake -DCMAKE_BUILD_TYPE="Debug"# keep it simple. `RelWithDebInfo` also an option
meson setup buildfolder ----buildtype debug# default is `debug`meson configure ----buildtype`debug|debugoptimized`# default is debug