aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1992-09-11 09:08:28 +0000
committerJohn Gilmore <gnu@cygnus>1992-09-11 09:08:28 +0000
commiteb54a95a02cd1b0e1a7d96cfb7580c68551b976b (patch)
tree61be1e6ef77082dccae1774e4fd45aed8bd86401 /gdb
parent0012a471aebef72a7402a50d3a10b2ccebc64f65 (diff)
downloadgdb-eb54a95a02cd1b0e1a7d96cfb7580c68551b976b.zip
gdb-eb54a95a02cd1b0e1a7d96cfb7580c68551b976b.tar.gz
gdb-eb54a95a02cd1b0e1a7d96cfb7580c68551b976b.tar.bz2
* mips-xdep.c (REGISTER_PTRACE_ADDR, fetch_inferior_registers,
store_inferior_registers): Replace unexplained numbers with manifest constants from a DECstation header file. * xm-mips.h (KERNEL_U_ADDR): Get from <machine/param.h>. (REGISTER_U_ADDR): Fix up for Ultrix 4.2. * tm-tahoe.h, xm-tahoe.h (KERNEL_U_ADDR): Move macro to xm-tahoe.h. * stack.c (_initialize_stack): "dow" should be a valid abbreviation for "down". Suggested by Richard Stallman.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/mips-xdep.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/gdb/mips-xdep.c b/gdb/mips-xdep.c
index 806d156..6c0e519 100644
--- a/gdb/mips-xdep.c
+++ b/gdb/mips-xdep.c
@@ -63,17 +63,22 @@ store_inferior_registers (regno)
#else
-/* Map gdb internal register number to ptrace address. */
+/* DECstation native... */
+
+#include <sys/ptrace.h>
+
+/* Map gdb internal register number to ptrace ``address''.
+ These ``addresses'' are defined in DECstation <sys/ptrace.h> */
#define REGISTER_PTRACE_ADDR(regno) \
- (regno < 32 ? regno \
- : regno == PC_REGNUM ? 96 \
- : regno == CAUSE_REGNUM ? 97 \
- : regno == HI_REGNUM ? 98 \
- : regno == LO_REGNUM ? 99 \
- : regno == FCRCS_REGNUM ? 100 \
- : regno == FCRIR_REGNUM ? 101 \
- : regno >= FP0_REGNUM ? regno - (FP0_REGNUM-32)\
+ (regno < 32 ? GPR_BASE + regno \
+ : regno == PC_REGNUM ? PC \
+ : regno == CAUSE_REGNUM ? CAUSE \
+ : regno == HI_REGNUM ? MMHI \
+ : regno == LO_REGNUM ? MMLO \
+ : regno == FCRCS_REGNUM ? FPC_CSR \
+ : regno == FCRIR_REGNUM ? FPC_EIR \
+ : regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) \
: 0)
/* Get all registers from the inferior */
@@ -93,7 +98,7 @@ fetch_inferior_registers (regno)
regaddr = REGISTER_PTRACE_ADDR (regno);
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
{
- *(int *) &buf[i] = ptrace (3, inferior_pid,
+ *(int *) &buf[i] = ptrace (PT_READ_U, inferior_pid,
(PTRACE_ARG3_TYPE) regaddr, 0);
regaddr += sizeof (int);
}
@@ -119,7 +124,7 @@ store_inferior_registers (regno)
{
regaddr = REGISTER_PTRACE_ADDR (regno);
errno = 0;
- ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
+ ptrace (PT_WRITE_U, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
read_register (regno));
if (errno != 0)
{