diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-08-29 19:17:20 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-08-29 19:17:20 +0000 |
commit | d765c60c860d7e7d6bdf79b620800d3362cb354d (patch) | |
tree | 5188fcf3f6c926d850c463cacee2677e8e7966fc /gnu/usr.bin | |
parent | f4757e2c8d659cbf5e3bf313bc9e954039ec5123 (diff) |
Add DWARF2 CFI unwinder for hppa.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/binutils/gdb/hppa-tdep.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gnu/usr.bin/binutils/gdb/hppa-tdep.c b/gnu/usr.bin/binutils/gdb/hppa-tdep.c index a1da98d37e3..27dde7b731c 100644 --- a/gnu/usr.bin/binutils/gdb/hppa-tdep.c +++ b/gnu/usr.bin/binutils/gdb/hppa-tdep.c @@ -35,6 +35,7 @@ /* For argument passing to the inferior */ #include "symtab.h" #include "dis-asm.h" +#include "dwarf2-frame.h" #include "trad-frame.h" #include "frame-unwind.h" #include "frame-base.h" @@ -2395,6 +2396,16 @@ hppa_frame_prev_register_helper (struct frame_info *next_frame, trad_frame_get_prev_register (next_frame, saved_regs, regnum, optimizedp, lvalp, addrp, realnump, valuep); } + +static void +hppa_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, + struct dwarf2_frame_state_reg *reg) +{ + if (regnum == HPPA_PCOQ_HEAD_REGNUM) + reg->how = DWARF2_FRAME_REG_RA; + else if (regnum == HPPA_SP_REGNUM) + reg->how = DWARF2_FRAME_REG_CFA; +} /* Here is a table of C type sizes on hppa with various compiles @@ -2559,6 +2570,10 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); + /* Hook in the DWARF CFI frame unwinder. */ + dwarf2_frame_set_init_reg (gdbarch, hppa_dwarf2_frame_init_reg); + frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); + /* Hook in the default unwinders. */ frame_unwind_append_sniffer (gdbarch, hppa_stub_unwind_sniffer); frame_unwind_append_sniffer (gdbarch, hppa_frame_unwind_sniffer); |