Changes between Version 25 and Version 26 of WebKitGTK/Debugging


Ignore:
Timestamp:
Mar 25, 2020 6:18:14 AM (4 years ago)
Author:
Philippe Normand
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitGTK/Debugging

    v25 v26  
    1919If you are not using the Flatpak SDK and you want to debug the web process, the simplest way is to connect to it using gdb:
    2020{{{
     21#!sh
    2122$ gdb -p <pid of WebKitWebProcess>
    2223}}}
     
    2526If you are using the Flatpak SDK and you want to debug the web process, the simplest way is to connect to it using gdb:
    2627{{{
     28#!sh
    2729$ Tools/Scripts/webkit-flatpak --command=gdb /app/webkit/WebKitBuild/Debug/bin/WebKitWebProcess
    2830}}}
     
    3335Example:
    3436{{{
     37#!sh
    3538WEB_PROCESS_CMD_PREFIX='/usr/bin/gdbserver localhost:8080' Tools/Scripts/run-minibrowser --gtk --debug
    3639}}}
    3740and in a different terminal:
    3841{{{
     42#!sh
    3943$ Tools/Scripts/webkit-flatpak --command=gdb /app/webkit/WebKitBuild/Debug/bin/WebKitWebProcess
    4044Reading symbols from bin/WebKitWebProcess...done.
     
    5559* Open a terminal/shell, and enable coredumps
    5660{{{
     61#!sh
    5762ulimit -c unlimited
    5863}}}
     
    6166  * If it wasn't the case ensure that you have not set the sysctl kernel.core_pattern set to another directory/pipe
    6267{{{
     68#!sh
    6369$ sudo sysctl kernel.core_pattern=core
    6470}}}
    6571* Once you have the core, get a backtrace from it as follows:
    6672{{{
     73#!sh
    6774gdb --batch -ex "thread apply all bt full" /full/path/to/WebKitWebProcess core &> backtrace.txt
    6875}}}
     
    7683      * You can now manually demangle those symbols by piping the output as follows
    7784{{{
     85#!sh
    7886cat backtrace.txt | c++filt
    7987}}}
     
    8391
    8492{{{
     93#!sh
    8594$ Tools/Scripts/webkit-flatpak --gdb -m WebKitWebProcess
    8695(gdb) t a a bt
     
    9099
    91100{{{
     101#!sh
    92102$ Tools/Scripts/webkit-flatpak --gdb-stack-trace -m WebKitWebProcess
    93103}}}
     
    160170== Related ==
    161171
    162  * [wiki:"GDB" Tips for debugging using GDB]
    163172 * [wiki:WebKitGTK/TrackingMemoryErrors Tracking memory errors in WebKitGTK+]
    164173 * [wiki:/EnvironmentVariables List of WebKit environment variables]