[binutils-gdb] Remove proc->priv->new_inferior

Yao Qi qiyao@sourceware.org
Fri Jul 24 13:44:00 GMT 2015


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=55d7b841962c6e054735acdca2e0bb485afa0144

commit 55d7b841962c6e054735acdca2e0bb485afa0144
Author: Yao Qi <yao.qi@linaro.org>
Date:   Fri Jul 24 14:40:34 2015 +0100

    Remove proc->priv->new_inferior
    
    As the result of the previous patch, new_inferior is no longer used.
    This patch is to remove it.
    
    gdb/gdbserver:
    
    2015-07-24  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-low.c (linux_create_inferior): Remove setting to
    	proc->priv->new_inferior.
    	(linux_attach): Likewise.
    	(linux_low_filter_event): Likewise.
    	* linux-low.h (struct process_info_private) <new_inferior>: Remove.

Diff:
---
 gdb/gdbserver/ChangeLog   |  8 ++++++++
 gdb/gdbserver/linux-low.c | 12 ++----------
 gdb/gdbserver/linux-low.h |  5 -----
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index cff2f36..2088997 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,13 @@
 2015-07-24  Yao Qi  <yao.qi@linaro.org>
 
+	* linux-low.c (linux_create_inferior): Remove setting to
+	proc->priv->new_inferior.
+	(linux_attach): Likewise.
+	(linux_low_filter_event): Likewise.
+	* linux-low.h (struct process_info_private) <new_inferior>: Remove.
+
+2015-07-24  Yao Qi  <yao.qi@linaro.org>
+
 	* linux-low.c (linux_arch_setup): New function.
 	(linux_low_filter_event): If proc->tdesc is NULL and
 	proc->attached is true, call the_low_target.arch_setup.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index ac1ad6f..7b43187 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -763,7 +763,6 @@ linux_create_inferior (char *program, char **allargs)
   ptid_t ptid;
   struct cleanup *restore_personality
     = maybe_disable_address_space_randomization (disable_randomization);
-  struct process_info *proc;
 
 #if defined(__UCLIBC__) && defined(HAS_NOMMU)
   pid = vfork ();
@@ -811,9 +810,7 @@ linux_create_inferior (char *program, char **allargs)
 
   do_cleanups (restore_personality);
 
-  proc = linux_add_process (pid, 0);
-  /* Set the arch when the first LWP stops.  */
-  proc->priv->new_inferior = 1;
+  linux_add_process (pid, 0);
 
   ptid = ptid_build (pid, pid, 0);
   new_lwp = add_lwp (ptid);
@@ -967,7 +964,6 @@ linux_attach (unsigned long pid)
 {
   ptid_t ptid = ptid_build (pid, pid, 0);
   int err;
-  struct process_info *proc;
 
   /* Attach to PID.  We will check for other threads
      soon.  */
@@ -976,9 +972,7 @@ linux_attach (unsigned long pid)
     error ("Cannot attach to process %ld: %s",
 	   pid, linux_ptrace_attach_fail_reason_string (ptid, err));
 
-  proc = linux_add_process (pid, 1);
-  /* Set the arch when the first LWP stops.  */
-  proc->priv->new_inferior = 1;
+  linux_add_process (pid, 1);
 
   if (!non_stop)
     {
@@ -2130,8 +2124,6 @@ linux_low_filter_event (int lwpid, int wstat)
 	      the_low_target.arch_setup ();
 
 	      current_thread = saved_thread;
-
-	      proc->priv->new_inferior = 0;
 	    }
 	  else
 	    {
diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
index 3300da9..5a3697b 100644
--- a/gdb/gdbserver/linux-low.h
+++ b/gdb/gdbserver/linux-low.h
@@ -115,11 +115,6 @@ struct process_info_private
 
   /* &_r_debug.  0 if not yet determined.  -1 if no PT_DYNAMIC in Phdrs.  */
   CORE_ADDR r_debug;
-
-  /* This flag is true iff we've just created or attached to the first
-     LWP of this process but it has not stopped yet.  As soon as it
-     does, we need to call the low target's arch_setup callback.  */
-  int new_inferior;
 };
 
 struct lwp_info;



More information about the Gdb-cvs mailing list