Skip to content

Commit

Permalink
Update lldb instuctions (#3020)
Browse files Browse the repository at this point in the history
Mostly just delete distro versions that are not supported for any supported .NET version.
  • Loading branch information
danmoseley authored Apr 18, 2022
1 parent c5a386f commit 570ef70
Showing 1 changed file with 18 additions and 94 deletions.
112 changes: 18 additions & 94 deletions documentation/lldb/linux-instructions.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,13 @@
Installing LLDB on Linux
========================

These instructions will lead you through installing or building the best version of lldb for your distro to use with SOS. If you have already followed the diagnostics repo build [prerequisites](../building/linux-instructions.md) and built the diagnostics repo, then the best version of lldb is already installed.
These instructions will lead you through installing or building the best version of lldb for your distro to use with SOS.

SOS needs at least lldb 3.9 or greater. Some distros only have older versions available by default so there are directions and scripts to build lldb 3.9 for that platform. These instructions assume that you have dotnet cli and its prerequisites installed.
If you have already followed the diagnostics repo build [prerequisites](../building/linux-instructions.md) and built the diagnostics repo, then the best version of lldb is already installed.

The libsosplugin.so built for lldb 3.9 does work with lldb 4.0 and greater but most of the testing has been on lldb 3.9.
You need lldb 3.9 or later to use SOS. Some distros only have older versions available by default so there are directions and scripts to build lldb 3.9 for that platform. These instructions assume that you have dotnet cli and its prerequisites installed.

lldb 10.0 or greater is recommended if available for the distro version. For arm32, it is recommended to debug on Ubuntu 18.04 if possible with lldb 10.0 which is the only version of lldb found that works with SOS on arm32.

#### Ubuntu 14.04 ####

In order to get lldb-3.9, we need to add additional package sources (see [http://llvm.org/apt/](http://llvm.org/apt/) for the other Ubuntu versions not listed here):

sudo apt-get update
sudo apt-get install wget
echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main" | sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.9 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update

Install the lldb packages:

sudo apt-get install lldb-3.9 python-lldb-3.9

To launch lldb:

lldb-3.9
lldb 10.0 or later is best if your distro has that available. In particular if you are debugging for Arm32 you should use Ubuntu 18.04 or later if possible and lldb 10.0 or later.

#### Ubuntu 16.04 ####

Expand All @@ -47,25 +28,6 @@ To launch lldb:

lldb-3.9

#### Ubuntu 17.10 ####

Add the additional package sources:

sudo apt-get update
sudo apt-get install wget
echo "deb http://llvm.org/apt/artful/ llvm-toolchain-artful main" | sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb http://llvm.org/apt/artful/ llvm-toolchain-artful-3.9 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update

Install the lldb packages:

sudo apt-get install lldb-3.9 python-lldb-3.9

To launch lldb:

lldb-3.9

#### Ubuntu 18.04 ####

To install the lldb packages:
Expand All @@ -77,24 +39,23 @@ To launch lldb:

lldb-3.9

10.0 is the only version of lldb found that works with SOS for arm32 on Ubuntu 18.04.
lldb 10.0 is the only version of lldb that works with SOS for Arm32 on Ubuntu 18.04.

#### Ubuntu 20.04 ####
#### Ubuntu 20.04 and later ####

To install the lldb packages:

sudo get-get update
sudo apt-get install lldb

This installs lldb version 10.0.0.
This installs lldb version 10.0.

#### Alpine 3.9 to 3.12 ####
#### Alpine 3.9 and later ####

lldb 10.0 is available and works for these Apline versions.

#### CentOS 6 ####

[TBD]
apk update
apk add lldb

This installs lldb version 10.0.

#### CentOS 7 ####

Expand Down Expand Up @@ -122,57 +83,20 @@ This will take some time to complete. After the build is finished, run these com
To launch lldb:

lldb-3.9.1

#### Centos Stream 8 and later ####

#### Debian 8.2/8.7 ####

In order to get lldb-5.0 (3.9 doesn't seem to work that well), we need to add additional package sources:

sudo apt-get update
sudo apt-get install wget
echo "deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie main" | sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie-5.0 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update

Install the lldb packages:

sudo apt-get install lldb-5.0 python-lldb-5.0

To launch lldb:

lldb-5.0
[TBD]

#### Debian 9 (Stretch) ####
#### Debian 9 and later ####

sudo apt-get install lldb-3.9 python-lldb-3.9

To launch lldb:

lldb-3.9

#### Fedora 24 ####

sudo dnf install clang cmake findutils git libicu libunwind make python tar wget which zip
sudo dnf install doxygen libedit-devel libxml2-devel python-argparse python-devel readline-devel swig xz

Now build and install llvm/lldb 3.9 using the script provided here: [build-install-lldb.sh](../lldb/fedora24/build-install-lldb.sh).

WARNING: This script installs llvm and lldb as root (via sudo) and may overwrite any previously installed versions.

cd $HOME
git clone https://github.com/dotnet/diagnostics.git
$HOME/diagnostics/documentation/lldb/fedora24/build-install-lldb.sh

This will take some time to complete. After the build is finished, run these commands to remove the no longer needed packages:

sudo dnf remove doxygen libedit-devel libxml2-devel readline-devel swig
sudo dnf clean all

To launch lldb:

lldb

#### Fedora 27, 28, 29 ####
#### Fedora 29 and later ####

sudo dnf install lldb python2-lldb

Expand Down Expand Up @@ -204,7 +128,7 @@ To launch lldb:

#### RHEL 7.5 ####

See [LLDB](https://access.redhat.com/documentation/en-us/red_hat_developer_tools/2018.2/html/using_clang_and_llvm_toolset/chap-lldb) on RedHat's web site.
See [LLDB](https://access.redhat.com/documentation/en-us/red_hat_developer_tools/1/html/using_llvm_12.0.1_toolset/assembly_llvm#proc_installing-comp-toolset_assembly_llvm) on RedHat's web site.

#### SLES ####

Expand Down

0 comments on commit 570ef70

Please sign in to comment.