Skip to content

Commit 098c927

Browse files
[lldb-vscode] Update installation instructions (#68234)
lldb-vscode had installation instructions based on creating a folder inside ~/.vscode/extensions, which no longer works. A different installation mechanism is needed based on a VSCode command. More can be read in the contents of this patch. Closes #63655
1 parent de7857a commit 098c927

File tree

1 file changed

+60
-55
lines changed

1 file changed

+60
-55
lines changed

lldb/tools/lldb-vscode/README.md

Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11

22
# Table of Contents
33

4-
- [Introduction](#Introduction)
5-
- [Installation](#Installation-Visual-Studio-Code)
4+
- [Table of Contents](#table-of-contents)
5+
- [Introduction](#introduction)
6+
- [Installation for Visual Studio Code](#installation-for-visual-studio-code)
67
- [Configurations](#configurations)
7-
- [Launch Configuration Settings](#launch-configuration-settings)
8-
- [Attach Configuration Settings](#attach-configuration-settings)
9-
- [Example configurations](#example-configurations)
10-
- [Launching](#launching)
11-
- [Attach to process using process ID](#attach-using-pid)
12-
- [Attach to process by name](#attach-by-name)
13-
- [Loading a core file](#loading-a-core-file)
14-
- [Custom Debugger Commands](#custom-debugger-commands)
15-
- [startDebugging](#startDebugging)
8+
- [Launch Configuration Settings](#launch-configuration-settings)
9+
- [Attaching Settings](#attaching-settings)
10+
- [Example configurations](#example-configurations)
11+
- [Launching](#launching)
12+
- [Attach using PID](#attach-using-pid)
13+
- [Attach by Name](#attach-by-name)
14+
- [Loading a Core File](#loading-a-core-file)
15+
- [Custom debugger commands](#custom-debugger-commands)
16+
- [startDebugging](#startdebugging)
17+
- [repl-mode](#repl-mode)
1618

1719
# Introduction
1820

@@ -24,52 +26,57 @@ get a full featured debugger with a well defined protocol.
2426

2527
# Installation for Visual Studio Code
2628

27-
Installing the plug-in involves creating a directory in the `~/.vscode/extensions` folder and copying the package.json file that is in the same directory as this
28-
documentation into it, and copying to symlinking a lldb-vscode binary into
29-
the `bin` directory inside the plug-in directory.
30-
31-
If you want to make a stand alone plug-in that you can send to others on unix systems:
32-
33-
```
34-
$ mkdir -p ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
35-
$ cp package.json ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0
36-
$ cd ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
37-
$ cp /path/to/a/built/lldb-vscode .
38-
$ cp /path/to/a/built/liblldb.so .
29+
Installing the plug-in involves creating a directory in any location outside of
30+
`~/.vscode/extensions`. For example, `~/vscode-lldb` is a valid one. You'll also
31+
need a subfolder `bin`, e.g. `~/vscode-lldb/bin`. Then copy the `package.json`
32+
file that is in the same directory as this documentation into it, and symlink
33+
the `lldb-vscode` binary into the `bin` directory inside the plug-in directory.
34+
35+
Finally, on VS Code, execute the command
36+
`Developer: Install Extension from Location` and pick the folder you just
37+
created, which would be `~/vscode-lldb` following the example above.
38+
39+
If you want to make a stand alone plug-in that you can send to others on UNIX
40+
systems:
41+
42+
```bash
43+
mkdir -p ~/llvm-org.lldb-vscode-0.1.0/bin
44+
cp package.json ~/llvm-org.lldb-vscode-0.1.0
45+
cd ~/llvm-org.lldb-vscode-0.1.0/bin
46+
cp /path/to/a/built/lldb-vscode .
47+
cp /path/to/a/built/liblldb.so .
3948
```
4049

41-
It is important to note that the directory `~/.vscode/extensions` works for users logged in locally to the machine. If you are remoting into the box using Visual Studio Code's Remote plugins (SSH, WSL, Docker) it will look for extensions on `~/.vscode-server/extensions` only and you will not see your just installed lldb-vscode plug-in. If you want this plugin to be visible to remoting users, you will need to either repeat the process above for the `~/.vscode-server` folder or create a symbolic link from it to `~/.vscode/extensions`:
50+
If you want to make a stand alone plug-in that you can send to others on macOS
51+
systems:
4252

43-
```
44-
$ cd ~/.vscode-server/extensions
45-
$ ln -s ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0 llvm-org.lldb-vscode-0.1.0
53+
```bash
54+
mkdir -p ~/llvm-org.lldb-vscode-0.1.0/bin
55+
cp package.json ~/llvm-org.lldb-vscode-0.1.0
56+
cd ~/llvm-org.lldb-vscode-0.1.0/bin
57+
cp /path/to/a/built/lldb-vscode .
58+
rsync -av /path/to/a/built/LLDB.framework LLDB.framework
4659
```
4760

48-
If you want to make a stand alone plug-in that you can send to others on macOS systems:
49-
50-
```
51-
$ mkdir -p ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
52-
$ cp package.json ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0
53-
$ cd ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
54-
$ cp /path/to/a/built/lldb-vscode .
55-
$ rsync -av /path/to/a/built/LLDB.framework LLDB.framework
61+
You might need to create additional directories for the `liblldb.so` or
62+
`LLDB.framework` inside or next to the `bin` folder depending on how the
63+
[rpath](https://en.wikipedia.org/wiki/Rpath) is set in your `lldb-vscode`
64+
binary. By default the `Debug` builds of LLDB usually includes
65+
the current executable directory in the rpath, so these steps should work for
66+
most people.
67+
68+
To create a plug-in that symlinks into your `lldb-vscode` in your build
69+
directory:
70+
71+
```bash
72+
mkdir -p ~/llvm-org.lldb-vscode-0.1.0/bin
73+
cp package.json ~/llvm-org.lldb-vscode-0.1.0
74+
cd ~/llvm-org.lldb-vscode-0.1.0/bin
75+
ln -s /path/to/a/built/lldb-vscode
5676
```
5777

58-
You might need to create additional directories for the `liblldb.so` or `LLDB.framework` inside or next to the `bin` folder depending on how the [rpath](https://en.wikipedia.org/wiki/Rpath) is set in your `lldb-vscode` binary. By default the `Debug` builds of LLDB usually includes
59-
the current executable directory in the rpath, so these steps should work for most people.
60-
61-
To create a plug-in that symlinks into your `lldb-vscode` in your build directory:
62-
63-
```
64-
$ mkdir -p ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
65-
$ cp package.json ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0
66-
$ cd ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
67-
$ ln -s /path/to/a/built/lldb-vscode
68-
```
69-
70-
This is handy if you want to debug and develope the `lldb-vscode` executable when adding features or fixing bugs.
71-
72-
78+
This is handy if you want to debug and develope the `lldb-vscode` executable
79+
when adding features or fixing bugs.
7380

7481
# Configurations
7582

@@ -127,7 +134,6 @@ The JSON configuration file can contain the following `lldb-vscode` specific lau
127134
|**terminateCommands** |[string]| | LLDB commands executed when the debugging session ends. Commands and command output will be sent to the debugger console when they are executed.
128135
|**attachCommands** |[string]| | LLDB commands that will be executed after **preRunCommands** which take place of the code that normally does the attach. The commands can create a new target and attach or launch it however desired. This allows custom launch and attach configurations. Core files can use `target create --core /path/to/core` to attach to core files.
129136

130-
131137
## Example configurations
132138

133139
### Launching
@@ -191,7 +197,6 @@ to be launched you can add the "waitFor" key value pair:
191197
This will work as long as the architecture, vendor and OS supports waiting
192198
for processes. Currently MacOS is the only platform that supports this.
193199

194-
195200
### Loading a Core File
196201

197202
This loads the coredump file `/cores/123.core` associated with the program
@@ -242,12 +247,12 @@ This will launch a server and then request a child debug session for a client.
242247
Inspect or adjust the behavior of lldb-vscode repl evaluation requests. The
243248
supported modes are `variable`, `command` and `auto`.
244249

245-
* `variable` - Variable mode expressions are evaluated in the context of the
250+
- `variable` - Variable mode expressions are evaluated in the context of the
246251
current frame. Use a `\`` prefix on the command to run an lldb command.
247-
* `command` - Command mode expressions are evaluated as lldb commands, as a
252+
- `command` - Command mode expressions are evaluated as lldb commands, as a
248253
result, values printed by lldb are always stringified representations of the
249254
expression output.
250-
* `auto` - Auto mode will attempt to infer if the expression represents an lldb
255+
- `auto` - Auto mode will attempt to infer if the expression represents an lldb
251256
command or a variable expression. A heuristic is used to infer if the input
252257
represents a variable or a command. Use a `\`` prefix to ensure an expression
253258
is evaluated as a command.

0 commit comments

Comments
 (0)