From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18660 invoked by alias); 20 Mar 2012 16:28:32 -0000 Received: (qmail 18449 invoked by uid 22791); 20 Mar 2012 16:28:20 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Mar 2012 16:28:03 +0000 Received: by vcbfk14 with SMTP id fk14so274231vcb.0 for ; Tue, 20 Mar 2012 09:28:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record :x-gm-message-state; bh=lJgkMej4wat+2cBZtBULPoqU/GYM7ksXKtTbJtK1aX4=; b=eBF8/z1ceOHDcaf0EIqkkaFSzzaDCopnpEfdYeumwGBAnj+rCbw9wFevSdz42KFkSl 79vkXHwJzOxxmoPhFhRJDwrIbiOSig0mNHFH48/vaZ5T+k9xz9DvGVkSYWYuVsqNy5yI elYN4qG4aYPo17Dyat9mvW7F1k2DVcPjCQD5HzFe3X4/bMYSMJ+v1k5MKkzEQiWNSDnh gF5Opore/Cv0eNy/S7TLDo4JXImm7P5U6r//otPVyTWNsDm0B24F6qlNY7I1Hz1faAqQ tLrSqjNh0raFUDMSRt7DJlGwzzfz+Np8FyQoXYHnLSm3HuQGChK2deGP/KttuHx/6u5P cPgw== Received: by 10.220.231.136 with SMTP id jq8mr184798vcb.74.1332260882476; Tue, 20 Mar 2012 09:28:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.231.136 with SMTP id jq8mr184792vcb.74.1332260882382; Tue, 20 Mar 2012 09:28:02 -0700 (PDT) Received: by 10.220.187.12 with HTTP; Tue, 20 Mar 2012 09:28:02 -0700 (PDT) In-Reply-To: <1331909994-9473-4-git-send-email-yao@codesourcery.com> References: <1331909994-9473-1-git-send-email-yao@codesourcery.com> <1331909994-9473-4-git-send-email-yao@codesourcery.com> Date: Tue, 20 Mar 2012 16:28:00 -0000 Message-ID: Subject: Re: [PATCH 3/5] s/struct process_info/struct inferior/ From: Doug Evans To: Yao Qi Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQmAUtXybveyxiPQZ9yMXHIxREYzpOR8Ow39lBclZtEqHixg6wup9pZyEfHt9wJ7TskcLTsibgBMtyapGIwRcozxVtLeJ+wWZPVma899dIYVuhuXWNeK/X20rM1kBFHbQdUkacwrqRt3atCrEIFiiRNJqbvW8w== 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: 2012-03/txt/msg00744.txt.bz2 On Fri, Mar 16, 2012 at 7:59 AM, Yao Qi wrote: > ITSET need a type `struct inferior' to represent a process. =A0Its counte= r part > in GDBserver is `struct process_info'. =A0This patch is to rename `struct= process_info' > to `struct inferior', so that ITSET code in gdb/common can use 'struct in= ferior' > unconditionally. > > gdb/gdbserver: > > =A0 =A0 =A0 =A0* inferiors.c (struct process_info): Renamed to struct inf= erior. > =A0 =A0 =A0 =A0* linux-arm-low.c, linux-low.c, linux-low.h: Update usage. > =A0 =A0 =A0 =A0* linux-x86-low.c, lynx-low.c, mem-break.c, mem-break.h: L= ikewise. > =A0 =A0 =A0 =A0* nto-low.c, remote-utils.c, server.c, server.h: Likewise. > =A0 =A0 =A0 =A0* spu-low.c, target.h, thread-db.c, win32-low.c: Likewise. > [...] > diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c > index 4f8ec6b..3376b8d 100644 > --- a/gdb/gdbserver/linux-low.c > +++ b/gdb/gdbserver/linux-low.c > @@ -290,10 +290,10 @@ delete_lwp (struct lwp_info *lwp) > =A0/* Add a process to the common process list, and set its private > =A0 =A0data. =A0*/ > > -static struct process_info * > +static struct inferior * > =A0linux_add_process (int pid, int attached) > =A0{ > - =A0struct process_info *proc; > + =A0struct inferior *proc; > > =A0 /* Is this the first process? =A0If so, then set the arch. =A0*/ > =A0 if (all_processes.head =3D=3D NULL) > @@ -951,7 +951,7 @@ kill_one_lwp_callback (struct inferior_list_entry *en= try, void *args) > =A0static int > =A0linux_kill (int pid) > =A0{ > - =A0struct process_info *process; > + =A0struct inferior *process; > =A0 struct lwp_info *lwp; > =A0 int wstat; > =A0 int lwpid; > @@ -1037,7 +1037,7 @@ linux_detach_one_lwp (struct inferior_list_entry *e= ntry, void *args) > =A0static int > =A0linux_detach (int pid) > =A0{ > - =A0struct process_info *process; > + =A0struct inferior *process; > > =A0 process =3D find_process_pid (pid); > =A0 if (process =3D=3D NULL) > @@ -1072,7 +1072,7 @@ static int > =A0delete_lwp_callback (struct inferior_list_entry *entry, void *proc) > =A0{ > =A0 struct lwp_info *lwp =3D (struct lwp_info *) entry; > - =A0struct process_info *process =3D proc; > + =A0struct inferior *process =3D proc; > > =A0 if (pid_of (lwp) =3D=3D pid_of (process)) > =A0 =A0 delete_lwp (lwp); > @@ -1081,7 +1081,7 @@ delete_lwp_callback (struct inferior_list_entry *en= try, void *proc) > =A0} > > =A0static void > -linux_mourn (struct process_info *process) > +linux_mourn (struct inferior *process) > =A0{ > =A0 struct process_info_private *priv; > > @@ -4520,7 +4520,7 @@ static void > =A0linux_look_up_symbols (void) > =A0{ > =A0#ifdef USE_THREAD_DB > - =A0struct process_info *proc =3D current_process (); > + =A0struct inferior *proc =3D current_process (); > > =A0 if (proc->private->thread_db !=3D NULL) > =A0 =A0 return; > [...] One thought that comes to mind is that if this renaming is good, then it's incomplete: rename current_process to current_inferior, and make similar changes throughout gdb. E.g., don't just change "struct process_info *process" to "struct inferior *process", change it to "struct inferior *inferior". Another example: rename linux_add_process to linux_add_inferior. [I realize it's more work, but to me the patch leaves gdb in a half-changed state otherwise.]