Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Nov 1995 11:04:51 +0100 (MET)
From:      grog@lemis.de (Greg Lehey)
To:        gavin@linux1.dlsu.edu.ph (Gavin Chan Lim)
Subject:   Re: ptrace()
Message-ID:  <199511241005.LAA24697@allegro.lemis.de>
In-Reply-To: <Pine.LNX.3.91.951123133345.1208B-100000@ccslinux.dlsu.edu.ph> from "Gavin Chan Lim" at Nov 23, 95 01:36:09 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Gavin Chan Lim writes:
> I've found the source codes for GDB.  I have certain questions regarding
> ptrace().  I hope you can answer them. 
>  
>  1. What does "Attach/Detach to the process" mean?  (PT_ATTACH, PT_DETACH)>
>  2. Does request PT_READ_I mean read the text segment?

Yes, On the PDP-11.  On the i386, it means read the process address
space.

>  3. Does request PT_READ_D mean read the data segment?

Yes, On the PDP-11.  On the i386, it means read the process address
space.  You'll notice that Linux has done away with the difference
between these two, which are redundant, but this is UNIX :-)

>  4. What's the last argument (int data) of ptrace() for?

It's used to pass data where necessary:

     PT_CONTINUE - specify a signal number to be sent to the child
		   process before it continues.  0 means don't send a
		   signal.

     PT_WRITE_U  - data to be written to the user area

     PT_WRITE_I  - data to be written to the process data space
     PT_WRITE_D  - data to be written to the process data space

Greg




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511241005.LAA24697>