This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/5] s/struct process_info/struct inferior/


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.]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]