/* Intel 386 native support.
- Copyright (C) 1988, 1989, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
+ 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB.
#include "inferior.h"
#include "language.h"
#include "gdbcore.h"
+#include "regcache.h"
#ifdef USG
#include <sys/types.h>
struct env387 fps_fixed;
int i;
- if (inferior_pid)
+ if (! ptid_equal (inferior_ptid, null_ptid))
{
char buf[10];
unsigned short status;
- ptrace (PT_READ_FPR, inferior_pid, buf, offsetof (struct env387, status));
+ ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf,
+ offsetof (struct env387, status));
memcpy (&status, buf, sizeof (status));
fpsaved = status;
}
return;
}
- if (inferior_pid)
+ if (! ptid_equal (inferior_ptid, null_ptid))
{
int offset;
for (offset = 0; offset < sizeof (fps); offset += 10)
{
char buf[10];
- ptrace (PT_READ_FPR, inferior_pid, buf, offset);
+ ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf, offset);
memcpy ((char *) &fps.control + offset, buf,
MIN (10, sizeof (fps) - offset));
}
{
char buf[MAX_REGISTER_RAW_SIZE];
if (regno < FP0_REGNUM)
- *(int *) buf = ptrace (PT_READ_GPR, inferior_pid,
+ *(int *) buf = ptrace (PT_READ_GPR, PIDGET (inferior_ptid),
PT_REG (regmap[regno]), 0, 0);
else
- ptrace (PT_READ_FPR, inferior_pid, buf,
+ ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf,
(regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs));
supply_register (regno, buf);
}
char buf[80];
errno = 0;
if (regno < FP0_REGNUM)
- ptrace (PT_WRITE_GPR, inferior_pid, PT_REG (regmap[regno]),
+ ptrace (PT_WRITE_GPR, PIDGET (inferior_ptid), PT_REG (regmap[regno]),
*(int *) ®isters[REGISTER_BYTE (regno)], 0);
else
- ptrace (PT_WRITE_FPR, inferior_pid, ®isters[REGISTER_BYTE (regno)],
+ ptrace (PT_WRITE_FPR, PIDGET (inferior_ptid),
+ ®isters[REGISTER_BYTE (regno)],
(regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs));
if (errno != 0)