From 98687d47cc64133856de187cfc2acace3f42652e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 30 Mar 2011 15:37:12 +0200 Subject: Better error reporting in XCB platform. Try to report the interval of known calls between which the X error was generated, if we can't find a sequence match. --- src/plugins/platforms/xcb/qxcbconnection.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index ffa6537..22149f0 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -399,7 +399,6 @@ const char *xcb_protocol_request_codes[] = "GetPointerMapping", "SetModifierMapping", "GetModifierMapping", - "NoOperation", "Unknown" }; @@ -436,12 +435,20 @@ void QXcbConnection::run() int(error->minor_code)); #ifdef Q_XCB_DEBUG QMutexLocker locker(&m_callLogMutex); - for (int i = 0; i < m_callLog.size(); ++i) { + int i = 0; + for (; i < m_callLog.size(); ++i) { if (m_callLog.at(i).sequence == error->sequence) { printf("Caused by: %s:%d\n", qPrintable(m_callLog.at(i).file), m_callLog.at(i).line); break; + } else if (m_callLog.at(i).sequence > error->sequence) { + printf("Caused some time before: %s:%d\n", qPrintable(m_callLog.at(i).file), m_callLog.at(i).line); + if (i > 0) + printf("and after: %s:%d\n", qPrintable(m_callLog.at(i-1).file), m_callLog.at(i-1).line); + break; } } + if (i == m_callLog.size() && !m_callLog.isEmpty()) + printf("Caused some time after: %s:%d\n", qPrintable(m_callLog.first().file), m_callLog.first().line); #endif continue; } @@ -465,6 +472,7 @@ void QXcbConnection::run() && ((xcb_client_message_event_t *)event)->type == QXcbAtom::_QT_PAUSE_CONNECTION) { QMutexLocker locker(&m_connectionLock); + continue; } switch (response_type) { -- cgit v0.12