* alpha-tdep.c (alpha_sigcontext_addr): New function.
(alpha_find_saved_regs): Use alpha_sigcontext_addr.
(alpha_gdbarch_init): Initialize tdep->sigcontext_addr.
* alpha-linux-tdep.c: Include frame.h.
(alpha_linux_sigcontext_addr): New function.
(alpha_linux_init_abi): Set tdep->sigcontext_addr to
alpha_linux_sigcontext_addr.
* alpha-osf1-tdep.c: Include gdbcore.h.
(alpha_osf1_sigcontext_addr): New function.
(alpha_osf1_init_abi): Set tdep->sigcontext_addr to
alpha_osf1_sigcontext_addr.
* config/alpha/tm-alpha.h (SIGCONTEXT_ADDR): Remove.
* config/alpha/tm-alphalinux.h (SIGCONTEXT_ADDR): Remove.
+2002-04-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.h (gdbarch_tdep): Add sigcontext_addr member.
+ * alpha-tdep.c (alpha_sigcontext_addr): New function.
+ (alpha_find_saved_regs): Use alpha_sigcontext_addr.
+ (alpha_gdbarch_init): Initialize tdep->sigcontext_addr.
+ * alpha-linux-tdep.c: Include frame.h.
+ (alpha_linux_sigcontext_addr): New function.
+ (alpha_linux_init_abi): Set tdep->sigcontext_addr to
+ alpha_linux_sigcontext_addr.
+ * alpha-osf1-tdep.c: Include gdbcore.h.
+ (alpha_osf1_sigcontext_addr): New function.
+ (alpha_osf1_init_abi): Set tdep->sigcontext_addr to
+ alpha_osf1_sigcontext_addr.
+ * config/alpha/tm-alpha.h (SIGCONTEXT_ADDR): Remove.
+ * config/alpha/tm-alphalinux.h (SIGCONTEXT_ADDR): Remove.
+
2002-04-26 Andrew Cagney <ac131313@redhat.com>
* stack.c (selected_frame_level):
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "frame.h"
#include "gdbcore.h"
#include "value.h"
return (alpha_linux_sigtramp_offset (pc) >= 0);
}
+static CORE_ADDR
+alpha_linux_sigcontext_addr (struct frame_info *frame)
+{
+ return (frame->frame - 0x298); /* sizeof(struct sigcontext) */
+}
+
static void
alpha_linux_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
set_gdbarch_pc_in_sigtramp (gdbarch, alpha_linux_pc_in_sigtramp);
tdep->dynamic_sigtramp_offset = alpha_linux_sigtramp_offset;
+ tdep->sigcontext_addr = alpha_linux_sigcontext_addr;
tdep->jb_pc = 2;
tdep->jb_elt_size = 8;
#include "defs.h"
#include "frame.h"
+#include "gdbcore.h"
#include "value.h"
#include "alpha-tdep.h"
return (func_name != NULL && STREQ ("__sigtramp", func_name));
}
+static CORE_ADDR
+alpha_osf1_sigcontext_addr (struct frame_info *frame)
+{
+ return (read_memory_integer (frame->next ? frame->next->frame
+ : frame->frame, 8));
+}
+
static void
alpha_osf1_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp);
tdep->skip_sigtramp_frame = alpha_osf1_skip_sigtramp_frame;
+ tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
tdep->jb_pc = 2;
tdep->jb_elt_size = 8;
}
\f
+static CORE_ADDR
+alpha_sigcontext_addr (struct frame_info *fi)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (tdep->sigcontext_addr)
+ return (tdep->sigcontext_addr (fi));
+
+ return (0);
+}
+
/* Guaranteed to set frame->saved_regs to some values (it never leaves it
NULL). */
{
CORE_ADDR sigcontext_addr;
- sigcontext_addr = SIGCONTEXT_ADDR (frame);
+ sigcontext_addr = alpha_sigcontext_addr (frame);
+ if (sigcontext_addr == 0)
+ {
+ /* Don't know where the sigcontext is; just bail. */
+ return;
+ }
for (ireg = 0; ireg < 32; ireg++)
{
reg_position = sigcontext_addr + SIGFRAME_REGSAVE_OFF + ireg * 8;
tdep->dynamic_sigtramp_offset = NULL;
tdep->skip_sigtramp_frame = NULL;
+ tdep->sigcontext_addr = NULL;
tdep->jb_pc = -1; /* longjmp support not enabled by default */
frame. */
CORE_ADDR (*skip_sigtramp_frame) (struct frame_info *, CORE_ADDR);
+ /* Translate a signal handler frame into the address of the sigcontext
+ structure for that signal handler. */
+ CORE_ADDR (*sigcontext_addr) (struct frame_info *);
+
int jb_pc; /* Offset to PC value in jump buffer.
If htis is negative, longjmp support
will be disabled. */
alpha_setup_arbitrary_frame (argc, argv)
extern struct frame_info *alpha_setup_arbitrary_frame (int, CORE_ADDR *);
-/* Translate a signal handler frame into the address of the sigcontext
- structure. */
-
-#define SIGCONTEXT_ADDR(frame) \
- (read_memory_integer ((frame)->next ? frame->next->frame : frame->frame, 8))
-
#endif /* TM_ALPHA_H */
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 2
-/* Translate a signal handler frame into the address of the sigcontext
- structure. */
-
-#undef SIGCONTEXT_ADDR
-#define SIGCONTEXT_ADDR(frame) ((frame)->frame - 0x298)
-
#include "tm-linux.h"
#endif /* TM_LINUXALPHA_H */