aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2005-04-23 15:40:54 +0000
committerMark Kettenis <kettenis@gnu.org>2005-04-23 15:40:54 +0000
commit02a71ae8069b06a76c10995cc07b883f08844287 (patch)
tree34d849be9a0a29b696182cd7e45783311713c597 /gdb
parent3a305d25c62ba6de2712d1ffe9332300392cef28 (diff)
downloadgdb-02a71ae8069b06a76c10995cc07b883f08844287.zip
gdb-02a71ae8069b06a76c10995cc07b883f08844287.tar.gz
gdb-02a71ae8069b06a76c10995cc07b883f08844287.tar.bz2
* sparc64-tdep.c: Include "dwarf2-frame.h".
(sparc64_dwarf2_frame_init_reg): New function. * Makefile.in (sparc64-tdep.o): Update dependencies.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/sparc64-tdep.c32
2 files changed, 38 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d98ad0f..e1e466e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-23 Mark Kettenis <kettenis@gnu.org>
+
+ * sparc64-tdep.c: Include "dwarf2-frame.h".
+ (sparc64_dwarf2_frame_init_reg): New function.
+ * Makefile.in (sparc64-tdep.o): Update dependencies.
+
2005-04-22 David S. Miller <davem@davemloft.net>
* sparc64-linux-tdep.c (sparc64_linux_init_abi): Add call to
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 6038ceb..0dc85af 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -21,6 +21,7 @@
#include "defs.h"
#include "arch-utils.h"
+#include "dwarf2-frame.h"
#include "floatformat.h"
#include "frame.h"
#include "frame-base.h"
@@ -1103,6 +1104,32 @@ sparc64_return_value (struct gdbarch *gdbarch, struct type *type,
}
+static void
+sparc64_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
+ struct dwarf2_frame_state_reg *reg)
+{
+ switch (regnum)
+ {
+ case SPARC_G0_REGNUM:
+ /* Since %g0 is always zero, there is no point in saving it, and
+ people will be inclined omit it from the CFI. Make sure we
+ don't warn about that. */
+ reg->how = DWARF2_FRAME_REG_SAME_VALUE;
+ break;
+ case SPARC_SP_REGNUM:
+ reg->how = DWARF2_FRAME_REG_CFA;
+ break;
+ case SPARC64_PC_REGNUM:
+ reg->how = DWARF2_FRAME_REG_RA_OFFSET;
+ reg->loc.offset = 8;
+ break;
+ case SPARC64_NPC_REGNUM:
+ reg->how = DWARF2_FRAME_REG_RA_OFFSET;
+ reg->loc.offset = 12;
+ break;
+ }
+}
+
void
sparc64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -1137,6 +1164,11 @@ sparc64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_skip_prologue (gdbarch, sparc64_skip_prologue);
+ /* Hook in the DWARF CFI frame unwinder. */
+ dwarf2_frame_set_init_reg (gdbarch, sparc64_dwarf2_frame_init_reg);
+ /* FIXME: kettenis/20050423: Don't enable the unwinder until the
+ StackGhost issues have been resolved. */
+
frame_unwind_append_sniffer (gdbarch, sparc64_frame_sniffer);
frame_base_set_default (gdbarch, &sparc64_frame_base);
}