This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Support get_longjmp_target on SPU


Hello,

this fixes failures in the longjmp.exp test cases on SPU by providing
an appropriate get_longjmp_target gdbarch callback.

Tested on spu-elf; committed to mainline.

Bye,
Ulrich


ChangeLog:

	* spu-tdep.c (spu_get_longjmp_target): New function.
	(spu_gdbarch_init): Install it.


Index: gdb/spu-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/spu-tdep.c,v
retrieving revision 1.44
diff -c -p -r1.44 spu-tdep.c
*** gdb/spu-tdep.c	17 Jun 2009 18:50:31 -0000	1.44
--- gdb/spu-tdep.c	22 Jun 2009 17:11:49 -0000
*************** spu_software_single_step (struct frame_i
*** 1329,1334 ****
--- 1329,1354 ----
    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
*************** spu_gdbarch_init (struct gdbarch_info in
*** 2148,2153 ****
--- 2168,2174 ----
    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);
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]