Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [Debugging Externally Launched Code](#debugging-externally-launched-code)
- [RPC Server](#rpc-server)
- [Remote Debugging](#remote-debugging)
- [Root Debugging](#root-debugging)
- [Reverse Debugging](#reverse-debugging) (experimental)
- [Inspecting a Core Dump](#inspecting-a-core-dump)
- [Source Path Remapping](#source-path-remapping)
Expand Down Expand Up @@ -358,6 +359,30 @@ of the debuggee modules; you may need to specify this manually:
target modules load --file ${workspaceFolder}/build/debuggee -s <base load address>`
```

### Root Debugging

Debugging as root on a local machine is possible only with a remote platform. On MacOS/Linux you should be able to prepend the standard platform command with `sudo`/`doas`/`rootdo`. The builtin terminal will prompt you for the credentials.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Debugging as root on a local machine is possible only with a remote platform. On MacOS/Linux you should be able to prepend the standard platform command with `sudo`/`doas`/`rootdo`. The builtin terminal will prompt you for the credentials.
Debugging as root on a local machine is possible only with a remote platform. On macOS/Linux you should be able to prepend the standard platform command with `sudo`/`doas`/`rootdo`. The builtin terminal will prompt you for the credentials.

What is the 'standard platform command'?


On Windows it is not possible to run an application as the administrator from a non-administrator environment, so the platform has to be launched in a privileged terminal outside of VSCode.

In `.vscode/tasks.json` add the following task:
```json
{
"version": "2.0.0",
"tasks": [
{
"label": "Run LLDB Platform",
"type": "shell",
"command": "sudo lldb-server platform --server --listen '*:<port>'"
}
]
}
```

From there proceed normally, as described above in the [Remote Debugging](#remote-debugging) section.

Note: the platform may not be started as a preLaunchTask, since it will block the execution awaiting for a connection that is only initiated when the preLaunchTasks finish.

## Reverse Debugging

Also known as [Time travel debugging](https://en.wikipedia.org/wiki/Time_travel_debugging). Provided you use a debugging backend that supports
Expand Down