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] Fix missing backchain in dummy frames on spu


Hello,

spu_push_dummy_call neglected to store the stack back chain into the
dummy frame it allocates.  This violates the SPU ABI, and may cause
problems in some cases.  Fixed by the following patch.

Tested on spu-elf, committed to mainline.

Bye,
Ulrich


ChangeLog:

	* spu-tdep.c (spu_push_dummy_call): Store stack back chain.

diff -urNp gdb-orig/gdb/spu-tdep.c gdb-head/gdb/spu-tdep.c
--- gdb-orig/gdb/spu-tdep.c	2007-06-01 21:16:09.552289469 +0200
+++ gdb-head/gdb/spu-tdep.c	2007-06-01 21:15:56.222081009 +0200
@@ -1013,6 +1013,10 @@ spu_push_dummy_call (struct gdbarch *gdb
   /* Allocate stack frame header.  */
   sp -= 32;
 
+  /* Store stack back chain.  */
+  regcache_cooked_read (regcache, SPU_RAW_SP_REGNUM, buf);
+  target_write_memory (sp, buf, 16);
+
   /* Finally, update the SP register.  */
   regcache_cooked_write_unsigned (regcache, SPU_SP_REGNUM, sp);
 
-- 
  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]