From owner-freebsd-hackers Fri Nov 24 02:25:31 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id CAA09198 for hackers-outgoing; Fri, 24 Nov 1995 02:25:31 -0800 Received: from cls.net (freeside.cls.de [192.129.50.1]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id CAA09192 for ; Fri, 24 Nov 1995 02:25:25 -0800 Received: by mail.cls.net (Smail3.1.29.1) from allegro.lemis.de (192.109.197.134) with smtp id ; Fri, 24 Nov 95 10:25 GMT From: grog@lemis.de (Greg Lehey) Organisation: LEMIS, Schellnhausen 2, 36325 Feldatal, Germany Phone: +49-6637-919123 Fax: +49-6637-919122 Reply-To: grog@lemis.de (Greg Lehey) Received: (grog@localhost) by allegro.lemis.de (8.6.9/8.6.9) id LAA24697 for hackers@freebsd.org; Fri, 24 Nov 1995 11:05:15 +0100 Message-Id: <199511241005.LAA24697@allegro.lemis.de> Subject: Re: ptrace() To: gavin@linux1.dlsu.edu.ph (Gavin Chan Lim) Date: Fri, 24 Nov 1995 11:04:51 +0100 (MET) In-Reply-To: from "Gavin Chan Lim" at Nov 23, 95 01:36:09 pm X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 1040 Sender: owner-hackers@FreeBSD.ORG Precedence: bulk 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