- Revision
- 122542
- Author
- [email protected]
- Date
- 2012-07-12 22:39:31 -0700 (Thu, 12 Jul 2012)
Log Message
[WK2][EFL] Facilitate debugging of the Web Process
https://bugs.webkit.org/show_bug.cgi?id=90768
Patch by Christophe Dumez <[email protected]> on 2012-07-12
Reviewed by Kenneth Rohde Christiansen.
Source/WebKit2:
The EFL port now checks if the WEB_PROCESS_CMD_PREFIX
environment variable is set and uses it as prefix
when spawning the Web process if it is. This is used
for debugging purposes with prefixes such as:
"xterm -title renderer -e gdb --args".
* UIProcess/Launcher/ProcessLauncher.h:
(LaunchOptions):
* UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::connect):
Tools:
Add a new --webprocess-cmd-prefix argument to
run-webkit-tests script for EFL port. If provided,
the prefix will be prepended to the command used
to spawn the Web process. This can be used for
debugging purposes with prefixes such as:
"xterm -title renderer -e gdb --args".
* Scripts/webkitpy/layout_tests/port/efl.py:
(EflPort.__init__):
(EflPort.setup_environ_for_server):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* WebKitTestRunner/efl/TestControllerEfl.cpp:
(WTR::TestController::platformRunUntil): Implement support for
m_noTimeout timeout value.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (122541 => 122542)
--- trunk/Source/WebKit2/ChangeLog 2012-07-13 05:31:05 UTC (rev 122541)
+++ trunk/Source/WebKit2/ChangeLog 2012-07-13 05:39:31 UTC (rev 122542)
@@ -1,3 +1,23 @@
+2012-07-12 Christophe Dumez <[email protected]>
+
+ [WK2][EFL] Facilitate debugging of the Web Process
+ https://bugs.webkit.org/show_bug.cgi?id=90768
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The EFL port now checks if the WEB_PROCESS_CMD_PREFIX
+ environment variable is set and uses it as prefix
+ when spawning the Web process if it is. This is used
+ for debugging purposes with prefixes such as:
+ "xterm -title renderer -e gdb --args".
+
+ * UIProcess/Launcher/ProcessLauncher.h:
+ (LaunchOptions):
+ * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
+ (WebKit::ProcessLauncher::launchProcess):
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::connect):
+
2012-07-12 Timothy Hatcher <[email protected]>
Make the "Inspect Element" context menu item appear in nightly builds again.
Modified: trunk/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h (122541 => 122542)
--- trunk/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h 2012-07-13 05:31:05 UTC (rev 122541)
+++ trunk/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h 2012-07-13 05:39:31 UTC (rev 122542)
@@ -31,6 +31,10 @@
#include <wtf/RefPtr.h>
#include <wtf/Threading.h>
+#ifndef NDEBUG
+#include <wtf/text/WTFString.h>
+#endif
+
namespace WebKit {
class ProcessLauncher : public ThreadSafeRefCounted<ProcessLauncher> {
@@ -54,6 +58,9 @@
cpu_type_t architecture;
bool executableHeap;
#endif
+#ifndef NDEBUG
+ String processCmdPrefix;
+#endif
};
static PassRefPtr<ProcessLauncher> create(Client* client, const LaunchOptions& launchOptions)
Modified: trunk/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp (122541 => 122542)
--- trunk/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp 2012-07-13 05:31:05 UTC (rev 122541)
+++ trunk/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp 2012-07-13 05:39:31 UTC (rev 122542)
@@ -70,7 +70,19 @@
executablePath = String(executablePathPtr);
}
String fullPath = executablePath + "/" + processName;
- execl(fullPath.utf8().data(), processName.utf8().data(), socket.utf8().data(), static_cast<char*>(0));
+#ifndef NDEBUG
+ if (m_launchOptions.processCmdPrefix.isEmpty())
+#endif
+ execl(fullPath.utf8().data(), processName.utf8().data(), socket.utf8().data(), static_cast<char*>(0));
+#ifndef NDEBUG
+ else {
+ String cmd = makeString(m_launchOptions.processCmdPrefix, ' ', fullPath, ' ', socket);
+ if (system(cmd.utf8().data()) == -1) {
+ ASSERT_NOT_REACHED();
+ return;
+ }
+ }
+#endif
} else if (pid > 0) { // parent process;
close(sockets[0]);
m_processIdentifier = pid;
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (122541 => 122542)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2012-07-13 05:31:05 UTC (rev 122541)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2012-07-13 05:39:31 UTC (rev 122542)
@@ -110,6 +110,11 @@
launchOptions.architecture = ProcessLauncher::LaunchOptions::MatchCurrentArchitecture;
launchOptions.executableHeap = false;
#endif
+#ifndef NDEBUG
+ const char* webProcessCmdPrefix = getenv("WEB_PROCESS_CMD_PREFIX");
+ if (webProcessCmdPrefix && *webProcessCmdPrefix)
+ launchOptions.processCmdPrefix = String::fromUTF8(webProcessCmdPrefix);
+#endif
m_processLauncher = ProcessLauncher::create(this, launchOptions);
}
}
Modified: trunk/Tools/ChangeLog (122541 => 122542)
--- trunk/Tools/ChangeLog 2012-07-13 05:31:05 UTC (rev 122541)
+++ trunk/Tools/ChangeLog 2012-07-13 05:39:31 UTC (rev 122542)
@@ -1,3 +1,26 @@
+2012-07-12 Christophe Dumez <[email protected]>
+
+ [WK2][EFL] Facilitate debugging of the Web Process
+ https://bugs.webkit.org/show_bug.cgi?id=90768
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add a new --webprocess-cmd-prefix argument to
+ run-webkit-tests script for EFL port. If provided,
+ the prefix will be prepended to the command used
+ to spawn the Web process. This can be used for
+ debugging purposes with prefixes such as:
+ "xterm -title renderer -e gdb --args".
+
+ * Scripts/webkitpy/layout_tests/port/efl.py:
+ (EflPort.__init__):
+ (EflPort.setup_environ_for_server):
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ (parse_args):
+ * WebKitTestRunner/efl/TestControllerEfl.cpp:
+ (WTR::TestController::platformRunUntil): Implement support for
+ m_noTimeout timeout value.
+
2012-07-12 Adam Barth <[email protected]>
Fix crash in the commit-queue. We need to initialize self.port during __init__.
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/efl.py (122541 => 122542)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/efl.py 2012-07-13 05:31:05 UTC (rev 122541)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/efl.py 2012-07-13 05:39:31 UTC (rev 122542)
@@ -45,6 +45,7 @@
self._jhbuild_wrapper_path = self.path_from_webkit_base('Tools', 'efl', 'run-with-jhbuild')
self.set_option_default('wrapper', self._jhbuild_wrapper_path)
+ self.webprocess_cmd_prefix = self.get_option('webprocess_cmd_prefix')
def _port_flag_for_scripts(self):
return "--efl"
@@ -56,6 +57,8 @@
env = super(EflPort, self).setup_environ_for_server(server_name)
env['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so')
env['TEST_RUNNER_PLUGIN_PATH'] = self._build_path('lib')
+ if self.webprocess_cmd_prefix:
+ env['WEB_PROCESS_CMD_PREFIX'] = self.webprocess_cmd_prefix
return env
def clean_up_test_run(self):
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (122541 => 122542)
--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py 2012-07-13 05:31:05 UTC (rev 122541)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py 2012-07-13 05:39:31 UTC (rev 122542)
@@ -254,6 +254,11 @@
help="Arguments parsed to Android adb, to select device, etc."),
]))
+ option_group_definitions.append(("EFL-specific Options", [
+ optparse.make_option("--webprocess-cmd-prefix", type="string",
+ default=False, help="Prefix used when spawning the Web process (Debug mode only)"),
+ ]))
+
option_group_definitions.append(("WebKit Options", [
optparse.make_option("--gc-between-tests", action="" default=False,
help="Force garbage collection between each test"),
Modified: trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp (122541 => 122542)
--- trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp 2012-07-13 05:31:05 UTC (rev 122541)
+++ trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp 2012-07-13 05:39:31 UTC (rev 122542)
@@ -51,8 +51,16 @@
{
}
-void TestController::platformRunUntil(bool&, double timeout)
+void TestController::platformRunUntil(bool& condition, double timeout)
{
+ if (timeout == m_noTimeout) {
+ // Never timeout if we are debugging or not meant to timeout.
+ while (!condition) {
+ ecore_main_loop_iterate();
+ sleep(1);
+ }
+ return;
+ }
timer = ecore_timer_loop_add(timeout, timerFired, 0);
ecore_main_loop_begin();
}