How do you enable the #ifdef DEBUG sections?
tml at iki.fi
Sat Mar 28 05:10:14 PDT 2015
> There are sections of the code marked #ifdef DEBUG. How can I properly
> enable compiling those sections in?
That depends on the code in question. Such debugging code might in
some cases be code nobody has compiled for years, and bit-rotted, and
not compiling or working any more. This is why we very much should
prefer to make debugging code dependent on DBG_UTIL instead, so that
it gets compiled regularly. (And then if the code is such that it
should not be invoked every time even in a dbgutil build, use some
environment variable to activate it.)
> For example, I want to enable DEBUG_ELEMENT in
I see no DEBUG_ELEMENT in writerfilter in master, you must be looking
at some older branch. Ah yes, that was cleaned last summer:
Author: Jan Holesovsky <kendy at collabora.com>
Date: Wed Jun 18 11:30:49 2014 +0200
writerfilter: Fold all the various DEBUG_* macros into DEBUG_DOMAINMAPPER.
They were set either all, or none anyway.
If you check the Library_writerfilter.mk in the branch you are looking
at, you will notice that DEBUG_ELEMENT (and all the other DEBUG_FOO)
are defined on the compilation command line if gb_DEBUGLEVEL is higher
than 1. I.e. you need to build writerfilter with 'make writerfilter
dbglevel=2', I think.
More information about the LibreOffice