This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Use DWARF2 CFI unwinder on OpenBSD/hppa
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sourceware dot org
- Date: Thu, 25 Jul 2013 14:05:11 +0200 (CEST)
- Subject: [PATCH] Use DWARF2 CFI unwinder on OpenBSD/hppa
These days it's a clear win. Perhaps the same should be done on
Linux. Committed.
2013-07-25 Mark Kettenis <kettenis@gnu.org>
* hppabsd-tdep.c: Include "dwarf2-frame.h".
(hppabsd_dwarf2_frame_init_reg): New function.
(hppabsd_init_abi): Hook in the DWARF CFI frame unwinder.
Index: hppabsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppabsd-tdep.c,v
retrieving revision 1.22
diff -u -p -r1.22 hppabsd-tdep.c
--- hppabsd-tdep.c 24 Jun 2013 22:18:31 -0000 1.22
+++ hppabsd-tdep.c 25 Jul 2013 12:01:03 -0000
@@ -26,6 +26,7 @@
#include "hppa-tdep.h"
#include "hppabsd-tdep.h"
+#include "dwarf2-frame.h"
#include "solib-svr4.h"
static CORE_ADDR
@@ -104,6 +105,17 @@ hppabsd_find_global_pointer (struct gdba
}
+static void
+hppabsd_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
+ struct dwarf2_frame_state_reg *reg,
+ struct frame_info *this_frame)
+{
+ if (regnum == HPPA_PCOQ_HEAD_REGNUM)
+ reg->how = DWARF2_FRAME_REG_RA;
+ else if (regnum == HPPA_SP_REGNUM)
+ reg->how = DWARF2_FRAME_REG_CFA;
+}
+
void
hppabsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -122,4 +134,8 @@ hppabsd_init_abi (struct gdbarch_info in
/* OpenBSD and NetBSD use SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
+
+ /* Hook in the DWARF CFI frame unwinder. */
+ dwarf2_frame_set_init_reg (gdbarch, hppabsd_dwarf2_frame_init_reg);
+ dwarf2_append_unwinders (gdbarch);
}