Documentation: Add VSCode debugger instructions
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run

Co-authored-by: sideshowbarker <mike@w3.org>
This commit is contained in:
Kostya Farber 2024-10-30 19:18:38 +00:00 committed by Andrew Kaster
parent d7023f5f45
commit aeab342fd7
Notes: github-actions[bot] 2024-11-01 19:26:28 +00:00

View file

@ -286,6 +286,58 @@ The following three example tasks should suffice in most situations, and allow y
</details> </details>
### Debugging
#### Mac
If you want to run the debugger, first place the content below in `.vscode/launch.json` in the root of the project.
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to WebContent",
"type": "lldb",
"request": "attach",
"program": "${workspaceFolder}/Build/ladybird-debug/bin/Ladybird.app/Contents/MacOS/WebContent",
}
],
}
```
then run Ladybird with the debug preset and with the `--debug-process WebContent` flag:
```bash
CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++ BUILD_PRESET=Debug ./Meta/ladybird.sh run ladybird --debug-process WebContent
```
Running Ladybird in this way will pause execution until a debugger is attached. You can then run the debugger by going to the **Run and Debug** menu and selecting the **Attach to WebContent** configuration.
#### Linux
For Linux, the `launch.json` will instead be the file below.
```json
{
"version": "2.0.0",
"configurations": [
{
"name": "Attach and debug",
"type": "cppdbg",
"request": "attach",
"program": "${workspaceRoot}/Build/ladybird-debug/libexec/WebContent",
"MIMode": "gdb",
},
]
}
```
Running Ladybird as follows:
```bash
BUILD_PRESET=Debug Meta/ladybird.sh run ladybird --debug-process WebContent
```
Then follow the same steps found in the Mac section.
### License snippet ### License snippet
The following snippet may be useful if you want to quickly generate a license header, put it in `.vscode/ladybird.code-snippets`: The following snippet may be useful if you want to quickly generate a license header, put it in `.vscode/ladybird.code-snippets`: