2002-05-15 Nick Clifton <nickc@cambridge.redhat.com>
[deliverable/binutils-gdb.git] / gdb / alpha-nat.c
index f7e565b3003a8643f7aa4128676e17834f8cf400..580dcc0e8091e289bb8839bf9911efcc27aee37d 100644 (file)
@@ -24,6 +24,9 @@
 #include "gdbcore.h"
 #include "target.h"
 #include "regcache.h"
+
+#include "alpha-tdep.h"
+
 #include <sys/ptrace.h>
 #ifdef __linux__
 #include <asm/reg.h>
 static void fetch_osf_core_registers (char *, unsigned, int, CORE_ADDR);
 static void fetch_elf_core_registers (char *, unsigned, int, CORE_ADDR);
 
-/* Size of elements in jmpbuf */
-
-#define JB_ELEMENT_SIZE 8
-
-/* The definition for JB_PC in machine/reg.h is wrong.
-   And we can't get at the correct definition in setjmp.h as it is
-   not always available (eg. if _POSIX_SOURCE is defined which is the
-   default). As the defintion is unlikely to change (see comment
-   in <setjmp.h>, define the correct value here.  */
-
-#undef JB_PC
-#define JB_PC 2
-
-/* Figure out where the longjmp will land.
-   We expect the first arg to be a pointer to the jmp_buf structure from which
-   we extract the pc (JB_PC) that we will land at.  The pc is copied into PC.
-   This routine returns true on success. */
-
-int
-get_longjmp_target (CORE_ADDR *pc)
-{
-  CORE_ADDR jb_addr;
-  char raw_buffer[MAX_REGISTER_RAW_SIZE];
-
-  jb_addr = read_register (A0_REGNUM);
-
-  if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, raw_buffer,
-                         sizeof (CORE_ADDR)))
-    return 0;
-
-  *pc = extract_address (raw_buffer, sizeof (CORE_ADDR));
-  return 1;
-}
-
 /* Extract the register values out of the core file and store
    them where `read_register' will find them.
 
@@ -98,7 +67,7 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size,
      OSF/1.2 core files.  OSF5 uses different names for the register
      enum list, need to handle two cases.  The actual values are the
      same.  */
-  static int core_reg_mapping[NUM_REGS] =
+  static int core_reg_mapping[ALPHA_NUM_REGS] =
   {
 #ifdef NCF_REGS
 #define EFL NCF_REGS
@@ -124,7 +93,7 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size,
     EF_PC, -1
 #endif
   };
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+  static char zerobuf[ALPHA_MAX_REGISTER_RAW_SIZE] =
   {0};
 
   for (regno = 0; regno < NUM_REGS; regno++)
@@ -171,10 +140,11 @@ fetch_elf_core_registers (char *core_reg_sect, unsigned core_reg_size,
   else
     {
       /* The General Registers.  */
-      memcpy (&registers[REGISTER_BYTE (V0_REGNUM)], core_reg_sect, 31 * 8);
+      memcpy (&registers[REGISTER_BYTE (ALPHA_V0_REGNUM)], core_reg_sect,
+              31 * 8);
       memcpy (&registers[REGISTER_BYTE (PC_REGNUM)], core_reg_sect + 31 * 8, 8);
-      memset (&registers[REGISTER_BYTE (ZERO_REGNUM)], 0, 8);
-      memset (&register_valid[V0_REGNUM], 1, 32);
+      memset (&registers[REGISTER_BYTE (ALPHA_ZERO_REGNUM)], 0, 8);
+      memset (&register_valid[ALPHA_V0_REGNUM], 1, 32);
       register_valid[PC_REGNUM] = 1;
     }
 }
@@ -218,7 +188,7 @@ supply_gregset (gdb_gregset_t *gregsetp)
 {
   register int regi;
   register long *regp = ALPHA_REGSET_BASE (gregsetp);
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+  static char zerobuf[ALPHA_MAX_REGISTER_RAW_SIZE] =
   {0};
 
   for (regi = 0; regi < 31; regi++)
@@ -227,7 +197,7 @@ supply_gregset (gdb_gregset_t *gregsetp)
   supply_register (PC_REGNUM, (char *) (regp + 31));
 
   /* Fill inaccessible registers with zero.  */
-  supply_register (ZERO_REGNUM, zerobuf);
+  supply_register (ALPHA_ZERO_REGNUM, zerobuf);
   supply_register (FP_REGNUM, zerobuf);
 }
 
This page took 0.053656 seconds and 4 git commands to generate.