Title: [103329] trunk
Revision
103329
Author
kbal...@webkit.org
Date
2011-12-20 07:21:49 -0800 (Tue, 20 Dec 2011)

Log Message

[Qt] WK2 Debugging quirks need some improvement
https://bugs.webkit.org/show_bug.cgi?id=74859

Reviewed by Simon Hausmann.

Improvements added to make debugging WebKit2 more
confortable and efficient:
1. Unify debugging quirks. From now all of them are controlled
by the QT_WEBKIT2_DEBUG environment variable.
2. Disable crash handlers for WebKitTestRunner if debugging quirks
are used to make it possible to use postmortem debugging via core dumps
which is extremely useful for debugging bugs triggered by layout tests.
3. Disable test timeout for WebKitTestRunner if debugging quirks
are used because that makes debugging impossible.

Source/WebKit2:

* UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
(WebKit::QtWebProcess::setupChildProcess):
* WebProcess/qt/WebProcessMainQt.cpp:
(WebKit::WebProcessMainQt):

Tools:

* WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp:
(WTR::InjectedBundle::platformInitialize):
* WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp:
(WTR::LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded):
* WebKitTestRunner/qt/TestControllerQt.cpp:
(WTR::TestController::platformRunUntil):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (103328 => 103329)


--- trunk/Source/WebKit2/ChangeLog	2011-12-20 15:07:09 UTC (rev 103328)
+++ trunk/Source/WebKit2/ChangeLog	2011-12-20 15:21:49 UTC (rev 103329)
@@ -1,3 +1,25 @@
+2011-12-20  Balazs Kelemen  <kbal...@webkit.org>
+
+        [Qt] WK2 Debugging quirks need some improvement
+        https://bugs.webkit.org/show_bug.cgi?id=74859
+
+        Reviewed by Simon Hausmann.
+
+        Improvements added to make debugging WebKit2 more
+        confortable and efficient:
+        1. Unify debugging quirks. From now all of them are controlled
+        by the QT_WEBKIT2_DEBUG environment variable.
+        2. Disable crash handlers for WebKitTestRunner if debugging quirks
+        are used to make it possible to use postmortem debugging via core dumps
+        which is extremely useful for debugging bugs triggered by layout tests.
+        3. Disable test timeout for WebKitTestRunner if debugging quirks
+        are used because that makes debugging impossible.
+
+        * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
+        (WebKit::QtWebProcess::setupChildProcess):
+        * WebProcess/qt/WebProcessMainQt.cpp:
+        (WebKit::WebProcessMainQt):
+
 2011-12-20  Jesus Sanchez-Palencia  <jesus.palen...@openbossa.org>
 
         [Qt][WK2]REGRESSION(r103310): It broke tst_QQuickWebView::loadNonexistentFileUrl() API test

Modified: trunk/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp (103328 => 103329)


--- trunk/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp	2011-12-20 15:07:09 UTC (rev 103328)
+++ trunk/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp	2011-12-20 15:21:49 UTC (rev 103329)
@@ -89,7 +89,7 @@
 {
 #if defined(Q_OS_LINUX)
 #ifndef NDEBUG
-    if (getenv("QT_WEBKIT_KEEP_ALIVE_WEB_PROCESS"))
+    if (qgetenv("QT_WEBKIT2_DEBUG") == "1")
         return;
 #endif
     prctl(PR_SET_PDEATHSIG, SIGKILL);

Modified: trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp (103328 => 103329)


--- trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp	2011-12-20 15:07:09 UTC (rev 103328)
+++ trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp	2011-12-20 15:21:49 UTC (rev 103329)
@@ -161,7 +161,7 @@
     QApplication::setGraphicsSystem(QLatin1String("raster"));
     QApplication* app = new QApplication(argc, argv);
 #ifndef NDEBUG
-    if (!qgetenv("WEBKIT2_PAUSE_WEB_PROCESS_ON_LAUNCH").isEmpty()) {
+    if (qgetenv("QT_WEBKIT2_DEBUG") == "1") {
         qDebug() << "Waiting 3 seconds for debugger";
         sleep(3);
     }

Modified: trunk/Tools/ChangeLog (103328 => 103329)


--- trunk/Tools/ChangeLog	2011-12-20 15:07:09 UTC (rev 103328)
+++ trunk/Tools/ChangeLog	2011-12-20 15:21:49 UTC (rev 103329)
@@ -1,3 +1,27 @@
+2011-12-20  Balazs Kelemen  <kbal...@webkit.org>
+
+        [Qt] WK2 Debugging quirks need some improvement
+        https://bugs.webkit.org/show_bug.cgi?id=74859
+
+        Reviewed by Simon Hausmann.
+
+        Improvements added to make debugging WebKit2 more
+        confortable and efficient:
+        1. Unify debugging quirks. From now all of them are controlled
+        by the QT_WEBKIT2_DEBUG environment variable.
+        2. Disable crash handlers for WebKitTestRunner if debugging quirks
+        are used to make it possible to use postmortem debugging via core dumps
+        which is extremely useful for debugging bugs triggered by layout tests.
+        3. Disable test timeout for WebKitTestRunner if debugging quirks
+        are used because that makes debugging impossible.
+
+        * WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp:
+        (WTR::InjectedBundle::platformInitialize):
+        * WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp:
+        (WTR::LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded):
+        * WebKitTestRunner/qt/TestControllerQt.cpp:
+        (WTR::TestController::platformRunUntil):
+
 2011-12-20  Rafael Brandao  <rafael.l...@openbossa.org>
 
         [Qt][WK2] Implement favicon support

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp (103328 => 103329)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp	2011-12-20 15:07:09 UTC (rev 103328)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp	2011-12-20 15:21:49 UTC (rev 103329)
@@ -26,6 +26,8 @@
 
 #include "config.h"
 #include "InjectedBundle.h"
+#include <QByteArray>
+#include <QtGlobal>
 #include <stdio.h>
 #include <stdlib.h>
 #include <wtf/AlwaysInline.h>
@@ -71,6 +73,9 @@
 
 void InjectedBundle::platformInitialize(WKTypeRef)
 {
+    if (qgetenv("QT_WEBKIT2_DEBUG") == "1")
+        return;
+
 #if HAVE(SIGNAL_H)
     signal(SIGILL, crashHandler);    /* 4:   illegal instruction (not reset when caught) */
     signal(SIGTRAP, crashHandler);   /* 5:   trace trap (not reset when caught) */

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp (103328 => 103329)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp	2011-12-20 15:07:09 UTC (rev 103328)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp	2011-12-20 15:21:49 UTC (rev 103329)
@@ -77,6 +77,9 @@
 
 void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
 {
+    if (qgetenv("QT_WEBKIT2_DEBUG") == "1")
+        return;
+
     if (m_waitToDumpWatchdogTimer.isActive())
         return;
 

Modified: trunk/Tools/WebKitTestRunner/qt/TestControllerQt.cpp (103328 => 103329)


--- trunk/Tools/WebKitTestRunner/qt/TestControllerQt.cpp	2011-12-20 15:07:09 UTC (rev 103328)
+++ trunk/Tools/WebKitTestRunner/qt/TestControllerQt.cpp	2011-12-20 15:21:49 UTC (rev 103329)
@@ -55,6 +55,13 @@
 
 void TestController::platformRunUntil(bool& condition, double timeout)
 {
+    if (qgetenv("QT_WEBKIT2_DEBUG") == "1") {
+        // Never timeout if we are debugging.
+        while (!condition)
+            QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents, 50);
+        return;
+    }
+
     int timeoutInMSecs = timeout * 1000;
     QElapsedTimer timer;
     timer.start();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to