Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/5] s/struct process_info/struct inferior/
Date: Tue, 20 Mar 2012 16:28:00 -0000	[thread overview]
Message-ID: <CADPb22TSUqY8OrPh61PHPoEA0PyZzmTB2CqMSxpT_WUH+obwmw@mail.gmail.com> (raw)
In-Reply-To: <1331909994-9473-4-git-send-email-yao@codesourcery.com>

On Fri, Mar 16, 2012 at 7:59 AM, Yao Qi <yao@codesourcery.com> wrote:
> ITSET need a type `struct inferior' to represent a process.  Its counter part
> in GDBserver is `struct process_info'.  This patch is to rename `struct process_info'
> to `struct inferior', so that ITSET code in gdb/common can use 'struct inferior'
> unconditionally.
>
> gdb/gdbserver:
>
>        * inferiors.c (struct process_info): Renamed to struct inferior.
>        * linux-arm-low.c, linux-low.c, linux-low.h: Update usage.
>        * linux-x86-low.c, lynx-low.c, mem-break.c, mem-break.h: Likewise.
>        * nto-low.c, remote-utils.c, server.c, server.h: Likewise.
>        * 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)
>  /* Add a process to the common process list, and set its private
>    data.  */
>
> -static struct process_info *
> +static struct inferior *
>  linux_add_process (int pid, int attached)
>  {
> -  struct process_info *proc;
> +  struct inferior *proc;
>
>   /* Is this the first process?  If so, then set the arch.  */
>   if (all_processes.head == NULL)
> @@ -951,7 +951,7 @@ kill_one_lwp_callback (struct inferior_list_entry *entry, void *args)
>  static int
>  linux_kill (int pid)
>  {
> -  struct process_info *process;
> +  struct inferior *process;
>   struct lwp_info *lwp;
>   int wstat;
>   int lwpid;
> @@ -1037,7 +1037,7 @@ linux_detach_one_lwp (struct inferior_list_entry *entry, void *args)
>  static int
>  linux_detach (int pid)
>  {
> -  struct process_info *process;
> +  struct inferior *process;
>
>   process = find_process_pid (pid);
>   if (process == NULL)
> @@ -1072,7 +1072,7 @@ static int
>  delete_lwp_callback (struct inferior_list_entry *entry, void *proc)
>  {
>   struct lwp_info *lwp = (struct lwp_info *) entry;
> -  struct process_info *process = proc;
> +  struct inferior *process = proc;
>
>   if (pid_of (lwp) == pid_of (process))
>     delete_lwp (lwp);
> @@ -1081,7 +1081,7 @@ delete_lwp_callback (struct inferior_list_entry *entry, void *proc)
>  }
>
>  static void
> -linux_mourn (struct process_info *process)
> +linux_mourn (struct inferior *process)
>  {
>   struct process_info_private *priv;
>
> @@ -4520,7 +4520,7 @@ static void
>  linux_look_up_symbols (void)
>  {
>  #ifdef USE_THREAD_DB
> -  struct process_info *proc = current_process ();
> +  struct inferior *proc = current_process ();
>
>   if (proc->private->thread_db != NULL)
>     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.]


  reply	other threads:[~2012-03-20 16:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 15:01 [PATCH 0/5] Preparatory patches for ITSET in GDBserver Yao Qi
2012-03-16 15:01 ` [PATCH 3/5] s/struct process_info/struct inferior/ Yao Qi
2012-03-20 16:28   ` Doug Evans [this message]
2012-03-20 17:55     ` Pedro Alves
2012-03-20 21:31       ` Doug Evans
2012-03-21  4:27       ` Yao Qi
2012-03-21  3:18     ` Yao Qi
2012-03-16 15:01 ` [PATCH 4/5] move server.h to inferior.h Yao Qi
2012-04-13 17:37   ` Tom Tromey
2012-03-16 15:01 ` [PATCH 1/5] Define target_core_of_thread in gdbserver Yao Qi
2012-03-16 15:02 ` [PATCH 2/5] Move vec to common/ Yao Qi
2012-03-16 15:02 ` [PATCH 5/5] move server.h to gdbthread.h Yao Qi
2012-04-13 17:43   ` Tom Tromey
2012-04-19  4:35     ` Yao Qi
2012-04-29  6:46       ` [committed]: " Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADPb22TSUqY8OrPh61PHPoEA0PyZzmTB2CqMSxpT_WUH+obwmw@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox