This code integrates LLDB remote debugging into Microsoft Visual Studio. This extension is developed and maintained by the Stadia team.
-
Download and install the latest Stadia SDK from the Stadia Partner Resource Center.
-
Check out the vsi-lldb source code. We recommend to start from the tag that corresponds to the SDK version number you installed, for example:
git checkout tags/1.57 -b <branch-name>
-
Initialize the required submodules:
git submodule init git submodule update
-
Make sure the following tools are installed on your system (minimal recommended version is specified in parenthesis):
- CMake (>= 3.16.0)
- Ninja (>= 1.8.2)
- Python 3 (>= 3.7)
- SWIG (>= 4.0.2)
- Visual Studio 2017 (>= 15.9.15) or Visual Studio 2019 (>= 16.6.3).
-
(Optional) Apply the recommended patches:
cd llvm-project git apply ../patches/llvm-project/*.patch # Use "git am" to import as commits
These patches are not required, but they fix some bugs and performance issues.
-
Open the
x64 Native Tools Command Prompt for VS 2017
(or 2019 if you plan to use only VS 2019). -
Create a build directory inside
llvm-project
. Assuming yourvsi-lldb
project is located inC:\Projects
:cd C:\Projects\vsi-lldb\llvm-project mkdir build_x64_optdebug cd build_x64_optdebug
-
Run the following command (modify
CMAKE_INSTALL_PREFIX
,PYTHON_HOME
,SWIG_DIR
andSWIG_EXECUTABLE
accordingly):cmake ^ -DCMAKE_INSTALL_PREFIX='.' ^ -DLLVM_ENABLE_PROJECTS='lldb;clang;lld' ^ -DPYTHON_HOME=%LOCALAPPDATA%\Programs\Python\Python37 ^ -DSWIG_DIR=C:\Swig ^ -DSWIG_EXECUTABLE=C:\Swig\swig.exe ^ -DLLDB_ENABLE_PYTHON=1 ^ -DCMAKE_BUILD_TYPE=RelWithDebInfo ^ -DLLVM_USE_CRT_RELWITHDEBINFO=MT ^ -GNinja ^ ../llvm
-
Run the build:
ninja install
- Open
Build.props
file located in the root of the project and make surePythonDir
is pointing to the Python used to build LLDB andPythonVersion
is correct. - Import
vsi-lldb.sln
in your Visual Studio. - Choose
Debug2017
orDebug2019
as a Solution Configuration depending on your VS version. - Make sure
YetiVSI
is selected as a startup project. - Build & Run the solution.
Note: if you are using the Stadia for Visual Studio
extension distributed with
the Stadia SDK, make sure to disable or uninstall it before debugging with the
open-source version of the extension. Only one of these extensions should be
active at each moment in order for the debugger to work.
Upon the attach to a remote process the debugger may need to download some data
(e.g. process binary, shared libraries, debug symbols). We recommend applying
the following patch to improve the download speed --
patches/llvm-project/0001-increase-buffer-size.patch
.
This is not an officially supported Google product.