RSSAmplifier

Blog

Jonas Devlieghere

Recent content on Jonas Devlieghere

jonasdevlieghere.comRSS feed ↗49 posts

Latest posts

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…

Adopting the Parallel DWARF linker in dsymutil

On Apple platforms, the development experience was designed around making the compile-link-debug cycle as fast as possible. For debugging, that means that rather than processing large amounts of DWARF to link it into the final binary, the linker leaves the debug info in the object files and records a debug map that tells the debugger where to find it. When you’re debugging locally,…

Enabling MTE for the LLDB Test Suite

Enhanced Memory Tagging Extension (EMTE) is a hardware-based security technology to protect against memory corruption vulnerabilities. Memory allocations are tagged with a secret key. When memory is accessed, the hardware validates the tag, and if it doesn’t match, stops the process. EMTE is the foundation of Apple’s Memory Integrity Enforcement (MIE) . It’s available on A19 and…

Syntax Highlighting in LLDB with Tree-sitter

LLDB comes with built-in syntax highlighting for C-based languages. It does so using the embedded clang compiler. Other languages following this model of embedding the compiler, such as Swift, can take a similar approach. Motivation There are two important use cases where relying on the compiler for syntax highlighting doesn’t work: Some languages, like Rust and Zig, don’t have their…

Year in review: LLDB in 2025

This post summarizes the major areas of development in LLDB in 2025. I was inspired by Nikita Popov’s “This year in LLVM” and thought it would be interesting to do something similar for LLDB. My goal was to cover the whole project, rather than focusing on my own contributions. 1 As the maintainer, I try to look at every single LLDB PR, but my level of engagement varies. I expect…

WebAssembly Debugging with LLDB @ FOSDEM 26

I’ll be presenting WebAssembly Debugging with LLDB in the LLVM Dev Room at FOSDEM 26 on Saturday, January 31st. Abstract WebAssembly support in Swift started as a community project and became an official part of Swift 6.2. As Swift on WebAssembly matures, developers need robust debugging tools to match. This talk presents our work adding native debugging support for Swift targeting Wasm in…

WebAssembly Debugging with LLDB & WAMR

This post describes how to debug WebAssembly code running under the WebAssembly Micro Runtime (WAMR) on macOS. WAMR is a lightweight WebAssembly runtime designed for embedded and IoT applications, but its simplicity and debugging support make it well suited for general development. Building the WebAssembly Micro Runtime We have to build the runtime with debugging support. Start by cloning the…

WebAssembly Debugging

WebAssembly (Wasm) is a low-level binary instruction format. It was originally created to run in the browser, but has gained traction in many non-browser environments as well. Debugging WebAssembly applications presents unique challenges compared to traditional native code debugging. Unlike native executables that run directly on the processor, WebAssembly code executes within a virtual machine…

dsymutil's Lockstep Algorithm

I was recently answering questions about dsymutil ’s multi-threading model and lockstep algorithm. I decided to write it down here for future reference. This article focuses on types and the .debug_info section. Background As a reminder, dsymutil is an optimizing DWARF linker. It only retains debug info for elements that appear in the final executable. It uses the One Definition Rule (ODR)…

Mach-O File Format 4GB Limit

Mach-O (Mach Object) is a binary file format used by macOS and iOS for executables, libraries, and object code. A Mach-O file consists of a header, followed by a series of load commands, and then a series of segments. The 4GB Limitations The original 32-bit format used 32-bit offsets, which can address a maximum of 2^32 bytes, or 4GB of memory. The 64-bit variant uses 64-bit offsets, vastly…

LLDB Debug Adapter Protocol (DAP)

Debug Adapter Protocol The Debug Adapter Protocol (DAP) defines a generic protocol for editors to talk to a debugger. Popular editors with DAP support include Visual Studio Code, Sublime Text, (Neo)vim and Emacs. If you’re familiar with the Language Server Protocol (LSP) you can think of DAP like LSP, but for debugging. Implementations of the debug adapter protocol generally come in two…

Rich Disassembler for LLDB

LLVM is once again participating in Google Summer of Code (GSOC) . For 2024 we have an exciting project to enrich the disassembler in LLDB. The project consists of using the variable location information from the debug info (DWARF) to annotate LLDB’s disassembler (and register read ) output with the location and lifetime of source variables. You can find all the details on LLVM’s Google…

