TL;DR

  1. summary
    • ptrace make tracee stop on ptrace hook and notify tracer [1][2]
    • tracer use ptrace syscall to get tracee registers and memory [3][4]
    • strace pretty output syscall name and argument according to tracee registers and memory
      • strace get tracee registers and memory at tracee enter and exit syscall
  2. ptrace
  3. strace

links: