The parent can control the child's execution by changing the user / kernel mode execution state.
How debbuging works
1. fork() a child
2. set P_TRACED flag for child by calling ptrace()
3. child calls execve() to load image of debugged program
4. first instruction will cause a hardware trap (SIGTRAP-signal) which informs the parent.
How the parent accesses the child
1. places parameters in the "ipc" datastructure.
2. calls ptrace()
3. child gets "ipc" parameters.
4. child puts result in "ipc", calls wakeup on ipc --> wakes up the parent
This makes it possible that the parent does not have to write anything into the child's memory which would conflict with the standard UNIX-permissions.