Название: Building a Debugger: Write a Native x64 Debugger From Scratch (Final) Автор: Sy Brand Издательство: No Starch Press Год: 2025 Страниц: 744 Язык: английский Формат: epub Размер: 19.4 MB
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 to:
Attach to a process Read and write to registers Set hardware and software breakpoints Output disassembly Support multithreading and other tasks
Have you ever set a breakpoint on a line of code and wondered how it worked, or printed the value of a variable and become curious about how the debugger knew where to look for it in memory? Or maybe you want to know what happens in the depths of your computer when you attach to existing processes and bend them to your will. If so, this is the book for you. Building a Debugger will demystify the black boxes that debuggers so often appear to be. It will reveal how they function and walk you through building one of your own, beginning from an empty folder on your filesystem and ending with a functional tool that can step through your programs, set breakpoints, read variables, and more. Along the way, you’ll pick up a wealth of knowledge about Linux, operating systems in general, and the low-level operations of computer systems.
Developers typically use debuggers for tasks such as tracing the control flow of their code as it runs, inspecting the values of variables at various points of execution, halting the program at predetermined locations, and executing functions inside the running process. In this book, we’re particularly concerned with debuggers for compiled code that runs directly on your central processing unit (CPU), written in a language like C, C++, Rust, or FORTRAN. Debuggers for these programs need to interface directly with the operating system and the underlying hardware, which can lead us to some deep insights into how computers actually work.
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.
Contents:
Introduction 1 Project Setup 2 Compilation and Computer Architecture 3 Attaching to a Process 4 Pipes, Procfs, and Automated Testing 5 Registers 6 Testing Registers with X64 Assembly 7 Software Breakpoints 8 Memory and Disassembly 9 Hardware Breakpoints and Watchpoints 10 Signals and Syscalls 11 Object Files 12 Debug Information 13 Line Tables 14 Source-Level Breakpoints and Stepping 15 Call Frame Information 16 Stack Unwinding 17 Shared Libraries 18 Multithreading 19 Dwarf Expressions 20 Variables and Types 21 Expression Evaluation 22 Advanced Topics Appendix: Check Your Knowledge Answers Glossary Index
Скачать Building a Debugger: Write a Native x64 Debugger From Scratch (Final)
|