From f2b9a249664349dcf7bda907707023fa5b9a29ba Mon Sep 17 00:00:00 2001 From: Arvid Ephraim Picciani Date: Mon, 6 Sep 2010 14:18:32 +0200 Subject: Enable QLibrary debugging via QT_DEBUG_PLUGINS Reviewed-by: janarve --- src/corelib/plugin/qlibrary.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 8f82cc4..239509e 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -64,8 +64,6 @@ QT_BEGIN_NAMESPACE -//#define QT_DEBUG_COMPONENT - #ifdef QT_NO_DEBUG # define QLIBRARY_AS_DEBUG false #else @@ -385,8 +383,12 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB } else { pos = qt_find_pattern(filedata, fdlen, pattern, plen); } - } else if (r != QElfParser::Ok) + } else if (r != QElfParser::Ok) { + if (lib && qt_debug_component()) { + qWarning(qPrintable(lib->errorString)); + } return false; + } #else pos = qt_find_pattern(filedata, fdlen, pattern, plen); #endif // defined(Q_OF_ELF) && defined(Q_CC_GNU) @@ -1275,15 +1277,11 @@ QLibrary::LoadHints QLibrary::loadHints() const /* Internal, for debugging */ bool qt_debug_component() { -#if defined(QT_DEBUG_COMPONENT) - return true; //compatibility? -#else static int debug_env = -1; if (debug_env == -1) debug_env = QT_PREPEND_NAMESPACE(qgetenv)("QT_DEBUG_PLUGINS").toInt(); return debug_env != 0; -#endif } QT_END_NAMESPACE -- cgit v0.12