From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31079 invoked by alias); 4 Dec 2008 23:02:50 -0000 Received: (qmail 30639 invoked by uid 22791); 4 Dec 2008 23:02:45 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Dec 2008 23:02:10 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id mB4N26IE021248 for ; Thu, 4 Dec 2008 15:02:08 -0800 Received: from rv-out-0506.google.com (rvbk40.prod.google.com [10.140.87.40]) by wpaz33.hot.corp.google.com with ESMTP id mB4N0kw6017542 for ; Thu, 4 Dec 2008 15:02:05 -0800 Received: by rv-out-0506.google.com with SMTP id k40so8747123rvb.57 for ; Thu, 04 Dec 2008 15:02:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.141.87.13 with SMTP id p13mr7184527rvl.286.1228431725259; Thu, 04 Dec 2008 15:02:05 -0800 (PST) In-Reply-To: <20081204131535.GC24868@caradoc.them.org> References: <20081204012417.1413E1C7A0F@localhost> <20081204131535.GC24868@caradoc.them.org> Date: Thu, 04 Dec 2008 23:02:00 -0000 Message-ID: Subject: Re: [RFA] change gdbserver's pids to int From: Doug Evans To: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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-12/txt/msg00080.txt.bz2 On Thu, Dec 4, 2008 at 5:15 AM, Daniel Jacobowitz wrote: > On Wed, Dec 03, 2008 at 05:24:16PM -0800, Doug Evans wrote: >> gdb uses an int for a pid (see ptid.pid in defs.h), >> and, for example, gdbserver's target_ops.create_inferior returns an int. >> For consistency I made pid an int elsewhere in gdbserver, >> except for "id" in struct inferior_list - it's used for more than just pids >> although I suspect int could be used here too, left for another day. >> >> Plus this cleans things up by removing local decls of signal_pid. >> >> Ok to check in? > > Are you sure that every place you touched gets a system PID, not a > thread ID? They used to be ints, but were changed to unsigned long > because NPTL's TIDs do not fit in an int. Ya, I specifically stuck to pids. > Also, do Windows PIDs fit in an int? Win32 pids must, but I expect > we'll get a Win64 port at some point. Good question. I was in part going for consistency with what gdb uses. Maybe it would be useful to have gdb_pid_t, gdb_tid_t types that both gdb and gdbserver use. > I'd like to know the advantage before moving all the deck chairs round > again. Consistency with gdb is good. Plus it's odd to pass an unsigned long to linux_attach_lwp and then it pass that as the pid argument to ptrace when linux_create_inferior is using an int for pid. And it's odd that signal_pid is an unsigned long which is then passed to waitpid. Compiling gdbserver with -Wconversion may have a lot of noise (enough to warrant not making it the default anyway), but I think we can still make an effort to be clean.