X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Falpha-osf1-tdep.c;h=b5879ad551cdabe02332f05d00142fc0576f8035;hb=d4b6d575691fda534ef98e8eb8f2fe77529f65ed;hp=cba9134b07a297ee6ad2d0d373ce6d85e5d155e4;hpb=6c72f9f97456e7309006148460d9a2aee4088016;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c index cba9134b07..b5879ad551 100644 --- a/gdb/alpha-osf1-tdep.c +++ b/gdb/alpha-osf1-tdep.c @@ -1,5 +1,5 @@ /* Target-dependent code for OSF/1 on Alpha. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -20,27 +20,29 @@ #include "defs.h" #include "frame.h" +#include "gdbcore.h" #include "value.h" +#include "osabi.h" +#include "gdb_string.h" +#include "objfiles.h" #include "alpha-tdep.h" -/* Under OSF/1, the __sigtramp routine is frameless and has a frame - size of zero, but we are able to backtrace through it. */ -static CORE_ADDR -alpha_osf1_skip_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc) +static int +alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name) { - char *name; - - find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL); - if (PC_IN_SIGTRAMP (pc, name)) - return frame->frame; - return 0; + return (func_name != NULL && strcmp ("__sigtramp", func_name) == 0); } -static int -alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name) +static CORE_ADDR +alpha_osf1_sigcontext_addr (struct frame_info *frame) { - return (func_name != NULL && STREQ ("__sigtramp", func_name)); + struct frame_info *next_frame = get_next_frame (frame); + + if (next_frame != NULL) + return (read_memory_integer (get_frame_base (next_frame), 8)); + else + return (read_memory_integer (get_frame_base (frame), 8)); } static void @@ -49,13 +51,24 @@ alpha_osf1_init_abi (struct gdbarch_info info, { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp); + /* Hook into the MDEBUG frame unwinder. */ + alpha_mdebug_init_abi (info, gdbarch); + + /* The next/step support via procfs on OSF1 is broken when running + on multi-processor machines. We need to use software single stepping + instead. */ + set_gdbarch_software_single_step (gdbarch, alpha_software_single_step); + + tdep->sigcontext_addr = alpha_osf1_sigcontext_addr; + tdep->pc_in_sigtramp = alpha_osf1_pc_in_sigtramp; - tdep->skip_sigtramp_frame = alpha_osf1_skip_sigtramp_frame; + tdep->jb_pc = 2; + tdep->jb_elt_size = 8; } void _initialize_alpha_osf1_tdep (void) { - alpha_gdbarch_register_os_abi (ALPHA_ABI_OSF1, alpha_osf1_init_abi); + gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OSF1, + alpha_osf1_init_abi); }