public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  tromey/multi-target: notes update
@ 2013-08-16 21:42 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2013-08-16 21:42 UTC (permalink / raw)
  To: archer-commits

The branch, tromey/multi-target has been updated
       via  3b8660606cc0531808389d18e6cffcaa1544c27d (commit)
       via  795868119a9f831a599cea27171861c313cfb8a7 (commit)
       via  d600dfd58a0cb7261f79014c6f7af1f4e70394ce (commit)
       via  af94545f23744a86d9802fd3d675a0d9c5bca987 (commit)
       via  d10e85f6f1d1dd345e0ca36e81b9177f59f79ebf (commit)
       via  31913f021dc4aa9e2ec2957e659e1e1a8b826f8d (commit)
       via  f54a93e2186a49f7d4b9c1ddcd3c524eb9c44d40 (commit)
       via  e1607f100ec66ec76b775bed37817bc0fddaea28 (commit)
       via  0903fd0f1384f9633ce836a1461c33f6b339e3ab (commit)
      from  9d360a89784516aab9fa674e22ff7f1507bad64b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 3b8660606cc0531808389d18e6cffcaa1544c27d
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Aug 15 13:24:12 2013 -0600

    notes update

commit 795868119a9f831a599cea27171861c313cfb8a7
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Aug 15 12:29:32 2013 -0600

    fix gdb_target allocation bug
    
    some paths were pushing the gdb_target returned by
    find_default_run_target
    this fixes these to copy the target object
    this area is very messed up though

commit d600dfd58a0cb7261f79014c6f7af1f4e70394ce
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Aug 15 11:02:42 2013 -0600

    fix up various *linux*.c files

commit af94545f23744a86d9802fd3d675a0d9c5bca987
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Aug 15 10:40:18 2013 -0600

    use minus_one_ptid in linux-fork.c

commit d10e85f6f1d1dd345e0ca36e81b9177f59f79ebf
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Aug 15 10:36:57 2013 -0600

    fix up inf-ptrace.c

commit 31913f021dc4aa9e2ec2957e659e1e1a8b826f8d
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Aug 15 09:50:38 2013 -0600

    fix thinko in assignment of target id

commit f54a93e2186a49f7d4b9c1ddcd3c524eb9c44d40
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Aug 15 09:40:20 2013 -0600

    use the _target forms in linux-nat.c

commit e1607f100ec66ec76b775bed37817bc0fddaea28
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Aug 15 09:40:14 2013 -0600

    use the _target forms in remote.c

commit 0903fd0f1384f9633ce836a1461c33f6b339e3ab
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Aug 15 09:39:57 2013 -0600

    remove target_stack_id argument and fix up

-----------------------------------------------------------------------

Summary of changes:
 README.archer           |   18 ++++++-----
 gdb/aarch64-linux-nat.c |    2 +-
 gdb/amd64-linux-nat.c   |    4 +-
 gdb/common/ptid.c       |   12 +++++++
 gdb/common/ptid.h       |    3 ++
 gdb/corelow.c           |    6 +--
 gdb/i386-linux-nat.c    |    7 ++--
 gdb/inf-ptrace.c        |   18 ++++++-----
 gdb/inferior.h          |    4 --
 gdb/linux-fork.c        |    4 +-
 gdb/linux-nat.c         |   77 ++++++++++++++++++++++++++++++----------------
 gdb/linux-nat.h         |    3 +-
 gdb/linux-thread-db.c   |    7 ++--
 gdb/remote.c            |   26 +++++++++-------
 gdb/spu-linux-nat.c     |    2 +-
 gdb/target.c            |   23 +++++++++++---
 gdb/target.h            |    4 ++-
 17 files changed, 139 insertions(+), 81 deletions(-)

First 500 lines of diff:
diff --git a/README.archer b/README.archer
index d238400..4740765 100644
--- a/README.archer
+++ b/README.archer
@@ -1,8 +1,6 @@
 A project to make remote.c not have global state, and then to make
 multiple targets possible.
 
-The remote fixes were sent upstream.
-
 See this note for a to-do list for remote.c:
 
     http://sourceware.org/ml/gdb-patches/2013-06/msg00605.html
@@ -12,10 +10,13 @@ TO DO:
 
 we need some kind of to_instantiate so that find_default_run_target
 can work properly
