diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-30 13:37:12 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-30 13:57:40 (GMT) |
commit | 98687d47cc64133856de187cfc2acace3f42652e (patch) | |
tree | 99ef2bba80955373670409c6f5529706c21b4277 /src/plugins/platforms/xcb/qxcbconnection.cpp | |
parent | f64bd45a1595bd012dcaa6c3b7ffa778c084b5ca (diff) | |
download | Qt-98687d47cc64133856de187cfc2acace3f42652e.zip Qt-98687d47cc64133856de187cfc2acace3f42652e.tar.gz Qt-98687d47cc64133856de187cfc2acace3f42652e.tar.bz2 |
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.
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 12 |
1 files 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) { |