Breaking the LLDB/Python Revlock

Since its inception, scripting has been an integral part of LLDB. At the time, Python was chosen as the primary, and for a long time the only supported, scripting language. Python is used within LLDB to automate things, write custom data formatters, and extend core concepts like Processes and Threads with an implementation written in Python. Another powerful way to use LLDB is as a debugger library in Python, by importing the lldb module....

June 5, 2026

Sanitizing C++ Python Modules

Python has great interoperability with C and C++ through extension modules. There are many reasons to do this, such as improving performance, accessing APIs not exposed by the language, or interfacing with libraries written in C or C++. Unlike Python however, C and C++ are not memory safe. Luckily, great tools exist to help diagnose these kinds of issues. One of those tools is ASan (Address Sanitizer) which uses compiler instrumentation to detect memory errors at runtime....

December 20, 2019

Calling Into C or C++ Code From Python

Recently I wanted to call some C code from Python to check who was sending a particular signal. Apparently this functionality is only available as of Python 3 so I decided to write a custom module. Doing so is relatively easy but all the documentation I found only was using distutils to build the module and skipped over how to find the newly built module. This post is mostly a write up of what I found out....

December 5, 2018

A better YouCompleteMe Config

If you’re like me and have (1) been using Vim for a while and (2) have been programming in C++, you’ve likely heard about YouCompleteMe. YCM is an awesome auto-completion engine for Vim. For C++ and other C-based languages it uses the libclang under the hood, but it integrates with other engines as well to support C#, Python and Go to name a few. If you’re not yet convinced, check out the author’s website and this blog post....

July 26, 2015