From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19365 invoked by alias); 4 Jun 2003 23:27:54 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19321 invoked from network); 4 Jun 2003 23:27:53 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 4 Jun 2003 23:27:53 -0000 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id C3E42800021; Wed, 4 Jun 2003 19:27:52 -0400 (EDT) Message-ID: <3EDE8078.1080405@redhat.com> Date: Wed, 04 Jun 2003 23:27:00 -0000 From: "J. Johnston" Organization: Red Hat Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: A couple of comments about the nptl patch (minor) References: <20030604221815.GS926@gnat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00189.txt.bz2 Joel Brobecker wrote: > Hello, > > I'm reading Jeff's patch regarding support for NPTL, and have a couple > of comments/questions... It's really minor... > > >>static int tkill_failed; > > > This could be moved inside kill_lwp. Something like the following. > I would also explicitely set it to zero but this is maybe already > guaranteed by the language? > That would move the declaration after the first reference (the if statement). C defaults static and global variables to 0 if they have no initial value specified. So, yes, it is guaranteed by the language. > >>#ifdef HAVE_TKILL_SYSCALL >> if (!tkill_failed) >> { > > static int tkill_failed = 0; > >> int ret = syscall (__NR_tkill, lwpid, signo); >> if (errno != ENOSYS) >> return ret; >> errno = 0; >> tkill_failed = 1; >> } >>#endif > > > In stop_callback, the gdb_assert for ret to be zero after the call to > kill (or kill_lwp) has been removed. I suppose it is valid for syscall > to return nonzero values ? In that case, is it still necessary to keep > this local variable? > I removed the gdb_assert because in nptl, the lwp can exit without you getting notified (you don't get an exit event like you did under linuxthreads). Daniel J. wants to change this, but it already a behavior of RH9. The ret is kept for the debugging output when "set debug lin-lwp 1" is specified. > >>/* Send a SIGSTOP to LP. */ >> >>static int >>stop_callback (struct lwp_info *lp, void *data) >>{ >> if (!lp->stopped && !lp->signalled) >> { >> int ret; > > [...] > >> ret = kill_lwp (GET_LWP (lp->ptid), SIGSTOP); > > [...] > >> } > >