Changes between Version 6 and Version 7 of Webkit2Innards


Ignore:
Timestamp:
Apr 4, 2011 3:06:37 AM (13 years ago)
Author:
kbalazs@webkit.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Webkit2Innards

    v6 v7  
    1414
    1515== Debugging tips (gdb) ==
    16 Multiprocess architecture needs multiprocess debugging. Usually we are interested about what is happening in the web process. To debug the web process you need a way to attach to it. The simplest way is gdb --pid=$web_process_pid. It won't work if you need to see what's going on at program startup (for example you are debugging an initialization crash). That is the motivation behind http://trac.webkit.org/changeset/70760. Read the Changelog and follow the instructions if you need to stop execution at startup. (Tip: use the -s switch of pidof at the end of the command to restrict the output to the main thread pid.) Another way of attaching is the "set follow-fork-mode" command of newer gdb-s. By setting it as "set follow-fork-mode child" the debugger automatically attaches to the child process. Unfortunately there is a minor issue with it: you cannot interrupt the program and return to the debugger with ^C because it will immediately terminate (due to how we set up the web process). To work around this behavior see http://trac.webkit.org/changeset/81507.
     16Multiprocess architecture needs multiprocess debugging. Usually we are interested about what is happening in the web process. To debug the web process you need a way to attach to it. You can tell gdb to attach to a given pid at startup with the --pid=$pid switch or you can use the attach command. In newer versions you can use "set follow-fork-mode" command as well (i.e. "set follow-fork-mode child" means that the debugger will automatically attach to the child process on a fork.) For special cases some helper functionality had been added:
     17    * If you need to see what's going on at program startup (for example you are debugging an initialization crash) then attaching is not good. That is the motivation behind http://trac.webkit.org/changeset/70760. Read the Changelog and follow the instructions if you need to stop execution at startup. (Tip: use the -s switch of pidof at the end of the command to restrict the output to the main thread pid.)
     18    * There is a minor issue with the "set follow-fork-mode" command: you cannot interrupt the web process and return to the debugger by pressing Ctrl-C  because the it will immediately terminate (due to how we set it up). To work around this behavior, see http://trac.webkit.org/changeset/81507.