man page of ptrace will have all the answers.
#####################################################################
PTRACE(2) Linux Programmer’s Manual PTRACE(2)
NAME
ptrace - process trace
SYNOPSIS
#include <sys/ptrace.h>
long ptrace(enum __ptrace_request request, pid_t pid,
void *addr, void *data);
DESCRIPTION
The ptrace() system call provides a means by which a parent process may
observe and control the execution of another process, and examine and
change its core image and registers. It is primarily used to implement
breakpoint debugging and system call tracing.
###################################################################
Thanks
Sri
On Wed, Oct 7, 2009 at 11:35 AM, Gaurav Aggarwal <grv.aggarwal@xxxxxxxxx> wrote:
Hey All,
I do have a doubt not exactly on the kernel side but how exactly the 'gdb attach' command works? Isn't this violates the OS 'memory protection' objective of prevent a process from accessing memory that has not been allocated to it and hence to interfere with other processes memory space?
--
Regards,
Gaurav Aggarwal
--
SK Malik