diff options
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/mips-irix-tdep.c | 40 |
2 files changed, 48 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1462d74..559d07c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2010-11-22 Joel Brobecker <brobecker@adacore.com> + + * mips-irix-tdep.c (mips_irix_n32_stack_tramp_frame_init): New + function. + (mips_irix_n32_stack_tramp_frame): New static global. + (mips_irix_init_abi): Add mips_irix_n32_stack_tramp_frame to + list of unwinder. + 2010-11-22 Jerome Guitton <guitton@adacore.com> * ada-tasks.c (get_tcb_types_info): Use C lookups to get diff --git a/gdb/mips-irix-tdep.c b/gdb/mips-irix-tdep.c index 1965964..1bb6ea0 100644 --- a/gdb/mips-irix-tdep.c +++ b/gdb/mips-irix-tdep.c @@ -227,11 +227,51 @@ static const struct tramp_frame mips_irix_n32_tramp_frame = mips_irix_n32_tramp_frame_init }; +/* Implement the "init" routine in struct tramp_frame for the stack-based + trampolines used on mips-irix. */ + +static void +mips_irix_n32_stack_tramp_frame_init (const struct tramp_frame *self, + struct frame_info *this_frame, + struct trad_frame_cache *this_cache, + CORE_ADDR func) +{ + struct gdbarch *gdbarch = get_frame_arch (this_frame); + const int num_regs = gdbarch_num_regs (gdbarch); + int sp_cooked_regno = num_regs + MIPS_SP_REGNUM; + const CORE_ADDR sp = get_frame_register_signed (this_frame, sp_cooked_regno); + + /* The previous frame's PC is stored in RA. */ + trad_frame_set_reg_realreg (this_cache, gdbarch_pc_regnum (gdbarch), + num_regs + MIPS_RA_REGNUM); + + trad_frame_set_id (this_cache, frame_id_build (sp, func)); +} + +/* A tramp_frame structure describing the stack-based trampoline + used on mips-irix. These trampolines are created on the stack + before being called. */ + +static const struct tramp_frame mips_irix_n32_stack_tramp_frame = +{ + SIGTRAMP_FRAME, + 4, + { + { 0x8f210000, 0xffff0000 }, /* lw at, N(t9) */ + { 0x8f2f0000, 0xffff0000 }, /* lw t3, M(t9) */ + { 0x00200008, 0xffffffff }, /* jr at */ + { 0x0020c82d, 0xffffffff }, /* move t9, at */ + { TRAMP_SENTINEL_INSN, -1 } + }, + mips_irix_n32_stack_tramp_frame_init +}; + static void mips_irix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { set_solib_ops (gdbarch, &irix_so_ops); + tramp_frame_prepend_unwinder (gdbarch, &mips_irix_n32_stack_tramp_frame); tramp_frame_prepend_unwinder (gdbarch, &mips_irix_n32_tramp_frame); } |