| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | == Debugging with RR |
| | 4 | |
| | 5 | [https://rr-project.org/ rr] is a lightweight tool for recording, replaying and debugging execution of applications (trees of processes and threads). Debugging extends gdb with very efficient reverse-execution, which in combination with standard gdb/x86 features like hardware data watchpoints, makes debugging much more fun. |
| | 6 | |
| | 7 | === Using RR with the SDK |
| | 8 | |
| | 9 | The Flatpak SDK already provides RR. You don't need to install it on your host machine. To record a trace, use this command: |
| | 10 | |
| | 11 | {{{ |
| | 12 | #!sh |
| | 13 | $ WEBKIT_MINI_BROWSER_PREFIX=rr Tools/Scripts/run-minibrowser --gtk ... |
| | 14 | }}} |
| | 15 | |
| | 16 | You don't necessarily need a debug build, but it's better to have one. |
| | 17 | |
| | 18 | To replay a trace or simply run rr: |
| | 19 | |
| | 20 | {{{ |
| | 21 | #!sh |
| | 22 | $ Tools/Scripts/webkit-flatpak -c rr <rr arguments here> |
| | 23 | ... |
| | 24 | $ Tools/Scripts/webkit-flatpak -c rr ps 14:32:37 |
| | 25 | PID PPID EXIT CMD |
| | 26 | 35 -- 0 /app/webkit/WebKitBuild/Debug/bin/MiniBrowser http://192.168.1.44/test.html |
| | 27 | 43 35 -5 /app/webkit/WebKitBuild/Debug/bin/WebKitWebProcess 7 24 |
| | 28 | 44 35 0 /app/webkit/WebKitBuild/Debug/bin/WebKitNetworkProcess 8 24 |
| | 29 | }}} |
| | 30 | |