=== align ASSERT (& friends) macro foo === '''Background:''' Two families of debug type macros exist in the openoffice code base, the OSL family ( OSL_TRACE, OSL_ASSERT, OSL_ENSURE etc. ) defined http://opengrok.go-oo.org/xref/ure/sal/inc/osl/diagnose.h and the DBG family ( DBG_ASSERT, DBG_TRACE etc. ) defined http://opengrok.go-oo.org/xref/libs-gui/tools/inc/tools/debug.hxx. The OSL family of macros are enabled when you build with debug ( --enable-debug configure option ) and the DBG family with ( --enable-dbgutil ) The OSL family should be considered to be the desired variant. <strike>Some local ASSERT variants also exist such as 'ASSERT' & ASSERT_ID' http://opengrok.go-oo.org/xref/writer/sw/inc/errhdl.hxx#58, these should be replaced with OSL_ASSERT. Also in there is VOS_ASSERT ( which is actually defined to be OSL_ASSERT ) Directly replacing occurrences of VOS_ASSERT with OSL_ASSERT should also be done.</strike> Eventually we should remove/replace the DBG family of macros with OSL variants. '''Skills:''' building, simple C++ programming '''Working on it:''' Thomas Arnhold, 2011-02-21 '''Status:''' converted all DBG_ERROR to OSL_* locally, currently test building, 2011-03-04
Created attachment 49825 [details] Perl script which helped me to convert some stuff.
Created attachment 50418 [details] Replace DBG_ macros with OSL_ equivalents in accessibility/
Created attachment 50419 [details] Follow-up of the previous patch in accessibility/ Since the removal of debug.hxx altogether is the ultimate goal this patch removes DBG_NAME, DBG_CTOR, DBG_DTOR in accessibility which in result allows to delete all debug.hxx occurences in the same folder. The question is whether someone does need statistical information provided by functions like "DBG_DTOR( VCLXAccessibleToolBoxItem, NULL );". I asked a similar question on the mailing list and a suggestion was that DBG_CTOR/DBG_DTOR with empty argument can be removed, whereas when the second argument is not NULL some different solution has to be applied. Nevertheless, this patch should be regarded as a question that will help me to prepare similar patches in the future.
caolanm->sbergman: worth factoring this easy-hack into the "what we should do with asserts, traces, warnings" plan. i.e. mass convert DBG_FOO things ?
Removing EasyHack status for now until the debugging facility discussion has settled and is linked here in concise summary form.
Stephan - did we settle the debugging thing yet ? :-)
(In reply to comment #6) > Stephan - did we settle the debugging thing yet ? :-) The <cassert> and "sal/log.hxx" functionality (assert, SAL_INFO, SAL_WARN, etc.) is nowadays the functionality of choice, see <http://wiki.documentfoundation.org/Development#Assertions_and_Logging>. ("The functionality offered by osl/diagnose.h and tools/debug.hxx is obsoleted by sal/log.hxx.") Lubos once stated he would like to revisit the sal/log.hxx interface again, but I don't think he still plans to do so. This easy hack is slightly different from easy hack bug 43157, where the latter only concentrates on removing the osl/diagnose.h and tools/debug.hxx functionality that is directly obsoleted by sal/log.hxx, while this bug also addresses further old functionality like DBG_NAME, DBG_CTOR, etc., cf. comment 3. We can either make one bug a duplicate of the other or keep both.
(In reply to comment #7) > Lubos once stated he would like to revisit the sal/log.hxx interface again, but > I don't think he still plans to do so. I would still theoretically like to do something about the ostream usage there, but with all the other things on my plate I don't see this important enough for the foreseeable future, so I can live with the current log.hxx functionality as it is.
Comment on attachment 50418 [details] Replace DBG_ macros with OSL_ equivalents in accessibility/ thanks for the patch, i've just pushed it to master, and mark this patch as "obsolete" so it does not clutter up bugzilla searches PS: for future work, please send it to the mailing list directly, and please use SAL_WARN instead of OSL_ENSURE
Comment on attachment 50419 [details] Follow-up of the previous patch in accessibility/ thanks for the patch, i've just pushed it to master, and mark this patch as "obsolete" so it does not clutter up bugzilla searches
Jacek Wolszczak committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=caf0e31e2478884839456bd499fc943324121d77 fdo#39425: Replace DBG_ASSERT macros with OSL_ equivalents in accessibility
Jacek Wolszczak committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3c1a1aacf5a1eac4b16c2a2eacbaf262e295d2a0 fdo#39425: Remove DBG_NAME, DBG_CTOR, DBG_DTOR and debug.hxx in accessibility
(In reply to comment #0) > === align ASSERT (& friends) macro foo === > Björn, is this still sufficiently clear in definition and scope for an easy hack? I had some trouble following the train of thoughts - maybe distill the remainder into a new bug?
@thb: I just copied this one over from the wiki back in the dawn of time. I would assume sberg to be the guy to best judge how to formulate the the remaining goals of this beast.
How does this bug relate to bug 43157?
Bug #43157 makes this one obsolete. *** This bug has been marked as a duplicate of bug 43157 ***
Migrating Whiteboard tags to Keywords: (EasyHack,DifficultyBeginner,SkillCpp,TopicCleanup) [NinjaEdit]