diff options
author | Richard Henderson <rth@redhat.com> | 2003-01-31 18:28:25 +0000 |
---|---|---|
committer | Richard Henderson <rth@redhat.com> | 2003-01-31 18:28:25 +0000 |
commit | 87d1b352c895bc2a690e0aa75df73e4cf0c168b3 (patch) | |
tree | a8442be8fc4081b028a486f9e28e93306330a2c5 /gdb/alpha-nat.c | |
parent | c48861fb9350162456bb07948643aeca6fa06e90 (diff) | |
download | fsf-binutils-gdb-87d1b352c895bc2a690e0aa75df73e4cf0c168b3.zip fsf-binutils-gdb-87d1b352c895bc2a690e0aa75df73e4cf0c168b3.tar.gz fsf-binutils-gdb-87d1b352c895bc2a690e0aa75df73e4cf0c168b3.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/alpha-nat.c')
-rw-r--r-- | gdb/alpha-nat.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c index f315508..548869b 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 <sys/ptrace.h> */ + These ``addresses'' are defined in <sys/ptrace.h>, 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 |