From accc6d1ff368635135fb961397da748a4505008c Mon Sep 17 00:00:00 2001 From: Jason Thorpe Date: Fri, 26 Apr 2002 01:08:19 +0000 Subject: * alpha-tdep.h (gdbarch_tdep): Add jb_pc and jb_elt_size members. * alpha-linux-tdep.c (alpha_linux_init_abi): Initialize tdep->jb_pc and tdep->jb_elt_size. * alpha-osf1-tdep.c (alpha_osf1_init_abi): Likewise. * alphafbsd-tdep.c (alphafbsd_init_abi): Likewise. * alphanbsd-tdep.c (alphanbsd_init_abi): Likewise. * alpha-nat.c (get_longjmp_target): Remove. (JB_ELEMENT_SIZE): Ditto. (JB_PC): Ditto. * alpha-tdep.c (alpha_get_longjmp_target): New function. (alpha_gdbarch_init): Default tdep->jb_pc to -1. If the OS ABI sets jb_pc to a valid value, set gdbarch_get_longjmp_target to alpha_get_longjmp_target. (alpha_dump_tdep): Report tdep->jb_pc and tdep->jb_elt_size. * config/alpha/nm-linux.h (GET_LONGJMP_TARGET): Remove. * config/alpha/nm-osf.h (GET_LONGJMP_TARGET): Remove. --- gdb/alpha-nat.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'gdb/alpha-nat.c') diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c index a21346b..580dcc0 100644 --- a/gdb/alpha-nat.c +++ b/gdb/alpha-nat.c @@ -41,40 +41,6 @@ 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 , 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[ALPHA_MAX_REGISTER_RAW_SIZE]; - - jb_addr = read_register (ALPHA_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. -- cgit v1.1