Skip to content

aycyang/toy-debugger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(WIP) Toy Debugger

Quick start

cmake -B build
cmake --build build
build/ToyDebugger build/TestProgram
run
break 55555555511d # figure this out using /proc/pid/maps and objdump -d
continue
regs
step
regs
continue
quit

To-do

  • handle dynamic terminal resize
  • show disassembly in a window
  • support non-wrapping text overflow for windows
  • implement text wrapping utility for wrapping text in a window
  • poc render text in boxes
  • write command history to a scrollback buffer
  • re-integrate with command system
  • draw borders around windows for debugging purposes
  • migrate codebase from C to C++
  • parse line into tokens
  • command line interface
  • breakpoint states: inactive/active (not user-controlled), enabled/disabled (user-controlled)
    • enabled+active means the tracee will stop when the breakpoint is reached
    • enabled+inactive means the tracee has hit the breakpoint and is currently stopped, and can hit the breakpoint again
    • disabled+(anything) means the tracee will not stop when the breakpoint is reached
  • as soon as tracee hits a breakpoint, we make the breakpoint inactive (temporarily) and rewind the instruction pointer
  • to continue, we single step, make the breakpoint active, put the int3 instruction back in if needed, then continue
  • link zydis
  • implement ncurses ui

Long-term goals

  • Snapshot and restore a Linux process
  • Time-travel debugging (i.e. reverse stepping)

Reading material

About

A Linux x64 debugger from scratch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published