]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Enable Mark Kettenis' linux thread support for Linux/PPC.
authorKevin Buettner <kevinb@redhat.com>
Mon, 18 Sep 2000 01:08:24 +0000 (01:08 +0000)
committerKevin Buettner <kevinb@redhat.com>
Mon, 18 Sep 2000 01:08:24 +0000 (01:08 +0000)
gdb/ChangeLog
gdb/config/powerpc/linux.mh
gdb/config/powerpc/nm-linux.h
gdb/ppc-linux-nat.c

index e9e591cd89682a4cb7dbf8a6f75724f97284d3a5..937a703b4244f079b1fd29339e02e4be5dde40a1 100644 (file)
@@ -1,3 +1,18 @@
+2000-09-17  Kevin Buettner  <kevinb@redhat.com>
+
+       * ppc-linux-nat.c (fill_gregset, fill_fpregset): New functions.
+       * config/powerpc/linux.mh (NATDEPFILES): Remove linux-thread.o.
+       Add proc-service.o, thread-db.o, and lin-lwp.o.
+       (LOADLIBES): Define.
+       * config/powerpc/nm-linux.h (ATTACH_DETACH, SVR4_SHARED_LIBS):
+       Remove defines which are already present in ../nm-linux.h.
+       (solib.h): Don't include this file; it's already included by
+       ../nm-linux.h.
+       (PREPARE_TO_PROCEED, GET_THREAD_SIGNALS, ATTACH_LWP): Define
+       to use the following lin-lwp.c functions...
+       (lin_lwp_prepare_to_proceed, lin_thread_get_thread_signals,
+       lin_lwp_attach_lwp): Declare.
+
 2000-09-17  Kevin Buettner  <kevinb@redhat.com>
 
        * m88k-nat.c (fetch_inferior_registers): Protoize.
index b074e6a40ad711ab13219dbfed8919a154b255a1..3bc9961e35bdebe7eb9f0d979f9ae108dd71eb0d 100644 (file)
@@ -5,6 +5,9 @@ XDEPFILES=
 XM_CLIBS=
 
 NAT_FILE= nm-linux.h
-NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o core-aout.o core-regset.o ppc-linux-nat.o linux-thread.o
+NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o \
+core-aout.o core-regset.o ppc-linux-nat.o proc-service.o thread-db.o lin-lwp.o
+
+LOADLIBES = -ldl -rdynamic
 
 GDBSERVER_DEPFILES= low-linux.o
index 0ef531ce1548b91569f6e3a0eb7799dcc69ab41c..5eac7d383fb9c6963702e36230f5445e45221c7f 100644 (file)
@@ -28,9 +28,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define KERNEL_U_SIZE kernel_u_size()
 extern int kernel_u_size (void);
 
-/* Tell gdb that we can attach and detach other processes */
-#define ATTACH_DETACH
-
 #define U_REGS_OFFSET 0
 
 #define REGISTER_U_ADDR(addr, blockend, regno) \
@@ -40,25 +37,20 @@ extern int kernel_u_size (void);
 
 #define NO_SYS_REG_H
 
-#ifdef HAVE_LINK_H
-#include "solib.h"             /* Support for shared libraries. */
-#define SVR4_SHARED_LIBS
-#endif
-
-/* Support for Linuxthreads. */
-
-#ifdef __STDC__
-struct objfile;
-#endif
+/* FIXME: kettenis/2000-09-03: This should be moved to ../nm-linux.h
+   once we have converted all Linux targets to use the new threads
+   stuff (without the #undef of course).  */
 
-extern void linuxthreads_new_objfile (struct objfile *objfile);
-#define target_new_objfile(OBJFILE) linuxthreads_new_objfile (OBJFILE)
+extern int lin_lwp_prepare_to_proceed (void);
+#undef PREPARE_TO_PROCEED
+#define PREPARE_TO_PROCEED(select_it) lin_lwp_prepare_to_proceed ()
 
-extern char *linuxthreads_pid_to_str (int pid);
-#define target_pid_to_str(PID) linuxthreads_pid_to_str (PID)
+extern void lin_lwp_attach_lwp (int pid, int verbose);
+#define ATTACH_LWP(pid, verbose) lin_lwp_attach_lwp ((pid), (verbose))
 
-extern int linuxthreads_prepare_to_proceed (int step);
-#define PREPARE_TO_PROCEED(select_it) linuxthreads_prepare_to_proceed (1)
+#include <signal.h>
 
+extern void lin_thread_get_thread_signals (sigset_t *mask);
+#define GET_THREAD_SIGNALS(mask) lin_thread_get_thread_signals (mask)
 
 #endif /* #ifndef NM_LINUX_H */
index e37aef9d158f02c0ed3255b6e43b90d6616272ae..7388254aa4c67bbad5309664adb0225e2b97e95e 100644 (file)
@@ -70,6 +70,28 @@ supply_gregset (gregset_t * gregsetp)
     supply_register (regi, (char *) (regp + regmap[regi]));
 }
 
+void
+fill_gregset (gregset_t *gregsetp, int regno)
+{
+  int regi;
+  greg_t *regp = (greg_t *) gregsetp;
+
+#define COPY_REG(_idx_,_regi_) \
+  if ((regno == -1) || regno == _regi_) \
+    memcpy (regp + _idx_, &registers[REGISTER_BYTE (_regi_)], \
+           REGISTER_RAW_SIZE (_regi_))
+
+  for (regi = 0; regi < 32; regi++)
+    {
+      COPY_REG (regmap[regi], regi);
+    }
+
+  for (regi = FIRST_UISA_SP_REGNUM; regi <= LAST_UISA_SP_REGNUM; regi++)
+    {
+      COPY_REG (regmap[regi], regi);
+    }
+}
+
 void
 supply_fpregset (fpregset_t * fpregsetp)
 {
@@ -79,3 +101,26 @@ supply_fpregset (fpregset_t * fpregsetp)
       supply_register (FP0_REGNUM + regi, (char *) (*fpregsetp + regi));
     }
 }
+
+/*  Given a pointer to a floating point register set in /proc format
+   (fpregset_t *), update the register specified by REGNO from gdb's idea
+   of the current floating point register set.  If REGNO is -1, update
+   them all. */
+
+void
+fill_fpregset (fpregset_t *fpregsetp, int regno)
+{
+  int regi;
+  char *to;
+  char *from;
+  
+  for (regi = 0; regi < 32; regi++)
+    {
+      if ((regno == -1) || (regno == FP0_REGNUM + regi))
+        {
+         from = (char *) &registers[REGISTER_BYTE (FP0_REGNUM + regi)];
+         to = (char *) (*fpregsetp + regi);
+         memcpy (to, from, REGISTER_RAW_SIZE (FP0_REGNUM + regi));
+        }
+    }
+}