#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.
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
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++)
else
{
/* The General Registers. */
- memcpy (®isters[REGISTER_BYTE (V0_REGNUM)], core_reg_sect, 31 * 8);
+ memcpy (®isters[REGISTER_BYTE (ALPHA_V0_REGNUM)], core_reg_sect,
+ 31 * 8);
memcpy (®isters[REGISTER_BYTE (PC_REGNUM)], core_reg_sect + 31 * 8, 8);
- memset (®isters[REGISTER_BYTE (ZERO_REGNUM)], 0, 8);
- memset (®ister_valid[V0_REGNUM], 1, 32);
+ memset (®isters[REGISTER_BYTE (ALPHA_ZERO_REGNUM)], 0, 8);
+ memset (®ister_valid[ALPHA_V0_REGNUM], 1, 32);
register_valid[PC_REGNUM] = 1;
}
}
{
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++)
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);
}