diff options
author | Walter Erquinigo <a20012251@gmail.com> | 2023-10-11 16:39:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 16:39:35 -0400 |
commit | 098c92777ee434a7e395d293153403ffebc936d8 (patch) | |
tree | 92b1b2589e3993fb4bf7ee4c6ced6ebb6e143c79 /lldb/tools | |
parent | de7857ab234db0bb75b911dcb382084d688292a1 (diff) | |
download | llvm-098c92777ee434a7e395d293153403ffebc936d8.zip llvm-098c92777ee434a7e395d293153403ffebc936d8.tar.gz llvm-098c92777ee434a7e395d293153403ffebc936d8.tar.bz2 |
[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 https://github.com/llvm/llvm-project/issues/63655
Diffstat (limited to 'lldb/tools')
-rw-r--r-- | lldb/tools/lldb-vscode/README.md | 115 |
1 files changed, 60 insertions, 55 deletions
diff --git a/lldb/tools/lldb-vscode/README.md b/lldb/tools/lldb-vscode/README.md index 154ccef..6f93029 100644 --- a/lldb/tools/lldb-vscode/README.md +++ b/lldb/tools/lldb-vscode/README.md @@ -1,18 +1,20 @@ # Table of Contents -- [Introduction](#Introduction) -- [Installation](#Installation-Visual-Studio-Code) +- [Table of Contents](#table-of-contents) +- [Introduction](#introduction) +- [Installation for Visual Studio Code](#installation-for-visual-studio-code) - [Configurations](#configurations) - - [Launch Configuration Settings](#launch-configuration-settings) - - [Attach Configuration Settings](#attach-configuration-settings) - - [Example configurations](#example-configurations) - - [Launching](#launching) - - [Attach to process using process ID](#attach-using-pid) - - [Attach to process by name](#attach-by-name) - - [Loading a core file](#loading-a-core-file) -- [Custom Debugger Commands](#custom-debugger-commands) - - [startDebugging](#startDebugging) + - [Launch Configuration Settings](#launch-configuration-settings) + - [Attaching Settings](#attaching-settings) + - [Example configurations](#example-configurations) + - [Launching](#launching) + - [Attach using PID](#attach-using-pid) + - [Attach by Name](#attach-by-name) + - [Loading a Core File](#loading-a-core-file) +- [Custom debugger commands](#custom-debugger-commands) + - [startDebugging](#startdebugging) + - [repl-mode](#repl-mode) # Introduction @@ -24,52 +26,57 @@ get a full featured debugger with a well defined protocol. # Installation for Visual Studio Code -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 -documentation into it, and copying to symlinking a lldb-vscode binary into -the `bin` directory inside the plug-in directory. - -If you want to make a stand alone plug-in that you can send to others on unix systems: - -``` -$ mkdir -p ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin -$ cp package.json ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0 -$ cd ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin -$ cp /path/to/a/built/lldb-vscode . -$ cp /path/to/a/built/liblldb.so . +Installing the plug-in involves creating a directory in any location outside of +`~/.vscode/extensions`. For example, `~/vscode-lldb` is a valid one. You'll also +need a subfolder `bin`, e.g. `~/vscode-lldb/bin`. Then copy the `package.json` +file that is in the same directory as this documentation into it, and symlink +the `lldb-vscode` binary into the `bin` directory inside the plug-in directory. + +Finally, on VS Code, execute the command +`Developer: Install Extension from Location` and pick the folder you just +created, which would be `~/vscode-lldb` following the example above. + +If you want to make a stand alone plug-in that you can send to others on UNIX +systems: + +```bash +mkdir -p ~/llvm-org.lldb-vscode-0.1.0/bin +cp package.json ~/llvm-org.lldb-vscode-0.1.0 +cd ~/llvm-org.lldb-vscode-0.1.0/bin +cp /path/to/a/built/lldb-vscode . +cp /path/to/a/built/liblldb.so . ``` -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`: +If you want to make a stand alone plug-in that you can send to others on macOS +systems: -``` -$ cd ~/.vscode-server/extensions -$ ln -s ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0 llvm-org.lldb-vscode-0.1.0 +```bash +mkdir -p ~/llvm-org.lldb-vscode-0.1.0/bin +cp package.json ~/llvm-org.lldb-vscode-0.1.0 +cd ~/llvm-org.lldb-vscode-0.1.0/bin +cp /path/to/a/built/lldb-vscode . +rsync -av /path/to/a/built/LLDB.framework LLDB.framework ``` -If you want to make a stand alone plug-in that you can send to others on macOS systems: - -``` -$ mkdir -p ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin -$ cp package.json ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0 -$ cd ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin -$ cp /path/to/a/built/lldb-vscode . -$ rsync -av /path/to/a/built/LLDB.framework LLDB.framework +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 +the current executable directory in the rpath, so these steps should work for +most people. + +To create a plug-in that symlinks into your `lldb-vscode` in your build +directory: + +```bash +mkdir -p ~/llvm-org.lldb-vscode-0.1.0/bin +cp package.json ~/llvm-org.lldb-vscode-0.1.0 +cd ~/llvm-org.lldb-vscode-0.1.0/bin +ln -s /path/to/a/built/lldb-vscode ``` -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 -the current executable directory in the rpath, so these steps should work for most people. - -To create a plug-in that symlinks into your `lldb-vscode` in your build directory: - -``` -$ mkdir -p ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin -$ cp package.json ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0 -$ cd ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin -$ ln -s /path/to/a/built/lldb-vscode -``` - -This is handy if you want to debug and develope the `lldb-vscode` executable when adding features or fixing bugs. - - +This is handy if you want to debug and develope the `lldb-vscode` executable +when adding features or fixing bugs. # Configurations @@ -127,7 +134,6 @@ The JSON configuration file can contain the following `lldb-vscode` specific lau |**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. |**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. - ## Example configurations ### Launching @@ -191,7 +197,6 @@ to be launched you can add the "waitFor" key value pair: This will work as long as the architecture, vendor and OS supports waiting for processes. Currently MacOS is the only platform that supports this. - ### Loading a Core File 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. Inspect or adjust the behavior of lldb-vscode repl evaluation requests. The supported modes are `variable`, `command` and `auto`. -* `variable` - Variable mode expressions are evaluated in the context of the +- `variable` - Variable mode expressions are evaluated in the context of the current frame. Use a `\`` prefix on the command to run an lldb command. -* `command` - Command mode expressions are evaluated as lldb commands, as a +- `command` - Command mode expressions are evaluated as lldb commands, as a result, values printed by lldb are always stringified representations of the expression output. -* `auto` - Auto mode will attempt to infer if the expression represents an lldb +- `auto` - Auto mode will attempt to infer if the expression represents an lldb command or a variable expression. A heuristic is used to infer if the input represents a variable or a command. Use a `\`` prefix to ensure an expression is evaluated as a command. |