Title: [115958] trunk
Revision
115958
Author
[email protected]
Date
2012-05-03 04:14:20 -0700 (Thu, 03 May 2012)

Log Message

[Qt] Allow the web process and WTR to be paused on startup

Makes it easier to debug the web process or run-webkit-tests -2, as you
have ample time to attach gdb to the process.

Reviewed by Simon Hausmann.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (115957 => 115958)


--- trunk/Source/WebKit2/ChangeLog	2012-05-03 11:01:04 UTC (rev 115957)
+++ trunk/Source/WebKit2/ChangeLog	2012-05-03 11:14:20 UTC (rev 115958)
@@ -1,3 +1,17 @@
+2012-05-03  Tor Arne Vestbø  <[email protected]>
+
+        [Qt] Allow the web process and WTR to be paused on startup
+
+        Makes it easier to debug the web process or run-webkit-tests -2, as you
+        have ample time to attach gdb to the process.
+
+        Reviewed by Simon Hausmann.
+
+        * WebProcess/qt/WebProcessMainQt.cpp:
+        (WebKit::WebProcessMainQt):
+        * qt/MainQt.cpp:
+        (main):
+
 2012-05-03  Alexander Færøy  <[email protected]>
 
         Rename deviceDPI to devicePixelRatio

Modified: trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp (115957 => 115958)


--- trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp	2012-05-03 11:01:04 UTC (rev 115957)
+++ trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp	2012-05-03 11:14:20 UTC (rev 115958)
@@ -141,13 +141,6 @@
 
 Q_DECL_EXPORT int WebProcessMainQt(QGuiApplication* app)
 {
-#ifndef NDEBUG
-    if (qgetenv("QT_WEBKIT2_DEBUG") == "1") {
-        qDebug() << "Waiting 3 seconds for debugger";
-        sleep(3);
-    }
-#endif
-
     initializeProxy();
 
     srandom(time(0));

Modified: trunk/Source/WebKit2/qt/MainQt.cpp (115957 => 115958)


--- trunk/Source/WebKit2/qt/MainQt.cpp	2012-05-03 11:01:04 UTC (rev 115957)
+++ trunk/Source/WebKit2/qt/MainQt.cpp	2012-05-03 11:14:20 UTC (rev 115958)
@@ -48,6 +48,14 @@
 // to reimplement the handling of command line arguments from QApplication.
 int main(int argc, char** argv)
 {
+#if !defined(NDEBUG) && defined(Q_OS_UNIX)
+    if (qgetenv("QT_WEBKIT_PAUSE_WEB_PROCESS") == "1" || qgetenv("QT_WEBKIT2_DEBUG") == "1") {
+        fprintf(stderr, "Pausing web process, please attach to PID %d and continue... ", getpid());
+        pause();
+        fprintf(stderr, " OK\n");
+    }
+#endif
+
     WebKit::initializeWebKit2Theme();
 
     // Has to be done before QApplication is constructed in case

Modified: trunk/Tools/ChangeLog (115957 => 115958)


--- trunk/Tools/ChangeLog	2012-05-03 11:01:04 UTC (rev 115957)
+++ trunk/Tools/ChangeLog	2012-05-03 11:14:20 UTC (rev 115958)
@@ -1,3 +1,17 @@
+2012-05-03  Tor Arne Vestbø  <[email protected]>
+
+        [Qt] Allow the web process and WTR to be paused on startup
+
+        Makes it easier to debug the web process or run-webkit-tests -2, as you
+        have ample time to attach gdb to the process.
+
+        Reviewed by Simon Hausmann.
+
+        * Scripts/webkitpy/layout_tests/port/qt.py:
+        (QtPort.setup_environ_for_server):
+        * WebKitTestRunner/qt/main.cpp:
+        (main):
+
 2012-05-03  Csaba Osztrogonác  <[email protected]>
 
         Password protect "Stop build" button

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py (115957 => 115958)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py	2012-05-03 11:01:04 UTC (rev 115957)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py	2012-05-03 11:14:20 UTC (rev 115958)
@@ -136,6 +136,10 @@
         clean_env = WebKitPort.setup_environ_for_server(self, server_name)
         clean_env['QTWEBKIT_PLUGIN_PATH'] = self._build_path('lib/plugins')
         self._copy_value_from_environ_if_set(clean_env, 'QT_DRT_WEBVIEW_MODE')
+        self._copy_value_from_environ_if_set(clean_env, 'DYLD_IMAGE_SUFFIX')
+        self._copy_value_from_environ_if_set(clean_env, 'QT_WEBKIT_LOG')
+        self._copy_value_from_environ_if_set(clean_env, 'DISABLE_NI_WARNING')
+        self._copy_value_from_environ_if_set(clean_env, 'QT_WEBKIT_PAUSE_UI_PROCESS')
         return clean_env
 
     # FIXME: We should find a way to share this implmentation with Gtk,

Modified: trunk/Tools/WebKitTestRunner/qt/main.cpp (115957 => 115958)


--- trunk/Tools/WebKitTestRunner/qt/main.cpp	2012-05-03 11:01:04 UTC (rev 115957)
+++ trunk/Tools/WebKitTestRunner/qt/main.cpp	2012-05-03 11:14:20 UTC (rev 115958)
@@ -75,6 +75,14 @@
 
 int main(int argc, char** argv)
 {
+#if !defined(NDEBUG) && defined(Q_OS_UNIX)
+    if (qgetenv("QT_WEBKIT_PAUSE_UI_PROCESS") == "1") {
+        fprintf(stderr, "Pausing UI process, please attach to PID %d and continue... ", getpid());
+        pause();
+        fprintf(stderr, " OK\n");
+    }
+#endif
+
     // Suppress debug output from Qt if not started with --verbose
     bool suppressQtDebugOutput = true;
     for (int i = 1; i < argc; ++i) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to