+[ hacked around this a little.  maybe the hack is sufficient ]
 
 fix up target-descriptions.[ch] stuff
 
  - must require target-async to connect to multiple
+   [ patch series pending ]
+
  - it would be nice if at least all targets available on
    a linux host were async-able.
    this may just prevent sim?
@@ -45,15 +46,9 @@ DONE:
   ALL_PSPACES -vs- targets
   e.g., exec_close
 
-fix up remove_target_sections ??
-how will this interact with the BFD-sharing code?
-
 how does breakpoint insertion work?
 
 
-If user makes a new target then tries run, make sure gdb chooses the
-currently-existing native target instead of trying to open a new one.
-
 target to_name stuff should be const
 but needs add_cmd
 
@@ -159,3 +154,10 @@ static struct traceframe_info *traceframe_info;
 
 
 
+================================================================
+
+test this:
+
+If user makes a new target then tries run, make sure gdb chooses the
+currently-existing native target instead of trying to open a new one.
+
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 05fc558..ffd0979 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -410,7 +410,7 @@ aarch64_notify_debug_reg_change (const struct aarch64_debug_reg_state *state,
 				 int is_watchpoint, unsigned int idx)
 {
   struct aarch64_dr_update_callback_param param;
-  ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
+  ptid_t pid_ptid = ptid_build_just_pid (inferior_ptid);
 
   param.is_watchpoint = is_watchpoint;
   param.idx = idx;
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index e1966a3..821b057 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -366,7 +366,7 @@ update_debug_registers_callback (struct lwp_info *lwp, void *arg)
 static void
 amd64_linux_dr_set_control (unsigned long control)
 {
-  ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
+  ptid_t pid_ptid = ptid_build_just_pid (inferior_ptid);
 
   iterate_over_lwps (pid_ptid, update_debug_registers_callback, NULL);
 }
@@ -377,7 +377,7 @@ amd64_linux_dr_set_control (unsigned long control)
 static void
 amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
 {
-  ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
+  ptid_t pid_ptid = ptid_build_just_pid (inferior_ptid);
 
   gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
 
diff --git a/gdb/common/ptid.c b/gdb/common/ptid.c
index b02e3b8..2d6e702 100644
--- a/gdb/common/ptid.c
+++ b/gdb/common/ptid.c
@@ -37,6 +37,18 @@ ptid_build_target (int pid, long lwp, long tid, int target)
   return ptid;
 }
 
+/* See ptid.h.  */
+
+ptid_t
+ptid_build_just_pid (ptid_t old_ptid)
+{
+  ptid_t result = old_ptid;
+
+  result.lwp = 0;
+  result.tid = 0;
+  return result;
+}
+
 /* Create a ptid from just a pid.  */
 
 ptid_t
diff --git a/gdb/common/ptid.h b/gdb/common/ptid.h
index 89c020e..fc0cbe2 100644
--- a/gdb/common/ptid.h
+++ b/gdb/common/ptid.h
@@ -72,6 +72,9 @@ ptid_t ptid_build_target (int pid, long lwp, long tid, int target);
 /* Like ptid_build_target, but use 0 for TARGET.  */
 #define ptid_build(PID, LWP, TID) ptid_build_target ((PID), (LWP), (TID), 0)
 
+/* Given OLD_PTID, create a new PTID that represents just its PID.  */
+ptid_t ptid_build_just_pid (ptid_t old_ptid);
+
 /* Find/Create a ptid from just a pid and target. */
 ptid_t pid_to_ptid_target (int pid, int target);
 
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 11e355a..c65f1f6 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -283,8 +283,7 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
       inf->fake_pid_p = fake_pid_p;
     }
 
-  ptid = ptid_build_target (pid, lwpid, 0,
-			    inferior_target_stack_id (current_inferior ()));
+  ptid = ptid_build_target (pid, lwpid, 0, target_stack_id ());
 
   add_thread (ptid);
 
