1. stop the program
2. edit it to add the new log
3. rebuild the program
4. run it
5. get the program to the same state to trigger the log
3. can take quite a while on some projects, and 5. can take quite a while too for long-running programs.And then you see the result of what you printed, figure out you need something else as well, and repeat. Instead you can just trigger a breakpoint and inspect the entire program's state.
* You're using to doing things the Windows way, where debug and release are completely different profiles rather than orthogonal flags. Or,
* You're compiling using Clang, which gives up and limits debuggability to simple backtraces when optimization is on. Or,
* Your project is hopelessly bloated and linking with debuginfo is slow, but you haven't figured out external debuginfo.
With GCC, `-g -O2` is a reasonable thing to use for all builds and provides a pretty good debugging experience with only minor competence required to find equivalences for any <optimized out>s.