aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-06-22 17:14:43 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-06-22 17:14:43 +0000
commit6e3f70d70b1c88fb344b31ec6d3021b97d58302e (patch)
tree8a4dc6ca1bc9449f59c5a3a35e4cd82ec27c77b8
parentdf4b58feaa458de39117c8f78137d26ed9928e29 (diff)
downloadgdb-6e3f70d70b1c88fb344b31ec6d3021b97d58302e.zip
gdb-6e3f70d70b1c88fb344b31ec6d3021b97d58302e.tar.gz
gdb-6e3f70d70b1c88fb344b31ec6d3021b97d58302e.tar.bz2
* spu-tdep.c (spu_get_longjmp_target): New function.
(spu_gdbarch_init): Install it.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/spu-tdep.c21
2 files changed, 26 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0ef577e..6dbd41d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-22 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * spu-tdep.c (spu_get_longjmp_target): New function.
+ (spu_gdbarch_init): Install it.
+
2009-06-22 H.J. Lu <hongjiu.lu@intel.com>
PR server/10306
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index 949b4fd..d7c482b 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -1329,6 +1329,26 @@ spu_software_single_step (struct frame_info *frame)
return 1;
}
+
+/* Longjmp support. */
+
+static int
+spu_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
+{
+ gdb_byte buf[4];
+ CORE_ADDR jb_addr;
+
+ /* Jump buffer is pointed to by the argument register $r3. */
+ get_frame_register_bytes (frame, SPU_ARG1_REGNUM, 0, 4, buf);
+ jb_addr = extract_unsigned_integer (buf, 4);
+ if (target_read_memory (jb_addr, buf, 4))
+ return 0;
+
+ *pc = extract_unsigned_integer (buf, 4);
+ return 1;
+}
+
+
/* Target overlays for the SPU overlay manager.
See the documentation of simple_overlay_update for how the
@@ -2148,6 +2168,7 @@ spu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_breakpoint_from_pc (gdbarch, spu_breakpoint_from_pc);
set_gdbarch_cannot_step_breakpoint (gdbarch, 1);
set_gdbarch_software_single_step (gdbarch, spu_software_single_step);
+ set_gdbarch_get_longjmp_target (gdbarch, spu_get_longjmp_target);
/* Overlays. */
set_gdbarch_overlay_update (gdbarch, spu_overlay_update);