From: Fred Morcos Date: Sun, 27 Feb 2022 03:43:29 +0000 (+0100) Subject: Documentation: Add section on debugging X-Git-Tag: rec-4.7.0-beta1~60^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=56f014228ccaf2f34b714019850cfbf1d2fb67ab;p=thirdparty%2Fpdns.git Documentation: Add section on debugging --- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4536de61d3..d085eabb31 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -114,3 +114,23 @@ We provide two configuration files for `clang-tidy`: # Development Environment Information about setting up a development environment using a language server like [`clangd`](https://clangd.llvm.org/) or [`ccls`](https://github.com/MaskRay/ccls) can be found in [DEVELOPMENT.md](DEVELOPMENT.md). + +# Debugging + +## Using GDB + +To get a good debugging experience with `gdb`, it is recommended to build PowerDNS using the following flags: + +* `CC` and `CXX` set to `gcc` and `g++`, respectively. +* `CFLAGS` and `CXXFLAGS` set to `-ggdb -Og -fno-inline`. + +These variables need to be set during the `configure` step, as follows: + +```sh +export CC=clang CXX=clang++ +export CFLAGS="-ggdb -Og -fno-inline" CXXFLAGS="-ggdb -Og -fno-inline" +./configure --with-modules=gsqlite3 --disable-lua-records --enable-unit-tests +make -j 8 +``` + +[GDB Dashboard](https://github.com/cyrus-and/gdb-dashboard) can be used to vastly improve the GDB debugging experience.