Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gdb/dist/gdb remove code that assumed that lwp...



details:   https://anonhg.NetBSD.org/src/rev/ca8a99831a0e
branches:  trunk
changeset: 778994:ca8a99831a0e
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Apr 24 19:14:06 2012 +0000

description:
remove code that assumed that lwpid shares pid space and can be used interchangeably.

diffstat:

 external/gpl3/gdb/dist/gdb/sparc-nat.c |  27 +++------------------------
 1 files changed, 3 insertions(+), 24 deletions(-)

diffs (51 lines):

diff -r b3c8c8371935 -r ca8a99831a0e external/gpl3/gdb/dist/gdb/sparc-nat.c
--- a/external/gpl3/gdb/dist/gdb/sparc-nat.c    Tue Apr 24 17:16:42 2012 +0000
+++ b/external/gpl3/gdb/dist/gdb/sparc-nat.c    Tue Apr 24 19:14:06 2012 +0000
@@ -140,22 +140,7 @@
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
   int pid;
 
-  /* NOTE: cagney/2002-12-03: This code assumes that the currently
-     selected light weight processes' registers can be written
-     directly into the selected thread's register cache.  This works
-     fine when given an 1:1 LWP:thread model (such as found on
-     GNU/Linux) but will, likely, have problems when used on an N:1
-     (userland threads) or N:M (userland multiple LWP) model.  In the
-     case of the latter two, the LWP's registers do not necessarily
-     belong to the selected thread (the LWP could be in the middle of
-     executing the thread switch code).
-
-     These functions should instead be paramaterized with an explicit
-     object (struct regcache, struct thread_info?) into which the LWPs
-     registers can be written.  */
-  pid = TIDGET (inferior_ptid);
-  if (pid == 0)
-    pid = PIDGET (inferior_ptid);
+  pid = PIDGET (inferior_ptid);
 
   if (regnum == SPARC_G0_REGNUM)
     {
@@ -193,11 +178,7 @@
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
   int pid;
 
-  /* NOTE: cagney/2002-12-02: See comment in fetch_inferior_registers
-     about threaded assumptions.  */
-  pid = TIDGET (inferior_ptid);
-  if (pid == 0)
-    pid = PIDGET (inferior_ptid);
+  pid = PIDGET (inferior_ptid);
 
   if (regnum == -1 || sparc_gregset_supplies_p (gdbarch, regnum))
     {
@@ -278,9 +259,7 @@
   {
     int pid;
 
-    pid = TIDGET (inferior_ptid);
-    if (pid == 0)
-      pid = PIDGET (inferior_ptid);
+    pid = PIDGET (inferior_ptid);
 
     /* Sanity check.  The proper type for a cookie is register_t, but
        we can't assume that this type exists on all systems supported



Home | Main Index | Thread Index | Old Index