/lldb-python

Unofficial self-contained python package for the LLDB Python API

Primary LanguagePythonApache License 2.0Apache-2.0

lldb-python

build and publish

An unofficial self contained distribution of the LLDB Python Bindings to ease integration of the LLDB debugger into external Python projects.

The Python API is normally distributed as part of the main LLDB package, but this typically uses the System Python which can make it difficult to integrate into standalone Python projects that typically will use a virtual environment

A small patch is made to the LLDB build to disable linking to the Python library, and to enable linking to static libraries provided by conan.

This makes it easier to distribute the LLDB Python bindings as a relocatable binary distribution.

Installation

Download the appropriate wheel file for your platform and architecture and install using PIP.

Example Usage

There are extensive examples in the LLDB Documentation and the LLVM Repository

There is also a basic test suite in the test folder of this repository

Build

Wheels are built using scikit-build-core and cibuildwheel. Some post-build customization of the built wheel is done that could not be accomplished using these tools alone.

./download-llvm.sh
pipx run build -v --wheel
./python edit-wheel.py preprocess dist/<wheel_file>

Then to test the wheel

pip install -r requirements.txt
python -m venv .venv
source .venv/bin/activate
pip install dist/<wheel_file>
pytest -v test