From 87d1b352c895bc2a690e0aa75df73e4cf0c168b3 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 31 Jan 2003 18:28:25 +0000 Subject: [PATCH] * alpha-nat.c (REGISTER_PTRACE_ADDR): Merge into ... (register_addr): ... here. Support ALPHA_UNIQUE_REGNUM. (fetch_elf_core_registers): Support ALPHA_UNIQUE_REGNUM. * alpha-tdep.c (alpha_register_name): Add "unique". * alpha-tdep.h (ALPHA_NUM_REGS): Increment. (ALPHA_UNIQUE_REGNUM): New. * config/alpha/nm-linux.h (ALPHA_UNIQUE_PTRACE_ADDR): New. --- gdb/ChangeLog | 10 ++++++++++ gdb/alpha-nat.c | 31 +++++++++++++++++++++---------- gdb/alpha-tdep.c | 2 +- gdb/alpha-tdep.h | 3 ++- gdb/config/alpha/nm-linux.h | 7 +++++-- 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a01a894386d..4c225a9cffe 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2003-01-31 Richard Henderson + + * alpha-nat.c (REGISTER_PTRACE_ADDR): Merge into ... + (register_addr): ... here. Support ALPHA_UNIQUE_REGNUM. + (fetch_elf_core_registers): Support ALPHA_UNIQUE_REGNUM. + * alpha-tdep.c (alpha_register_name): Add "unique". + * alpha-tdep.h (ALPHA_NUM_REGS): Increment. + (ALPHA_UNIQUE_REGNUM): New. + * config/alpha/nm-linux.h (ALPHA_UNIQUE_PTRACE_ADDR): New. + 2003-01-31 Andrew Cagney * README: Remove reference to Ericsson 1800 monitor. diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c index f315508ddb0..548869b2fa8 100644 --- a/gdb/alpha-nat.c +++ b/gdb/alpha-nat.c @@ -1,5 +1,5 @@ /* Low level Alpha interface, for GDB when running native. - Copyright 1993, 1995, 1996, 1998, 1999, 2000, 2001 + Copyright 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -149,25 +149,36 @@ fetch_elf_core_registers (char *core_reg_sect, unsigned core_reg_size, memset (&deprecated_registers[REGISTER_BYTE (ALPHA_ZERO_REGNUM)], 0, 8); memset (&deprecated_register_valid[ALPHA_V0_REGNUM], 1, 32); deprecated_register_valid[PC_REGNUM] = 1; + + if (core_reg_size >= 33 * 8) + { + memcpy (&deprecated_registers[REGISTER_BYTE (ALPHA_UNIQUE_REGNUM)], + core_reg_sect + 32 * 8, 8); + deprecated_register_valid[ALPHA_UNIQUE_REGNUM] = 1; + } } } /* Map gdb internal register number to a ptrace ``address''. - These ``addresses'' are defined in */ + These ``addresses'' are defined in , with + the exception of ALPHA_UNIQUE_PTRACE_ADDR. */ -#define REGISTER_PTRACE_ADDR(regno) \ - (regno < FP0_REGNUM ? GPR_BASE + (regno) \ - : regno == PC_REGNUM ? PC \ - : regno >= FP0_REGNUM ? FPR_BASE + ((regno) - FP0_REGNUM) \ - : 0) - -/* Return the ptrace ``address'' of register REGNO. */ +#ifndef ALPHA_UNIQUE_PTRACE_ADDR +#define ALPHA_UNIQUE_PTRACE_ADDR 0 +#endif CORE_ADDR register_addr (int regno, CORE_ADDR blockend) { - return REGISTER_PTRACE_ADDR (regno); + if (regno == PC_REGNUM) + return PC; + if (regno == ALPHA_UNIQUE_REGNUM) + return ALPHA_UNIQUE_PTRACE_ADDR; + if (regno < FP0_REGNUM) + return GPR_BASE + regno; + else + return FPR_BASE + regno - FP0_REGNUM; } int diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 9cca20dab9b..cf5abc84372 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -288,7 +288,7 @@ alpha_register_name (int regno) "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "fpcr", - "pc", "vfp", + "pc", "vfp", "unique", }; if (regno < 0) diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h index 6a75ca7c1a0..76f91f32bf4 100644 --- a/gdb/alpha-tdep.h +++ b/gdb/alpha-tdep.h @@ -28,7 +28,7 @@ #define ALPHA_REGISTER_SIZE 8 /* Number of machine registers. */ -#define ALPHA_NUM_REGS 66 +#define ALPHA_NUM_REGS 67 /* Total amount of space needed to store our copies of the machine's register state. */ @@ -61,6 +61,7 @@ #define ALPHA_FPCR_REGNUM 63 /* Floating point control register */ #define ALPHA_PC_REGNUM 64 /* Contains program counter */ #define ALPHA_FP_REGNUM 65 /* Virtual frame pointer */ +#define ALPHA_UNIQUE_REGNUM 66 /* PAL_rduniq value */ /* The alpha has two different virtual pointers for arguments and locals. diff --git a/gdb/config/alpha/nm-linux.h b/gdb/config/alpha/nm-linux.h index fed32e7930b..9e99b33cd1f 100644 --- a/gdb/config/alpha/nm-linux.h +++ b/gdb/config/alpha/nm-linux.h @@ -1,7 +1,7 @@ /* Native definitions for alpha running GNU/Linux. - Copyright 1993, 1994, 1996, 1998, 2000, 2001, 2002 Free Software - Foundation, Inc. + Copyright 1993, 1994, 1996, 1998, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. This file is part of GDB. @@ -45,4 +45,7 @@ pointer to the first register. */ #define ALPHA_REGSET_BASE(regsetp) ((long *) (regsetp)) +/* The address of UNIQUE for ptrace. */ +#define ALPHA_UNIQUE_PTRACE_ADDR 65 + #endif /* NM_LINUX_H */ -- 2.30.2