Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Practice build · Operating systems and the machine

Build your own Debugger

A Linux debugger built on ptrace: launch a program, set breakpoints, step through it, and read its registers and memory.

  • Advanced
  • About 15–30 h
  • 4 checkpoints
  • 1 tutorial · C++

Pick a tutorial, then check yourself at each checkpoint. Work in any language you like.

Choose a tutorial

Why build it

A breakpoint is one byte swapped in memory, and a debugger is a process controlling another. Building one explains ptrace, signals, ELF files and DWARF debugging information.

Before you start: Linux on x86-64 (a VM is fine).

You will be able to

  • Control a child process with ptrace and signals.
  • Set and remove software breakpoints by patching the int3 instruction.
  • Read and write the registers and memory of a stopped process.
  • Map addresses to source lines using DWARF line tables.

Skills it exercises

Recommended on Operating Systems & Linux.

Checkpoints

How you know you are there

Work in any language. Each checkpoint ends with something you can run or observe, so you can check it yourself.

  1. Checkpoint 1Self-check

    Launch and continue

    Done when: The debugger starts a program under ptrace, stops before main, and continues it on command.

  2. Checkpoint 2Self-check

    Breakpoints

    Done when: A breakpoint at an address stops the program there, and continuing restores the original instruction and resumes correctly.

  3. Checkpoint 3Self-check

    Registers and memory

    Done when: Commands print and change registers and memory, and changing a variable changes the program's output.

  4. Checkpoint 4Self-check

    Source-level stepping

    Done when: Breakpoints can be set by function name or file:line, and step advances one source line.

Stretch goals

  • Backtraces by unwinding the stack.
  • Watchpoints with hardware debug registers.
Follow a tutorial

Step-by-step guides

Pick one in a language you know (tutorial languages: C++). They open on the author’s site.

Practice builds are self-paced: Tech Atlas does not track them or count them as evidence. To show a skill, take its knowledge check from the skill page.

Tutorials come from codecrafters-io/build-your-own-x (CC0, snapshot of 2026-07-14, commit aa17439; links checked on 2026-10-19). Each tutorial belongs to its author and keeps its own licence; Tech Atlas links to it and does not host it. Briefs, checkpoints and the mapping to skills are Tech Atlas editorial drafts.