How do I attach to a running process like a debugger on linux?

linux, process

Solution

ptrace() is the system call you're looking for.

Problem

What system calls are used? I want to use it to read memory locations scattered inside a different process's address space. Is this a reasonable use case for this mechanism?

Original source