diff options
author | Mark Kettenis <kettenis@gnu.org> | 2003-07-11 21:49:04 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2003-07-11 21:49:04 +0000 |
commit | 138e7be507e1244fa17077ed394f0bad769ebc5d (patch) | |
tree | 2a3ab4c7f8853a21d8b965e47a94c65b3423b162 /gdb/alphafbsd-tdep.c | |
parent | ba292e4cc03abd0907f051661267af2dd72a2696 (diff) | |
download | gdb-138e7be507e1244fa17077ed394f0bad769ebc5d.zip gdb-138e7be507e1244fa17077ed394f0bad769ebc5d.tar.gz gdb-138e7be507e1244fa17077ed394f0bad769ebc5d.tar.bz2 |
* alpha-tdep.h (struct gdbarch_tdep): Add members `sc_pc_offset',
`sc_regs_offset' and `sc_fpregs_offset'.
* alpha-tdep.c (SIGFRAME_PC_OFF, SIGFRAME_REGSAVE_OFF,
SIGFRAME_FPREGSAVE_OFF): Remove defines.
(alpha_sigtramp_register_address): Rewrite to use new members of
`struct gdbarch_tdep'.
(alpha_gdbarch_init): Initialize new members of struct
gdbarch_tdep'.
* alphafbsd-tdep.c (alphafbsd_use_struct_convention): Use
ALPHA_REGISTER_SIZE instead of DEPRECATED_REGISTER_SIZE.
(alphafbsd_sigtramp_start, alphafbsd_sigtramp_end): Nre variables.
(alphafbsd_pc_in_sigtramp): Implement.
(alphafbsd_sigtramp_offset): New function.
(alphafbsd_sigcontext_addr): New function.
(alphafbsd_init_abi): Initialize signal trampoline related members
of `struct gdbarch_tdep'.
(_initialize_alphafbsd_tdep): Add prototype.
Diffstat (limited to 'gdb/alphafbsd-tdep.c')
-rw-r--r-- | gdb/alphafbsd-tdep.c | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/gdb/alphafbsd-tdep.c b/gdb/alphafbsd-tdep.c index 680e303..d8f4fa0 100644 --- a/gdb/alphafbsd-tdep.c +++ b/gdb/alphafbsd-tdep.c @@ -32,7 +32,7 @@ alphafbsd_use_struct_convention (int gcc_p, struct type *type) /* All aggregate types that won't fit in a register must be returned in memory. */ - if (TYPE_LENGTH (type) > DEPRECATED_REGISTER_SIZE) + if (TYPE_LENGTH (type) > ALPHA_REGISTER_SIZE) return 1; /* The only aggregate types that can be returned in a register are @@ -54,14 +54,41 @@ alphafbsd_use_struct_convention (int gcc_p, struct type *type) return 0; } + + +/* Support for signal handlers. */ + +/* Return whether PC is in a BSD sigtramp routine. */ + +CORE_ADDR alphafbsd_sigtramp_start = 0x11ffff68; +CORE_ADDR alphafbsd_sigtramp_end = 0x11ffffe0; static int alphafbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name) { - /* FIXME */ - return 0; + return (pc >= alphafbsd_sigtramp_start && pc < alphafbsd_sigtramp_end); } +static LONGEST +alphafbsd_sigtramp_offset (CORE_ADDR pc) +{ + return pc - alphafbsd_sigtramp_start; +} + +/* Assuming NEXT_FRAME is for a frame following a BSD sigtramp + routine, return the address of the associated sigcontext structure. */ + +static CORE_ADDR +alphafbsd_sigcontext_addr (struct frame_info *next_frame) +{ + ULONGEST sp; + + frame_unwind_unsigned_register (next_frame, ALPHA_SP_REGNUM, &sp); + return sp + 24; +} + +/* FreeBSD 5.0-RELEASE or later. */ + static void alphafbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -74,13 +101,23 @@ alphafbsd_init_abi (struct gdbarch_info info, /* Hook into the MDEBUG frame unwinder. */ alpha_mdebug_init_abi (info, gdbarch); + set_gdbarch_use_struct_convention (gdbarch, alphafbsd_use_struct_convention); + set_gdbarch_pc_in_sigtramp (gdbarch, alphafbsd_pc_in_sigtramp); - set_gdbarch_use_struct_convention (gdbarch, alphafbsd_use_struct_convention); + tdep->dynamic_sigtramp_offset = alphafbsd_sigtramp_offset; + tdep->sigcontext_addr = alphafbsd_sigcontext_addr; + tdep->sc_pc_offset = 288; + tdep->sc_regs_offset = 24; + tdep->sc_fpregs_offset = 320; tdep->jb_pc = 2; tdep->jb_elt_size = 8; } + + +/* Provide a prototype to silence -Wmissing-prototypes. */ +void _initialize_alphafbsd_tdep (void); void _initialize_alphafbsd_tdep (void) |