Changeset 122542 in webkit


Ignore:
Timestamp:
Jul 12, 2012 10:39:31 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[WK2][EFL] Facilitate debugging of the Web Process
https://bugs.webkit.org/show_bug.cgi?id=90768

Patch by Christophe Dumez <Christophe Dumez> 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.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r122520 r122542  
     12012-07-12  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [WK2][EFL] Facilitate debugging of the Web Process
     4        https://bugs.webkit.org/show_bug.cgi?id=90768
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        The EFL port now checks if the WEB_PROCESS_CMD_PREFIX
     9        environment variable is set and uses it as prefix
     10        when spawning the Web process if it is. This is used
     11        for debugging purposes with prefixes such as:
     12        "xterm -title renderer -e gdb --args".
     13
     14        * UIProcess/Launcher/ProcessLauncher.h:
     15        (LaunchOptions):
     16        * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
     17        (WebKit::ProcessLauncher::launchProcess):
     18        * UIProcess/WebProcessProxy.cpp:
     19        (WebKit::WebProcessProxy::connect):
     20
    1212012-07-12  Timothy Hatcher  <timothy@apple.com>
    222
  • trunk/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h

    r112889 r122542  
    3232#include <wtf/Threading.h>
    3333
     34#ifndef NDEBUG
     35#include <wtf/text/WTFString.h>
     36#endif
     37
    3438namespace WebKit {
    3539
     
    5458        cpu_type_t architecture;
    5559        bool executableHeap;
     60#endif
     61#ifndef NDEBUG
     62        String processCmdPrefix;
    5663#endif
    5764    };
  • trunk/Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp

    r110988 r122542  
    7171        }
    7272        String fullPath = executablePath + "/" + processName;
    73         execl(fullPath.utf8().data(), processName.utf8().data(), socket.utf8().data(), static_cast<char*>(0));
     73#ifndef NDEBUG
     74        if (m_launchOptions.processCmdPrefix.isEmpty())
     75#endif
     76            execl(fullPath.utf8().data(), processName.utf8().data(), socket.utf8().data(), static_cast<char*>(0));
     77#ifndef NDEBUG
     78        else {
     79            String cmd = makeString(m_launchOptions.processCmdPrefix, ' ', fullPath, ' ', socket);
     80            if (system(cmd.utf8().data()) == -1) {
     81                ASSERT_NOT_REACHED();
     82                return;
     83            }
     84        }
     85#endif
    7486    } else if (pid > 0) { // parent process;
    7587        close(sockets[0]);
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r122500 r122542  
    111111        launchOptions.executableHeap = false;
    112112#endif
     113#ifndef NDEBUG
     114        const char* webProcessCmdPrefix = getenv("WEB_PROCESS_CMD_PREFIX");
     115        if (webProcessCmdPrefix && *webProcessCmdPrefix)
     116            launchOptions.processCmdPrefix = String::fromUTF8(webProcessCmdPrefix);
     117#endif
    113118        m_processLauncher = ProcessLauncher::create(this, launchOptions);
    114119    }
  • trunk/Tools/ChangeLog

    r122540 r122542  
     12012-07-12  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [WK2][EFL] Facilitate debugging of the Web Process
     4        https://bugs.webkit.org/show_bug.cgi?id=90768
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Add a new --webprocess-cmd-prefix argument to
     9        run-webkit-tests script for EFL port. If provided,
     10        the prefix will be prepended to the command used
     11        to spawn the Web process. This can be used for
     12        debugging purposes with prefixes such as:
     13        "xterm -title renderer -e gdb --args".
     14
     15        * Scripts/webkitpy/layout_tests/port/efl.py:
     16        (EflPort.__init__):
     17        (EflPort.setup_environ_for_server):
     18        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
     19        (parse_args):
     20        * WebKitTestRunner/efl/TestControllerEfl.cpp:
     21        (WTR::TestController::platformRunUntil): Implement support for
     22        m_noTimeout timeout value.
     23
    1242012-07-12  Adam Barth  <abarth@webkit.org>
    225
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/efl.py

    r121893 r122542  
    4646
    4747        self.set_option_default('wrapper', self._jhbuild_wrapper_path)
     48        self.webprocess_cmd_prefix = self.get_option('webprocess_cmd_prefix')
    4849
    4950    def _port_flag_for_scripts(self):
     
    5758        env['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so')
    5859        env['TEST_RUNNER_PLUGIN_PATH'] = self._build_path('lib')
     60        if self.webprocess_cmd_prefix:
     61            env['WEB_PROCESS_CMD_PREFIX'] = self.webprocess_cmd_prefix
    5962        return env
    6063
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r121816 r122542  
    253253        optparse.make_option("--adb-args", type="string",
    254254            help="Arguments parsed to Android adb, to select device, etc."),
     255    ]))
     256
     257    option_group_definitions.append(("EFL-specific Options", [
     258        optparse.make_option("--webprocess-cmd-prefix", type="string",
     259            default=False, help="Prefix used when spawning the Web process (Debug mode only)"),
    255260    ]))
    256261
  • trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp

    r121893 r122542  
    5252}
    5353
    54 void TestController::platformRunUntil(bool&, double timeout)
     54void TestController::platformRunUntil(bool& condition, double timeout)
    5555{
     56    if (timeout == m_noTimeout) {
     57        // Never timeout if we are debugging or not meant to timeout.
     58        while (!condition) {
     59            ecore_main_loop_iterate();
     60            sleep(1);
     61        }
     62        return;
     63    }
    5664    timer = ecore_timer_loop_add(timeout, timerFired, 0);
    5765    ecore_main_loop_begin();
Note: See TracChangeset for help on using the changeset viewer.