| 88 | == Debugging WebKit2 == |
| 89 | |
| 90 | If you want to debug the web process, the simplest way is connecting to |
| 91 | it using gdb: |
| 92 | {{{ |
| 93 | $ gdb -p <pid of WebKitWebProcess> |
| 94 | }}} |
| 95 | However that doesn't work in all cases, because the web process might |
| 96 | already have crashed when you are trying to connect to it. |
| 97 | |
| 98 | You can use the '''WEB_PROCESS_CMD_PREFIX''' environment variable for |
| 99 | that purpose. If that variable is defined the web process will be run |
| 100 | using its value as a prefix. |
| 101 | |
| 102 | Example: |
| 103 | {{{ |
| 104 | WEB_PROCESS_CMD_PREFIX='/usr/bin/gdbserver localhost:8080' WebKitBuild/Debug/Programs/MiniBrowser |
| 105 | }}} |
| 106 | and in a different terminal: |
| 107 | {{{ |
| 108 | $ libtool --mode=execute gdb WebKitBuild/Debug/Programs/WebKitWebProcess |
| 109 | (gdb) target remote localhost:8080 |
| 110 | }}} |
| 111 | If you want to debug the network process you can use |
| 112 | '''NETWORK_PROCESS_CMD_PREFIX''' in a similar way. |
| 113 | |
| 114 | Note that these variables are only enabled in debug builds. If you |
| 115 | still want to use them in release builds you can remove the relevant |
| 116 | '''#ifndef NDEBUG''' in '''ProcessLauncherGtk.cpp''', |
| 117 | '''ProcessLauncher.h''', '''WebProcessProxyGtk.cpp''' and |
| 118 | '''NetworkProcessProxySoup.cpp''' |
| 119 | |