@@ -428,8 +427,7 @@ core_open (char *filename, int from_tty)
       if (thread == NULL)
 	{
 	  inferior_appeared (current_inferior (), CORELOW_PID);
-	  inferior_ptid = pid_to_ptid_target (CORELOW_PID,
-					      inferior_target_stack_id (current_inferior ()));
+	  inferior_ptid = pid_to_ptid_target (CORELOW_PID, target_stack_id ());
 	  add_thread_silent (inferior_ptid);
 	}
       else
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 85a4dbc..eb3f71b 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -737,7 +737,7 @@ update_debug_registers_callback (struct lwp_info *lwp, void *arg)
 static void
 i386_linux_dr_set_control (unsigned long control)
 {
-  ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
+  ptid_t pid_ptid = ptid_build_just_pid (inferior_ptid);
 
   iterate_over_lwps (pid_ptid, update_debug_registers_callback, NULL);
 }
@@ -748,7 +748,7 @@ i386_linux_dr_set_control (unsigned long control)
 static void
 i386_linux_dr_set_addr (int regnum, CORE_ADDR addr)
 {
-  ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
+  ptid_t pid_ptid = ptid_build_just_pid (inferior_ptid);
 
   gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
 
@@ -928,7 +928,8 @@ i386_linux_resume (struct gdb_target *ops,
 
   if (step)
     {
-      struct regcache *regcache = get_thread_regcache (pid_to_ptid (pid));
+      struct regcache *regcache
+	= get_thread_regcache (pid_to_ptid_target (pid, target_stack_id ()));
       struct gdbarch *gdbarch = get_regcache_arch (regcache);
       enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
       ULONGEST pc;
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index 6987366..de9f556 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -76,7 +76,7 @@ inf_ptrace_follow_fork (struct gdb_target *ops, int follow_child)
 	perror_with_name (("ptrace"));
 
       /* Switch inferior_ptid out of the parent's way.  */
-      inferior_ptid = pid_to_ptid (fpid);
+      inferior_ptid = pid_to_ptid_target (fpid, target_stack_id ());
 
       /* Delete the parent.  */
       detach_inferior (pid);
@@ -143,7 +143,7 @@ inf_ptrace_create_inferior (struct gdb_target *ops,
 
   /* On some targets, there must be some explicit actions taken after
      the inferior has been started up.  */
-  target_post_startup_inferior (pid_to_ptid (pid));
+  target_post_startup_inferior (pid_to_ptid_target (pid, target_stack_id ()));
 }
 
 #ifdef PT_GET_PROCESS_STATE
@@ -236,7 +236,7 @@ inf_ptrace_attach (struct gdb_target *ops, char *args, int from_tty)
   inf = current_inferior ();
   inferior_appeared (inf, pid);
   inf->attach_flag = 1;
-  inferior_ptid = pid_to_ptid (pid);
+  inferior_ptid = pid_to_ptid_target (pid, target_stack_id ());
 
   /* Always add a main thread.  If some target extends the ptrace
      target, it should decorate the ptid later with more info.  */
@@ -429,7 +429,8 @@ inf_ptrace_wait (struct gdb_target *ops,
 	{
 	case PTRACE_FORK:
 	  ourstatus->kind = TARGET_WAITKIND_FORKED;
-	  ourstatus->value.related_pid = pid_to_ptid (pe.pe_other_pid);
+	  ourstatus->value.related_pid
+	    = pid_to_ptid_target (pe.pe_other_pid, target_stack_id ());
 
 	  /* Make sure the other end of the fork is stopped too.  */
 	  fpid = waitpid (pe.pe_other_pid, &status, 0);
@@ -444,17 +445,18 @@ inf_ptrace_wait (struct gdb_target *ops,
 	  gdb_assert (pe.pe_other_pid == pid);
 	  if (fpid == ptid_get_pid (inferior_ptid))
 	    {
-	      ourstatus->value.related_pid = pid_to_ptid (pe.pe_other_pid);
-	      return pid_to_ptid (fpid);
+	      ourstatus->value.related_pid
+		= pid_to_ptid_target (pe.pe_other_pid, target_stack_id ());
+	      return pid_to_ptid_target (fpid, target_stack_id ());
 	    }
 
-	  return pid_to_ptid (pid);
+	  return pid_to_ptid_target (pid, target_stack_id ());
 	}
     }
 #endif
 
   store_waitstatus (ourstatus, status);
-  return pid_to_ptid (pid);
+  return pid_to_ptid_target (pid, target_stack_id ());
 }
 
 /* Attempt a transfer all LEN bytes starting at OFFSET between the
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 07a04db..6a198c9 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -584,10 +584,6 @@ extern struct inferior *find_inferior_id (int num);
 extern struct inferior *
   find_inferior_for_program_space (struct program_space *pspace);
 
-/* Inferior's target stack id.  */
-#define inferior_target_stack_id(INF) \
-  (target_stack_id ((INF)->pspace->target_stack))
-
 /* Inferior iterator function.
 
    Calls a callback function once for each inferior, so long as the
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 4100cb1..07be50d 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -82,7 +82,7 @@ add_fork (pid_t pid)
     }
 
   fp = XZALLOC (struct fork_info);
-  fp->ptid = ptid_build (pid, pid, 0);
+  fp->ptid = ptid_build_target (pid, pid, 0, target_stack_id ());
   fp->num = ++highest_fork_num;
   fp->next = fork_list;
   fork_list = fp;
@@ -196,7 +196,7 @@ fork_id_to_ptid (int num)
   if (fork)
     return fork->ptid;
   else
-    return pid_to_ptid (-1);
+    return minus_one_ptid;
 }
 
 static void
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 2a8f8ee..7eddd48 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -695,7 +695,8 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
 	    }
 
 	  old_chain = save_inferior_ptid ();
-	  inferior_ptid = ptid_build (child_pid, child_pid, 0);
+	  inferior_ptid = ptid_build_target (child_pid, child_pid, 0,
+					     target_stack_id ());
 
 	  child_lp = add_lwp (inferior_ptid);
 	  child_lp->stopped = 1;
@@ -725,7 +726,8 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
 	  old_chain = save_inferior_ptid ();
 	  save_current_program_space ();
 
-	  inferior_ptid = ptid_build (child_pid, child_pid, 0);
+	  inferior_ptid = ptid_build_target (child_pid, child_pid, 0,
+					     target_stack_id ());
 	  add_thread (inferior_ptid);
 	  child_lp = add_lwp (inferior_ptid);
 	  child_lp->stopped = 1;
@@ -787,7 +789,8 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
 	  parent_inf->waiting_for_vfork_done = detach_fork;
 	  parent_inf->pspace->breakpoints_not_allowed = detach_fork;
 
-	  parent_lp = find_lwp_pid (pid_to_ptid (parent_pid));
+	  parent_lp = find_lwp_pid (pid_to_ptid_target (parent_pid,
+							target_stack_id ()));
 	  gdb_assert (linux_supports_tracefork_flag >= 0);
 
 	  if (linux_supports_tracevforkdone (0))
@@ -919,7 +922,8 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
 	 this new thread, before cloning the program space, and
 	 informing the solib layer about this new process.  */
 
-      inferior_ptid = ptid_build (child_pid, child_pid, 0);
+      inferior_ptid = ptid_build_target (child_pid, child_pid, 0,
+					 target_stack_id ());
       add_thread (inferior_ptid);
       child_lp = add_lwp (inferior_ptid);
       child_lp->stopped = 1;
@@ -1833,17 +1837,20 @@ linux_nat_detach (struct gdb_target *ops, char *args, int from_tty)
 
   /* Stop all threads before detaching.  ptrace requires that the
      thread is stopped to sucessfully detach.  */
-  iterate_over_lwps (pid_to_ptid (pid), stop_callback, NULL);
+  iterate_over_lwps (pid_to_ptid_target (pid, target_stack_id ()),
+		     stop_callback, NULL);
   /* ... and wait until all of them have reported back that
      they're no longer running.  */
-  iterate_over_lwps (pid_to_ptid (pid), stop_wait_callback, NULL);
+  iterate_over_lwps (pid_to_ptid_target (pid, target_stack_id ()),
+		     stop_wait_callback, NULL);
 
-  iterate_over_lwps (pid_to_ptid (pid), detach_callback, NULL);
+  iterate_over_lwps (pid_to_ptid_target (pid, target_stack_id ()),
+		     detach_callback, NULL);
 
   /* Only the initial process should be left right now.  */
   gdb_assert (num_lwps (GET_PID (inferior_ptid)) == 1);
 
-  main_lwp = find_lwp_pid (pid_to_ptid (pid));
+  main_lwp = find_lwp_pid (pid_to_ptid_target (pid, target_stack_id ()));
 
   /* Pass on any pending signal for the last LWP.  */
   if ((args == NULL || *args == '\0')
@@ -1908,7 +1915,8 @@ resume_lwp (struct lwp_info *lp, int step, enum gdb_signal signo)
 	  if (linux_nat_prepare_to_resume != NULL)
 	    linux_nat_prepare_to_resume (lp);
 	  linux_ops->to_resume (find_target_ops (linux_ops),
-				pid_to_ptid (GET_LWP (lp->ptid)),
+				pid_to_ptid_target (GET_LWP (lp->ptid),
+						    target_stack_id ()),
 				step, signo);
 	  lp->stopped = 0;
 	  lp->step = step;
@@ -2065,7 +2073,7 @@ linux_nat_resume (struct gdb_target *ops,
     iterate_over_lwps (ptid, linux_nat_resume_callback, NULL);
 
   /* Convert to something the lower layer understands.  */
-  ptid = pid_to_ptid (GET_LWP (lp->ptid));
+  ptid = pid_to_ptid_target (GET_LWP (lp->ptid), target_stack_id ());
 
   if (linux_nat_prepare_to_resume != NULL)
     linux_nat_prepare_to_resume (lp);
@@ -2240,7 +2248,8 @@ linux_handle_syscall_trap (struct lwp_info *lp, int stopping)
   if (linux_nat_prepare_to_resume != NULL)
     linux_nat_prepare_to_resume (lp);
   linux_ops->to_resume (find_target_ops (linux_ops),
-			pid_to_ptid (GET_LWP (lp->ptid)),
+			pid_to_ptid_target (GET_LWP (lp->ptid),
+					    target_stack_id ()),
 			lp->step, GDB_SIGNAL_0);
   return 1;
 }
@@ -2284,7 +2293,8 @@ linux_handle_extended_wait (struct lwp_info *lp, int status,
 			    _("wait returned unexpected status 0x%x"), status);
 	}
 
-      ourstatus->value.related_pid = ptid_build (new_pid, new_pid, 0);
+      ourstatus->value.related_pid = ptid_build_target (new_pid, new_pid, 0,
+							target_stack_id ());
 
       if (event == PTRACE_EVENT_FORK || event == PTRACE_EVENT_VFORK)
 	{
@@ -2304,7 +2314,8 @@ linux_handle_extended_wait (struct lwp_info *lp, int status,
 
 	  /* This won't actually modify the breakpoint list, but will
 	     physically remove the breakpoints from the child.  */
-	  detach_breakpoints (ptid_build (new_pid, new_pid, 0));
+	  detach_breakpoints (ptid_build_target (new_pid, new_pid, 0,
+						 target_stack_id ()));
 
 	  /* Retain child fork in ptrace (stopped) state.  */
 	  if (!find_fork_pid (new_pid))
@@ -2438,7 +2449,8 @@ linux_handle_extended_wait (struct lwp_info *lp, int status,
 		  if (linux_nat_prepare_to_resume != NULL)
 		    linux_nat_prepare_to_resume (new_lp);
 		  linux_ops->to_resume (find_target_ops (linux_ops),
-					pid_to_ptid (new_pid),
+					pid_to_ptid_target (new_pid,
+							    target_stack_id ()),
 					0, GDB_SIGNAL_0);
 		  new_lp->stopped = 0;
 		}
@@ -2450,7 +2462,8 @@ linux_handle_extended_wait (struct lwp_info *lp, int status,
 	  if (linux_nat_prepare_to_resume != NULL)
 	    linux_nat_prepare_to_resume (lp);
 	  linux_ops->to_resume (find_target_ops (linux_ops),
-				pid_to_ptid (GET_LWP (lp->ptid)),
+				pid_to_ptid_target (GET_LWP (lp->ptid),
+						    target_stack_id ()),
 				0, GDB_SIGNAL_0);
 
 	  return 1;
@@ -3186,7 +3199,7 @@ linux_nat_filter_event (int lwpid, int status, int *new_pending_p)
 
   *new_pending_p = 0;
 
-  lp = find_lwp_pid (pid_to_ptid (lwpid));
+  lp = find_lwp_pid (pid_to_ptid_target (lwpid, target_stack_id ()));
 
   /* Check for stop events reported by a process we didn't already
      know about - anything not already in our LWP list.
@@ -3272,7 +3285,8 @@ linux_nat_filter_event (int lwpid, int status, int *new_pending_p)
       if (GET_PID (lp->ptid) == GET_LWP (lp->ptid))
 	{
 	  lp->stopped = 1;
-	  iterate_over_lwps (pid_to_ptid (GET_PID (lp->ptid)),
+	  iterate_over_lwps (pid_to_ptid_target (GET_PID (lp->ptid),
+						 target_stack_id ()),
 			     stop_and_resume_callback, new_pending_p);
 	}
 
@@ -3297,7 +3311,8 @@ linux_nat_filter_event (int lwpid, int status, int *new_pending_p)
      stopped.  A similar check is made in stop_wait_callback().  */
   if (num_lwps (GET_PID (lp->ptid)) > 1 && !linux_thread_alive (lp->ptid))
     {
-      ptid_t ptid = pid_to_ptid (GET_PID (lp->ptid));
+      ptid_t ptid = pid_to_ptid_target (GET_PID (lp->ptid),
+					target_stack_id ());
 
       if (debug_linux_nat)
 	fprintf_unfiltered (gdb_stdlog,
@@ -3334,7 +3349,8 @@ linux_nat_filter_event (int lwpid, int status, int *new_pending_p)
 	  if (linux_nat_prepare_to_resume != NULL)
 	    linux_nat_prepare_to_resume (lp);
 	  linux_ops->to_resume (find_target_ops (linux_ops),
-				pid_to_ptid (GET_LWP (lp->ptid)),
+				pid_to_ptid_target (GET_LWP (lp->ptid),
+						    target_stack_id ()),
 				lp->step, GDB_SIGNAL_0);
 	  if (debug_linux_nat)
 	    fprintf_unfiltered (gdb_stdlog,
@@ -3368,7 +3384,8 @@ linux_nat_filter_event (int lwpid, int status, int *new_pending_p)
       if (linux_nat_prepare_to_resume != NULL)
 	linux_nat_prepare_to_resume (lp);
       linux_ops->to_resume (find_target_ops (linux_ops),
-			    pid_to_ptid (GET_LWP (lp->ptid)),
+			    pid_to_ptid_target (GET_LWP (lp->ptid),
+						target_stack_id ()),
 			    lp->step, GDB_SIGNAL_0);
       if (debug_linux_nat)
 	fprintf_unfiltered (gdb_stdlog,
@@ -3405,7 +3422,8 @@ check_zombie_leaders (void)
       if (inf->pid == 0)
 	continue;
 
-      leader_lp = find_lwp_pid (pid_to_ptid (inf->pid));
+      leader_lp = find_lwp_pid (pid_to_ptid_target (inf->pid,
+						    target_stack_id ()));
       if (leader_lp != NULL
 	  /* Check if there are other threads in the group, as we may
 	     have raced with the inferior simply exiting.  */
@@ -3748,7 +3766,8 @@ retry:
 	  if (linux_nat_prepare_to_resume != NULL)
 	    linux_nat_prepare_to_resume (lp);
 	  linux_ops->to_resume (find_target_ops (linux_ops),
-				pid_to_ptid (GET_LWP (lp->ptid)),
+				pid_to_ptid_target (GET_LWP (lp->ptid),
+						    target_stack_id ()),
 				lp->step, signo);
 	  if (debug_linux_nat)
 	    fprintf_unfiltered (gdb_stdlog,
@@ -3775,7 +3794,8 @@ retry:
 		 will receive it - unless they're using CLONE_THREAD to
 		 share signals.  Since we only want to report it once, we
 		 mark it as ignored for all LWPs except this one.  */
-	      iterate_over_lwps (pid_to_ptid (ptid_get_pid (ptid)),
+	      iterate_over_lwps (pid_to_ptid_target (ptid_get_pid (ptid),
+						     target_stack_id ()),
 					      set_ignore_sigint, NULL);
 	      lp->ignore_sigint = 0;
 	    }


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-08-16 21:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-16 21:42 [SCM] tromey/multi-target: notes update tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).