Trapping QT debugging messages
-
In the discussion of a recent post (Strange errors from paintEngine) I learned how to use qInstallMessageHandler to catch Qt error messages in the debugger. That hasn't worked for me with a new problem I've encountered. While the "release" version of the app issues the warnings, the "debug" version does not. Any clue why these messages might be suppressed, or even not encountered, in the debug version but not the release version?
-
In the discussion of a recent post (Strange errors from paintEngine) I learned how to use qInstallMessageHandler to catch Qt error messages in the debugger. That hasn't worked for me with a new problem I've encountered. While the "release" version of the app issues the warnings, the "debug" version does not. Any clue why these messages might be suppressed, or even not encountered, in the debug version but not the release version?
@drmhkelley
Then it sounds like only the debug version compiles in the code which calls the Qt message handler. Likely look for macros likeQ_ASSERT,assertor similar.EDIT
While the "release" version of the app issues the warnings, the "debug" version does not
Oh! It's usually the other way round! Anyway, look for symbols defined differently in Debug vs Release builds. Or, just possibly, a problem is being detected only in Release code.
-
@drmhkelley
Then it sounds like only the debug version compiles in the code which calls the Qt message handler. Likely look for macros likeQ_ASSERT,assertor similar.EDIT
While the "release" version of the app issues the warnings, the "debug" version does not
Oh! It's usually the other way round! Anyway, look for symbols defined differently in Debug vs Release builds. Or, just possibly, a problem is being detected only in Release code.
@JonB - Already checked that. The only difference for compiling release vs debug packages (.cpp to .o) is that release has "-DQT_NO_DEBUG" and debug has "-DQT_QML_DEBUG" (not sure why);
The only difference for linking is the use of debug libraries.
-
@drmhkelley
Then it sounds like only the debug version compiles in the code which calls the Qt message handler. Likely look for macros likeQ_ASSERT,assertor similar.EDIT
While the "release" version of the app issues the warnings, the "debug" version does not
Oh! It's usually the other way round! Anyway, look for symbols defined differently in Debug vs Release builds. Or, just possibly, a problem is being detected only in Release code.
@JonB - I don't use Q_ASSERT or assert in my code, so it must come from somewhere in the bowels of Qt. I'm hesitant to go down that road without some better sort of map than I have now.
-
@JonB - I don't use Q_ASSERT or assert in my code, so it must come from somewhere in the bowels of Qt. I'm hesitant to go down that road without some better sort of map than I have now.
@drmhkelley
Then is it indeedOr, just possibly, a problem is being detected only in Release code.
?
-
@drmhkelley
Then is it indeedOr, just possibly, a problem is being detected only in Release code.
?
@JonB - how would one know?
-
@JonB - how would one know?
@drmhkelley
You can't know for sure, unless you write perfect code in the first place. Depends on the code and what the messages are. Find the message text, track it down.