Poster: libdebug, Build Your Own Debugger for a Better (Hello) World
Gabriele Digregorio, Roberto Alessandro Bertolini, Francesco Panebianco, Mario Polino · 2025
Read Poster: libdebug, Build Your Own Debugger for a Better (Hello) World by Gabriele Digregorio, Roberto Alessandro Bertolini, Francesco Panebianco, Mario Polino (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-02667.txt.
Introduction
Gabriele Digregorio and co-authors present a Python library for building custom debuggers. Their 2025 poster paper notes that stock debuggers serve human users, while scripted ones tend to aim at kernel code, leaving user programs thinly served. The library gives building blocks for a scripted debug flow with a friendly interface.
Case studies span software building, reverse work, and security tasks. In tests, the library handled system calls and breakpoints three to four times faster than the standard GDB tool, by median delay. Code and docs are open for public use and joint growth. The authors pitch it as base gear for automated debug work.
Catalog record
| CREATOR | Gabriele Digregorio, Roberto Alessandro Bertolini, Francesco Panebianco, Mario Polino |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 15 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2506-02667
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Poster: libdebug, Build Your Own Debugger for a Better (Hello) World Conference: This paper was accepted at the 2024 ACM SIGSAC Conference on Computer and Communications Security; October 14–18, 2024; Salt Lake City, UT, USA DOI: 10.1145/3658644.3691391 Thanks: This paper has been accepted at the 2024 ACM SIGSAC Conference on Computer and Communications Security (CCS ’24), October 14–18, 2024, Salt Lake City, UT, USA CCS: Security and privacy Software reverse engineering CCS: Security and privacy Software security engineering CCS: Software and its engineering Software testing and debugging Gabriele Digregorio, Roberto Alessandro Bertolini, Francesco Panebianco, Mario Polino Abstract . Automated debugging, long pursued in a variety of fields from software engineering to cybersecurity, requires a framework that offers the building blocks for a programmable debugging workflow. However, existing debuggers are primarily tailored for human interaction, and those designed for programmatic debugging focus on kernel space, resulting in limited functionality in userland. To fill this gap, we introduce libdebug, a Python library for programmatic debugging of userland binary executables. libdebug offers a user-friendly API that enables developers to build custom debugging tools for various applications, including software engineering, reverse engineering, and software security. It is released as an open-source project, along with comprehensive documentation to encourage use and collaboration across the community. We demonstrate the versatility and performance of libdebug through case studies and benchmarks, all of which are publicly available. We find that the median latency of syscall and breakpoint handling in libdebug is 3 to 4 times lower compared to that of GDB. 1. Introduction Debuggers have long been key tools for software engineers, serving as essential instruments for identifying and resolving logical flaws within code. Among the most prominent debugging tools for Linux is the GNU Debugger (GDB) ( Stallman et al. 1988 ) , known for its set of human-oriented commands designed for interactive debugging. Through step-by-step manual inspection, software developers can spot unexpected behavior and bugs. Over time, the need for automation in the debugging process has been increasingly recognized, promoting the formalization and systematization of debugging as a hypothesis verification process ( Zeller 2009 ; Zeller 2024 ) . While these methodologies were originally developed within the context of software engineering, the application of debuggers has since extended beyond traditional software development into the cybersecurity context. Security professionals now leverage debuggers to diagnose memory corruption vulnerabilities and assess potential exploitation vectors that could escalate into remote code execution on target systems. Furthermore, debuggers enable dynamic analysis during reverse engineering, allowing for the dissection of intricate procedures by inspecting the process state in real-time. This capability is essential for tracing the behavior of malicious software and identifying vulnerabilities in binary applications, particularly in scenarios where the source code is unavailable. A crucial step in automating debugging is creating a programmable framework equipped with essential building blocks to construct tailored debugging workflows. An illustrative example of such a framework is drgn ( Sandoval 2024 ) , a programmable debugger specifically targeted for the Linux Kernel. A core aspect of its design is intuitiveness in scripting, which is a shortcoming for existing solutions like GDB. However, security specialists frequently need to script and automate debugging within user space to replicate specific execution flows or to develop customized wrappers suited to unique debugging tasks. Although drgn aims to support userland debugging, it was not initially intended for this purpose. Notably, at the time of writing, it can access a userspace process and read its memory, but it lacks fundamental features for effective debugging, including pausing threads and setting breakpoints ( Sandoval 2023 ) . To address these needs, we introduce libdebug ( Digregorio et al. 2024 ) , an open-source Python library for programmatic debugging. libdebug provides a comprehensive set of building blocks designed to facilitate the development of debugging tools for different purposes, including reverse engineering and exploitation. During the development of libdebug, we prioritized efficiency in the implementation of each building block. This aspect is not secondary, as it directly impacts the execution time of the debuggee and, therefore, the applicability of the designed debugging workflows in real-world scenarios. This paper presents the rationale behind libdebug, demonstrating its utility across various domains via detailed case studies, with an emphasis on security perspectives. To show how libdebug’s building blocks can come together, we release the source code of these case studies. Additionally, we benchmark relevant event handling in both libdebug and GDB Python scripts, specifically breakpoint and syscall handling, and find that using libdebug results in a speedup of 3 to 4 times in the median case. Our contributions are summarized as follows: • We introduce libdebug: a versatile Python library for programmatic debugging of userland binary executables. • We demonstrate the capability and potential of libdebug through various use cases, ranging from software engineering to cybersecurity. Additionally, we compare its event handling latency with that of GDB. • We release libdebug as an open-source project 1 1 1 https://github.com/libdebug/libdebug , accompanied by comprehensive documentation 2 2 2 https://docs.libdebug.org . 2. Your Own Debugger Debugging a userland binary executable involves kernel-mediated control over the state of the target process, such as its memory and register contents. For example, in the case of Unix-like kernels (e.g., Linux, Darwin), the ptrace ( noa 1999 ) system call is used to interact with running processes, through a series of architecture-specific commands. The role of a debugger is to add a layer of abstraction that manages the interaction with these unintuitive native debug APIs, allowing users to focus on the debugging of applications. Widespread debuggers such as GDB are designed primarily for human interaction. However, many tasks require the debugging flow to be repeatable and programmable. Moreover, traditional debuggers typically only focus on debugging binaries during development and testing phases. In cybersecurity, a debugger is a vital tool used in reverse engineering and exploitation. During these tasks, it is crucial to consistently and reliably know the execution state of a process. For example, programmatically inspecting how different inputs affect the execution flow or the content of registers and memory is highly beneficial. libdebug is a Python library that provides users with all the necessary building blocks to easily program custom debuggers that can be tailored to unique scenarios and applications, including those related to cybersecurity. Python’s consistent popularity, versatility, and widespread adoption among tech experts ( Stephen 2023 ) make it an ideal choice for this task. libdebug implements direct interaction with the native debug APIs exposed by the kernel in a way that is transparent to the user, providing a consistent high-level API across different architectures. libdebug does not rely on any assumptions about the compilation options or the structure of the binary being analyzed, nor does it require for any debug information to be embedded in the executable. The functionalities exposed by libdebug include operations on registers, memory, breakpoints, watchpoints, syscalls, and signals, as well as support for multithreading. Additionally, it exposes interaction with the target’s standard input, output, and error streams. While it is mostly written in Python, libdebug leverages C code bindings ( Foundation 2024 ) to improve interaction with the operating system and performance. It is designed with modularity in mind, facilitating the easy expansion of its functionalities