~/talk

“How C++ Debuggers Work”

Talkat CppCon 2018 · 2018-09-23..09-28· [compilers-and-language-design]
links:none on file
slides:none on file

Covers how Linux x86_64 debuggers inspect ELF and DWARF to map source to addresses, uses ptrace + int3 to implement software breakpoints by replacing a byte with 0xCC then restoring and single‑stepping (or using displaced stepping to avoid races), reads/writes registers and memory via ptrace or process_vm_readv, unwinds stacks from frame pointers and DWARF/CIE data, evaluates expressions by generating IR or injecting mmap'ed code, tracks shared libraries via r_debug/link_map, and speaks the gdb remote protocol to a debug stub.

AI-written summary · about

  1. 0:00Introduction to debuggers
  2. 1:06Debugger overview
  3. 3:50Binary and debug formats
  4. 7:13Ptrace interface
  5. 8:20Hardware and software breakpoints
  6. 11:48Software breakpoint mechanism
  7. 14:10Debugger interaction
  8. 17:33Restoring breakpoints
  9. 22:43Source-level breakpoints
  10. 26:05Stepping through code
  11. 29:00Memory and register access
  12. 30:53Stack unwinding
  13. 33:52Expression evaluation
  14. 37:05Advanced expression evaluation
  15. 43:33Multi-threaded debugging
  16. 45:46Shared library tracing
  17. 48:51Remote debugging
  18. 51:14Remote protocol details
  19. 52:15Q&A and final topics
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.