Jump to ratings and reviews
Rate this book

Building a Debugger: Write a Native x64 Debugger From Scratch

Rate this book
Master the inner workings of your x64 Linux system and expand your OS expertise by writing your very own debugger using C++.

If debuggers seem like magic to you, there is no better way to demystify them than to write your own. This book will show you exactly how to do it, walking you through the entire process of building a debugger for x64 Linux systems using C++. As go from an empty filesystem folder to a fully fledged debugger capable of setting breakpoints, stepping through code, manipulating variables, and more, you’ll learn how

Attach to a processRead and write to registersSet hardware and software breakpointsOutput disassemblySupport multithreading and other tasks
As you add features to your debugger, you’ll also pick up a wealth of knowledge about operating systems, compilers, software testing, and low-level programming that you can use in your day-to-day development.

744 pages, Paperback

Published June 10, 2025

8 people are currently reading
58 people want to read

About the author

Sy Brand

3 books2 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
5 (71%)
4 stars
2 (28%)
3 stars
0 (0%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 of 1 review
Profile Image for Tomas Herceg.
8 reviews1 follower
August 2, 2025
What a fantastic book! It looks like it is about writing a debugger, but actually, there are way more hidden gems. I was surprised that the core debugging is facilitated by literally one function (ptrace). However, implementing the full debugger requires writing several parsers, interpreters, expression evaluators, and a handful of other algorithms.

The book shows the real programming "craftsmanship": being able to understand a very complex specification (such as DWARF), break complex problems into a bunch of smaller ones, and implement everything piece by piece in a structured and organized way (and what is more, in C++). I liked the approach of writing functions that use other functions that are yet to be implemented to explain the high-level principles before jumping into the details. In some places, the book goes the opposite direction - first, it prepares several helper functions, and then it composes the feature from these building blocks. Both approaches help to deal with complicated problems, and this is what every developer should learn and apply in their day-to-day job.

Even if you don't know assembly language and saw C/C++ only briefly in school many years ago, the book is really easy to follow.
Displaying 1 of 1 review

Can't find what you're looking for?

Get help and learn more about the design.