andersch.dev

<2022-05-28 Sat>

Debugger

A debugger is a program used to debug a target program. Debuggers aim to visualize data and clarify control flow. They are a common tool in software development.

Debugging facilities include

Debuggers on Linux are implemented using the ptrace systemcall.

Debugging data formats

  • DWARF is the standardized debugging data format for ELF files.
  • PDB (Program database) is the debugging file format used by Microsoft.

List of debuggers

  • RemedyBG: a 64-bit Windows debugger for C/C++
  • rr: C/C++ debugging tool for Linux, aiming to be a replacement for gdb
  • Visual Studio: Windows IDE with integrated debugger
  • raddebugger: A graphical Windows debugger for x64

Debugger APIs

Debug Events

A debugger is attached to a debuggee's process, meaning it receives debug information about it at runtime from the OS. The information comes in the form of debug events and can include:

  • When a process/thread/module is created or loaded
  • When a thread is named
  • When a thread encounters an exception ("trap", memory violation) and where
  • When a thread logs a debug string
  • When a process/thread/module exits or unloads

Resources