Changes between Version 22 and Version 23 of WebKitGTK/Debugging


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

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitGTK/Debugging

    v22 v23  
    1111}}}
    1212
    13 On 32-bit architectures it's quite unlikely this build will succeed. If you need a build with debug symbols but still without ASSERTs enabled you can try these options:
     13On 32-bit architectures it's quite unlikely this build will succeed. If you need a build with debug symbols but still without ASSERTs enabled you can try these options. '''Note''', these options are no longer available. This needs an update:
    1414{{{
    1515#!sh
     
    1717}}}
    1818
    19 If you want to debug the web process, the simplest way is to connect to it using gdb:
     19If 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{{{
    2121$ gdb -p <pid of WebKitWebProcess>
     
    2323However that doesn't work in all cases, because the web process might already have crashed when you are trying to connect to it.
    2424
    25 You can use the '''WEB_PROCESS_CMD_PREFIX''' environment variable (only works on Debug builds) for that purpose. If that variable is defined the web process will be run using its value as a prefix.
     25If you are using the Flatpak SDK and you want to debug the web process, the simplest way is to connect to it using gdb:
     26{{{
     27$ Tools/Scripts/webkit-flatpak --command=gdb /app/webkit/WebKitBuild/Debug/bin/WebKitWebProcess
     28}}}
     29
     30
     31You can use the '''WEB_PROCESS_CMD_PREFIX''' environment variable (only works on Developer builds, `build-webkit` or regular CMake enabled with `-DDEVELOPER_MODE=ON`) for that purpose. If that variable is defined the web process will be run using its value as a prefix.
    2632
    2733Example:
    2834{{{
    29 WEB_PROCESS_CMD_PREFIX='/usr/bin/gdbserver localhost:8080' WebKitBuild/Debug/bin/MiniBrowser
     35WEB_PROCESS_CMD_PREFIX='/usr/bin/gdbserver localhost:8080' Tools/Scripts/run-minibrowser --gtk --debug
    3036}}}
    3137and in a different terminal:
    3238{{{
    33 $ cd WebKitBuild/Debug
    34 $ gdb -q bin/WebKitWebProcess
     39$ Tools/Scripts/webkit-flatpak --command=gdb /app/webkit/WebKitBuild/Debug/bin/WebKitWebProcess
    3540Reading symbols from bin/WebKitWebProcess...done.
    3641(gdb) target remote localhost:8080
     
    4045If you want to debug the network process you can use '''NETWORK_PROCESS_CMD_PREFIX''' in a similar way.
    4146
    42 Note that these variables are only enabled in debug builds. If you still want to use them in release builds you can remove the relevant
    43 '''#ifndef NDEBUG''' in '''ProcessLauncherGtk.cpp''',
    44 '''ProcessLauncher.h''', '''WebProcessProxyGtk.cpp''' and
    45 '''NetworkProcessProxySoup.cpp'''
    46 
    4747An alternative to using a command prefix is to set the '''WEBKIT2_PAUSE_WEB_PROCESS_ON_LAUNCH''' environment variable. This will pause the web process for 30 seconds, giving you time to attach in a debugger before it starts.
    4848
     
    5050
    5151This works both with release and debug builds. If you are trying to get a backtrace from the WebKitGTK+ packages shipped by your distribution, '''ensure you have the corresponding dbgsym packages installed'''.
     52
     53== Without Systemd
    5254
    5355* Open a terminal/shell, and enable coredumps
     
    7880
    7981
     82== With Systemd and coredumpctl enabled
    8083
     84{{{
     85$ Tools/Scripts/webkit-flatpak --gdb -m WebKitWebProcess
     86(gdb) t a a bt
     87}}}
    8188
     89This should also work:
    8290
     91{{{
     92$ Tools/Scripts/webkit-flatpak --gdb-stack-trace -m WebKitWebProcess
     93}}}
    8394
    8495== Logging support ==
    8596
    86 Logging and other output/behaviors support is activated by default in a ''Debug'' build only.
     97Logging and other output/behaviors support is activated when the `-DUSE_SYSTEMD=ON` CMake option is used.
    8798
    8899In addition to having the logging support activated in the compilation, we need also to turn on the proper logging channels when running.