Re-enable building with no compiler optimization at all in debug mode
Commit 559fa7ed44238e811ac0c11321ed021c35cba2be removed -O0 CFLAGS, thus now -02 is the default, which makes debugging difficult as it is not possible anymore to set breakpoints on certain functions. Here is a small patch to address this issue without overriding completely CFLAGS.
Updated by Arnaud Fontaine almost 9 years ago
Perhaps we could have
--enable-debug which builds with
-O0 and a separate option
--enable-backtrace, however I'm wondering if it would be necessary because it won't be a full backtrace anyway when not using
For example, I tried building with
--enable-debug and without
-00 after introducing a NULL pointer in irc_privmsg, I get the following backtrace:
05-10-2011 12:02:40 FATAL: Failed assertion in src/util.c(596): hash && key
And when building with
05-10-2011 12:04:00 FATAL: Failed assertion in src/util.c(596): hash && key
As you can see, the backtrace is not full when not building with
log_privmsg is not there for example).
Anyhow, I think that most people builds with
--enable-backtrace because of an issue, therefore it would be useful anyway to build with
-O0 to have the most meaningful backtrace because it would help figuring out what's wrong from a developer point of view.
What do you think?