/* 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.
#include "inferior.h"
#include "gdbcore.h"
#include "gdb_string.h"
+#include "regcache.h"
#include <sys/user.h>
#include <sys/ptrace.h>
/* 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)
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);
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);
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);
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);
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, ®s);
if (ret < 0)
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, ®s);
if (ret < 0)
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, ®s);
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, ®s);
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)
{
in *gregsetp. */
void
-supply_gregset (gregset_t *gregsetp)
+supply_gregset (gdb_gregset_t *gregsetp)
{
int regno, reg_pc;
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;
in *fpregsetp. */
void
-supply_fpregset (fpregset_t *fpregsetp)
+supply_fpregset (gdb_fpregset_t *fpregsetp)
{
int regno;
FPA11 *fp = (FPA11 *) fpregsetp;