Bug 143837 - It is very hard to attach a debugger to WebProcess to debug tests
Summary: It is very hard to attach a debugger to WebProcess to debug tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-16 12:10 PDT by Alexey Proskuryakov
Modified: 2015-04-16 15:56 PDT (History)
6 users (show)

See Also:


Attachments
proposed fix (3.26 KB, patch)
2015-04-16 12:21 PDT, Alexey Proskuryakov
cdumez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2015-04-16 12:10:35 PDT
When attaching a debugger to WebContent, one would normally hit a 5-second IPC timeout that WebKitTestRunner has. To safely debug, tests need to be run with something like:

run-webkit-tests --additional-drt-flag="--no-timeout-at-all" --time-out-ms=100000000

This is despite having a nice --no-timeout option in run-webkit-tests. This is because --no-timeout only affects waitUntilDone timeout, and not IPC timeout or run-webkit-tests timeout.

There is a claim (in <http://trac.webkit.org/changeset/123464>) that --no-timeout-at-all and --no-timeout needs to be different because of performance tests, but I don't see any evidence supporting that.

I want to make "run-webkit-tests --no-timeout" disable all timeouts, as best for debugging.
Comment 1 Alexey Proskuryakov 2015-04-16 12:21:51 PDT
Created attachment 250937 [details]
proposed fix
Comment 2 WebKit Commit Bot 2015-04-16 12:24:55 PDT
Attachment 250937 [details] did not pass style-queue:


ERROR: Tools/Scripts/webkitpy/port/driver.py:190:  at least two spaces before inline comment  [pep8/E261] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Chris Dumez 2015-04-16 14:28:50 PDT
Comment on attachment 250937 [details]
proposed fix

r=me
Comment 4 Geoffrey Garen 2015-04-16 15:11:28 PDT
Comment on attachment 250937 [details]
proposed fix

Maybe we should add a --debugger option, which auto-attaches a debugger after launching the Web Process, and also enables --no-timeout?

90% of the time, I would use that every time.
Comment 5 Chris Dumez 2015-04-16 15:18:11 PDT
(In reply to comment #4)
> Comment on attachment 250937 [details]
> proposed fix
> 
> Maybe we should add a --debugger option, which auto-attaches a debugger
> after launching the Web Process, and also enables --no-timeout?
> 
> 90% of the time, I would use that every time.

FYI, back when I was working on the EFL port I added a specific run-webkit-test parameter exactly for this purpose: --webprocess-cmd-prefix

It is still in but the implementation probably needs to be adapted for Mac.

On EFL port it is used like so:
./Tools/Scripts/run-webkit-tests --efl --webprocess-cmd-prefix="DISPLAY=:0 xterm -title WebProcess -e gdb --eval-command=run --args" LayoutTests/fast/forms/plaintext-mode-1.html
Comment 6 Alexey Proskuryakov 2015-04-16 15:51:01 PDT
> Maybe we should add a --debugger option, which auto-attaches a debugger after launching the Web Process, and also enables --no-timeout?

The --debugger option wouldn't know if I want to debug WebKitTestRunner, WebContent or Networking. And adding an option for each... I don't know, I just want to attach to the process in Xcode as it launches.
Comment 7 Alexey Proskuryakov 2015-04-16 15:56:03 PDT
Committed r182916.