* gdb.base/constvars.exp: Check for different orders of keywords
[deliverable/binutils-gdb.git] / gdb / arm-linux-nat.c
index 7c8e04b18858d309d80a9fdc66f1d335d27dd547..50368b7adc2fab6f9190ba26628a7463272dbbd1 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU/Linux on ARM native support.
-   Copyright 1999, 2000 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,6 +22,7 @@
 #include "inferior.h"
 #include "gdbcore.h"
 #include "gdb_string.h"
+#include "regcache.h"
 
 #include <sys/user.h>
 #include <sys/ptrace.h>
@@ -77,24 +78,19 @@ static unsigned int os_version, os_major, os_minor, os_release;
 
 /* On Linux, threads are implemented as pseudo-processes, in which
    case we may be tracing more than one process at a time.  In that
-   case, inferior_pid will contain the main process ID and the
-   individual thread (process) ID mashed together.  These macros are
-   used to separate them out.  These definitions should be overridden
-   if thread support is included.  */
-
-#if !defined (PIDGET)  /* Default definition for PIDGET/TIDGET.  */
-#define PIDGET(PID)    PID
-#define TIDGET(PID)    0
-#endif
+   case, inferior_ptid will contain the main process ID and the
+   individual thread (process) ID.  get_thread_id () is used to
+   get the thread id if it's available, and the process id otherwise. */
 
 int
-get_thread_id (int inferior_pid)
+get_thread_id (ptid_t ptid)
 {
-  int tid = TIDGET (inferior_pid);
-  if (0 == tid) tid = inferior_pid;
+  int tid = TIDGET (ptid);
+  if (0 == tid)
+    tid = PIDGET (ptid);
   return tid;
 }
-#define GET_THREAD_ID(PID)     get_thread_id ((PID));
+#define GET_THREAD_ID(PTID)    get_thread_id ((PTID));
 
 static void
 fetch_nwfpe_single (unsigned int fn, FPA11 * fpa11)
@@ -229,7 +225,7 @@ fetch_fpregister (int regno)
   FPA11 fp;
   
   /* Get the thread id for the ptrace call.  */
-  tid = GET_THREAD_ID (inferior_pid);
+  tid = GET_THREAD_ID (inferior_ptid);
 
   /* Read the floating point state.  */
   ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
@@ -278,7 +274,7 @@ fetch_fpregs (void)
   FPA11 fp;
 
   /* Get the thread id for the ptrace call.  */
-  tid = GET_THREAD_ID (inferior_pid);
+  tid = GET_THREAD_ID (inferior_ptid);
   
   /* Read the floating point state.  */
   ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
@@ -326,7 +322,7 @@ store_fpregister (int regno)
   FPA11 fp;
 
   /* Get the thread id for the ptrace call.  */
-  tid = GET_THREAD_ID (inferior_pid);
+  tid = GET_THREAD_ID (inferior_ptid);
   
   /* Read the floating point state.  */
   ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
@@ -364,7 +360,7 @@ store_fpregs (void)
   FPA11 fp;
 
   /* Get the thread id for the ptrace call.  */
-  tid = GET_THREAD_ID (inferior_pid);
+  tid = GET_THREAD_ID (inferior_ptid);
   
   /* Read the floating point state.  */
   ret = ptrace (PT_GETFPREGS, tid, 0, &fp);
@@ -402,7 +398,7 @@ fetch_register (int regno)
   struct pt_regs regs;
 
   /* Get the thread id for the ptrace call.  */
-  tid = GET_THREAD_ID (inferior_pid);
+  tid = GET_THREAD_ID (inferior_ptid);
   
   ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
   if (ret < 0)
@@ -439,7 +435,7 @@ fetch_regs (void)
   struct pt_regs regs;
 
   /* Get the thread id for the ptrace call.  */
-  tid = GET_THREAD_ID (inferior_pid);
+  tid = GET_THREAD_ID (inferior_ptid);
   
   ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
   if (ret < 0)
@@ -473,7 +469,7 @@ store_register (int regno)
     return;
 
   /* Get the thread id for the ptrace call.  */
-  tid = GET_THREAD_ID (inferior_pid);
+  tid = GET_THREAD_ID (inferior_ptid);
   
   /* Get the general registers from the process.  */
   ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
@@ -501,7 +497,7 @@ store_regs (void)
   struct pt_regs regs;
 
   /* Get the thread id for the ptrace call.  */
-  tid = GET_THREAD_ID (inferior_pid);
+  tid = GET_THREAD_ID (inferior_ptid);
   
   /* Fetch the general registers.  */
   ret = ptrace (PTRACE_GETREGS, tid, 0, &regs);
@@ -575,7 +571,7 @@ store_inferior_registers (int regno)
    If regno is -1, do this for all registers.  */
 
 void
-fill_gregset (gregset_t *gregsetp, int regno)
+fill_gregset (gdb_gregset_t *gregsetp, int regno)
 {
   if (-1 == regno)
     {
@@ -607,7 +603,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
    in *gregsetp.  */
 
 void
-supply_gregset (gregset_t *gregsetp)
+supply_gregset (gdb_gregset_t *gregsetp)
 {
   int regno, reg_pc;
 
@@ -628,7 +624,7 @@ supply_gregset (gregset_t *gregsetp)
    If regno is -1, do this for all registers.  */
 
 void
-fill_fpregset (fpregset_t *fpregsetp, int regno)
+fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
 {
   FPA11 *fp = (FPA11 *) fpregsetp;
   
@@ -654,7 +650,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
    in *fpregsetp.  */
 
 void
-supply_fpregset (fpregset_t *fpregsetp)
+supply_fpregset (gdb_fpregset_t *fpregsetp)
 {
   int regno;
   FPA11 *fp = (FPA11 *) fpregsetp;
This page took 0.025417 seconds and 4 git commands to generate.