Google Summer of Code 2021

Today Google announced the list of open-source organizations participating in the 2021 Google Summer of Code program. Together with Raphael and Pedro, I’ll be mentoring the following two projects: A structured approach to diagnostics in LLDB Lua scripted watchpoints in LLDB If you’re interested in either of these projects or have questions, feel free to reach out. For more information…

Statistics in dsymutil

To make incremental builds fast on macOS, the static linker ( ld ) ignores the debug information. It can easily be a magnitude bigger than the rest of the program and slow down link time. Instead the linker emits a debug map which contains the location of all the object files it relocated so that debug info consumers (such as the debugger) know where to find the DWARF debug info. This approach…

LLDB Column Breakpoints

If you’ve ever used the debugger, chances are you’ve used a file and line number to set a breakpoint. Most of the time this provides enough granularity. Sometimes, though, more fine grained control would be helpful. Consider the following example: int foo () { return 1 ; } int bar () { return 2 ; } int baz () { return 3 ; } int main ( int argc, char ** argv) { return foo() + bar() +…

Lua Scripting in LLDB

LLDB is the debugger developed as part of the LLVM project. It is probably most known as the debugger in Xcode, but many use it as an alternative to GDB . Scripting in LLDB One thing that makes LLDB really powerful is how scriptable it is. It has a stable C++ API, called the SB API or Scripting Bridge API, which is accessible through Python. Following LLVM’s model of reusable components,…

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…

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…

Using LSP & clangd in Vim

After having used YouCompleteMe , I finally decided to give one of the Language Server Protocol (LSP) implementations a spin. As an LLVM developer I’ve been following clangd’s development and wanted to try it out. At the time of writing, several LSP implementations exist for Vim: LanguageClient-neovim vim-lsc vim-lsp Setting up vim-lsp I decided to go with vim-lsp because it’s…

Finding Reviewers for Your Patch

Finding the right people to review your patch can be tough. I see the question “who should I add as reviewer for this patch?” popping up on IRC quite regularly and not something I’m unfamiliar with myself. Not every project has a list of code owners and as soon as your change spans multiple components things might get tricky. Preferably you want reviewers that know the code…

Reference Counting PIMPL Idiom

The pointer to implementation or PIMPL idiom is a popular C++ idiom for decoupling the representation and implementation of a class. It reduces compilation times and enables a stable API while allowing the internals to change. Reference counting is another ubiquitous programming technique, used to manage an object’s lifetime by keeping track of the number of references held to it.…

Exposing Containers of Unique Pointers

The std::unique_ptr is probably one of my favorite and most used features in modern C++. The unique pointer is as powerful as it is simple, and assuming you’ve used it before, you surely know how awesome it is. There are many great articles written about unique pointers, so I won’t go into detail. What I will mention though is that unique pointers provide ownership semantics . What…

One Year At GuardSquare

Today marks my one year anniversary at GuardSquare. On the one hand it feels like yesterday (as cliché as that might sound) but on the other hand it feels like ages ago, considering how much we have been able to do in just one year’s time. For those that don’t know GuardSquare yet, allow me to quickly introduce our company. If you have ever used Java, you probably know ProGuard , our…

Building a Workstation

January 2017 marks the sixth birthday of my desktop computer. When I purchased my trusty Intel Core i5-2500K, I would’ve never guessed that I’d use it for that long. However, rather than jumping to the recently released Kaby Lake CPUs, I’m building my new workstation around two Intel Xeon E5-2670s. Why Xeon? There are several reasons I went with a dual Xeon setup rather than a…

Escape Analysis & Capture Tracking in LLVM

Pointer analysis is an important topic in compiler optimization. One interesting aspect is the dynamic scope of pointers. LLVM differentiates between two situations: Pointer Capture : A pointer value is captured if the function makes a copy of any part of the pointer that outlives the call. Pointer Escape : A pointer value escapes if it is accessible from outside the current function or thread.…

Order Your Members

The C++ standard guarantees that the members of a class or struct appear in memory in the same order as they are declared. Nonstatic data members of a (non-union) class with the same access control are allocated so that later members have higher addresses within a class object. The order of allocation of non-static data members with different access control is unspecified. Implementation alignment…

Guaranteed Copy Elision

The new C++17 standard brings many exciting new features. A smaller, more subtle improvement it brings is guaranteed copy elision . The keyword is guaranteed , as copy elision itself has always been part of the standard. Although it might not be a change as radical as, say, structured bindings, I’m very happy to see it made it into the standard. Copy Elision Before discussing what changed in…

LibEBC & ebcutil

In a previous blog post I wrote about bitcode. Embedding it was already possible for quite some time with Apple’s fork of LLVM that ships with Xcode. Recently, Apple upstreamed (parts of) their implementation making it possible to do the same with the open source clang compiler. However, there are some differences between the two implementations. Bitcode embedded with Apple’s version…

Public Key

-----BEGIN PGP PUBLIC KEY BLOCK----- Version: SKS 1.1.5 mQINBFdy74MBEAC75SzUR+ibt50wrTmQ2Exi/E2Oqrson4a1+C3y2KfTngfPU1pcHweHuqGl Fi0Qx5wPmj9vWeGAX5n/MLO4NTRlwPYS2pp8khk/0JQI39F7z/gjJatWmtWjNtDBkifXQfzL EO8Yd6kN3eFRCSgYZ2r/rzFj1rtrqgZJZY8ANgPciytJeNQSKvr2DtkKPXUY72Vn8Y2Rn2jo /KwxRagLh8I1+8djv0M/84DFTmTGNMqaG+cBWXRmWYeEpxiLgXXpdDZkukby51m0lalgNXvd…

Embedded Bitcode

Little over a year ago, Apple announced at WWDC 2015 the ability to embed bitcode in Mach-O files. Bitcode is the intermediate representation used by the LLVM compiler and contains all the information required to recompile an application. Having the bitcode present, in addition to machine code, Apple can further optimize applications by compiling and linking specifically for the user’s…

MAsCOT

Self-Adaptive Opportunistic Offloading for Cloud-Enabled Smart Mobile Applications with Probabilistic Graphical Models at Runtime I’m proud to announce that the paper summarizing the findings in my master’s thesis ( Intelligent Offloading Decisions for Mobile Cloud Applications ) will be presented at the 49th Hawaii International Conference on System Sciences (HICSS). Abstract:…

Understanding the Clang AST

Clang is everywhere; It is the core of my favorite Vim plugin YouCompleteMe , it recently got supported by Microsoft Visual Studio , it is mentioned in numerous episodes of CppCast and it powers the excellent clang formatter . Naturally, I wanted to get a better understanding of how the clang front end works under the hood. Clang Front End & AST Clang is a C language family front end for LLVM . In…

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,…

Packages I Wish I Knew When Starting LaTeX

I’ve been using LaTeX for almost a decade now. Even after that much time, I keep running into new problems that require a solution I wasn’t aware of. LaTeX has a great community and usually there’s someone that already faced your problem. Every time I learn something new. This post discusses some packages that I consider to be essential, or that you should be at least aware of.…

Word Search Solver

When browsing the Medium homepage I came across this post about #wordsearchwednesday . Although I enjoy a puzzle as much as the next guy, I immediately thought that this was something Haskell lends itself to very well. Less than an hour later I had a working solver. It simply brute-forces the solution by checking every combination with a dictionary. I used the Hunspell dictionaries but anything…

Arduino Display

As I already mentioned in a previous post , I recently purchased a 4 line LCD display to play around with. It provides an I2C Bus which means that it can be connected to your Arduino or similar microcontroller with only two wires. I could’ve come up with a thousand things to do with this display: using it for showing notifications, as an RSS scroller or as a hardware dashboard with…

Proper Printing with HD44780 LCD

I recently purchased a very simple, Hitachi HD44780 compatible LCD screen for an Arduino project. It’s a 20x4 I2C display, which apparently is constructed as a combination of 2 two-line display controllers. This wouldn’t really matter except for the fact that when printing strings longer than a single line, they are displayed in a 1324 manner. So if you set your cursor on the first…

Course Notes & Summaries

For some of the courses I took during my studies in computer science at the University of Leuven, I’ve combined the course material, typically with the help of others, into structured and easy to study documents. Hoping that other students could also benefit from these notes, I’ve made them publicly available, on Github . The documents are written in LateX which hopefully encourages my…

Burglar Alarm: IoT Course

For the Internet of Things (IoT) assignment for the course Capita Selecta: Distributed Systems we were supposed to create a burglar alarm. A passive infrared sensor (IR) detects movements, which triggers a 60 second timer. If the correct code is not entered using a potentiometer and pushbutton, a relay enables the alarm. Although pretty basic, this was probably one of the more fun assignments…

IPv6 Ready

Woohoo, as of today jonasdevlieghere.com is IPv6 Ready! Wondering why this is important? Check out the explanation by Vint Cerf . Edit: I accidentally configured NGINX to only accept connections on the IPv6 socket. This made my site unavailable to some of my visitors. This problem has been resolved as of the first of November.

Real-Debrid Extension

Because going to the Real-Debrid website every time you want to unrestrict a link is such a hassle, and their own Chrome Extension doesn’t work, I decided to come up with my own extension. Basically, it adds an item to your context menu (or right-click menu ) that unrestricts the selected link(s) and automatically downloads the respective file. Feedback is provided using Chrome Desktop…

Backbone.Marionette AMD Modules

This post describes how to create an extremely simple Backbone Marionette application using Asynchronous Module Definition or AMD provided by RequireJS . The Marionette documentation states the following: It is recommended that you divide your controller objects into smaller pieces of related functionality and have multiple routers / controllers, instead of just one giant router and controller.…

Modular Latex with Subfiles

Latex as a document system and markup language is very well suited for creating large documents. Working with a big, single file however remains a hassle, whatever its content. Fortunately, Latex supports splitting your document in several files. Two commands will make your life a lot easier: \input{file.tex} \include{file.tex} Although slightly different, both allow to include content from an…

InTeXration: Compile LaTeX from Github

GitHub is a great platform for collaborating on projects that require versioning. Latex documents such as summaries and reports of college courses are a great example: you can collaborate using the git version control system and make the results public and accessible to interested parties. There is a disadvantage though: git is not suitable for binaries such as the PDFs generated by the Latex…

Lego NXT Robot

In order to obtain our bachelor’s degree every student had to either write a paper on a given subject or participate in a more practice oriented problem-solving project. I chose the latter one and was assigned to Team Gold . The goal of the project was to program Lego NXT Robots using LeJOS so that they could autonomously participate in a game of Team Treasure Trek . Additionally, a…

ALMA Android App

I know few people who study in Leuven and have never been to one of the ALMA restaurants. ALMA is a mensa academica or in English a student restaurant supported by the KU Leuven. They offer students as well as professors and university crew affordable meals while guests pay a bit more. Although the menu is published on their website, it’s quite a hassle to find out what’s available…

Amblone Ambilight

In this post I’ll show how I built an ambilight alike system for my Panasonic TV. I did this using an arduino controller in combination with amblone. This is how it’s described on their website: Amblone stands for Ambilight Clone, and it is an open source ‘Do It Yourself’ solution for imitating Philips Ambient Lighting Technology. It projects light on the wall behind your…

Belgian Card Game

Like many popular social card games, this card game has many local and regional variations in both names and rules. It’s known as Oh Hell in the United States, Boerenbridge in the Netherlands, and Chinees poepen in Flanders. My friends started referring to it as the Belgian card game . The game is a trick-taking card game. The goal is to score points by predicting the number of tricks the…

Public Key

-----BEGIN PGP PUBLIC KEY BLOCK----- Version: SKS 1.1.5 mQINBFdy74MBEAC75SzUR+ibt50wrTmQ2Exi/E2Oqrson4a1+C3y2KfTngfPU1pcHweHuqGl Fi0Qx5wPmj9vWeGAX5n/MLO4NTRlwPYS2pp8khk/0JQI39F7z/gjJatWmtWjNtDBkifXQfzL EO8Yd6kN3eFRCSgYZ2r/rzFj1rtrqgZJZY8ANgPciytJeNQSKvr2DtkKPXUY72Vn8Y2Rn2jo /KwxRagLh8I1+8djv0M/84DFTmTGNMqaG+cBWXRmWYeEpxiLgXXpdDZkukby51m0lalgNXvd…