From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28569 invoked by alias); 9 Feb 2008 16:41:12 -0000 Received: (qmail 28561 invoked by uid 22791); 9 Feb 2008 16:41:11 -0000 X-Spam-Check-By: sourceware.org Received: from heller.inter.net.il (HELO heller.inter.net.il) (213.8.233.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 09 Feb 2008 16:40:52 +0000 Received: from HOME-C4E4A596F7 (IGLD-83-130-218-44.inter.net.il [83.130.218.44]) by heller.inter.net.il (MOS 3.7.3a-GA) with ESMTP id EXD78362 (AUTH halo1); Sat, 9 Feb 2008 18:40:46 +0200 (IST) Date: Sat, 09 Feb 2008 16:41:00 -0000 Message-Id: From: Eli Zaretskii To: Daniel Jacobowitz CC: gdb-patches@sourceware.org In-reply-to: <20080209154834.GA32141@caradoc.them.org> (message from Daniel Jacobowitz on Sat, 9 Feb 2008 10:48:34 -0500) Subject: Re: RFC: Allow a wrapper when starting programs Reply-to: Eli Zaretskii References: <20080208185727.GA30185@caradoc.them.org> <20080209154834.GA32141@caradoc.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00165.txt.bz2 > Date: Sat, 9 Feb 2008 10:48:34 -0500 > From: Daniel Jacobowitz > Cc: gdb-patches@sourceware.org > > On Sat, Feb 09, 2008 at 10:47:15AM +0200, Eli Zaretskii wrote: > > > --- fork-child.c 29 Jan 2008 21:11:24 -0000 1.38 > > > +++ fork-child.c 8 Feb 2008 18:46:39 -0000 > > > > Do all supported platform use fork-child to run the inferior? If not, > > those that don't will not have this feature, and this fact should be > > reflected in the manual. > > I was wondering about that. Will keeping the list up to date be a > problem? Maybe, but it's better not to create an impression that this is supported universally. To make the burden easier, we could say something like "this is supported by only some platforms". > Every native (non-remote) target uses fork-child, except for DJGPP, > Cygwin, mingw32, and QNX NTO. DJGPP is not important enough to care, but Cygwin is, and so are (to a lesser extent, I think) MinGW and NTO. > Of course, you could chain wrappers: "set exec-wrapper env env". And > GDB could make the number of traps configurable for that case. But I > don't think it's useful, and it's hard to explain. So I would prefer > not to support it until someone finds a way to take advantage of > chaining. I agree; documenting the restriction in the manual should be good enough. > > > + The wrapper will run until its first > > > +debug trap before @value{GDBN} takes control. > > > + > > > +On Unix systems, a debug trap (@code{SIGTRAP}) is generated at the > > > +@code{execve} system call. This allows any program which uses > > > +@code{execve} to start another program to be used as a wrapper. > > > > This is not detailed enough to be useful to anyone but a GDB hacker > > who also happened to read the respective portions of the code in > > fork-child.c. In any case, it left me wondering what is this all > > about, and why I, as a GDB user, should care about SIGTRAPs. > > > > IOW, if this is important for the user to know, we should explain the > > issue in terms understandable by a GDB user. > > This is where I get stuck. I did the best I could, but the effect of > waiting for an extra trap is hard to describe except in terms of > signals or examples. I don't know what else to add. Try me: if you explain why all this is needed, I might find a way to describe that in the manual. For starters, why do we need to wait for an extra trap?