Try to fill in ptrace_setregs. Dunno if it's right.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5046 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_debugger.c b/coregrind/m_debugger.c
index 5ead4ce..defcd5a 100644
--- a/coregrind/m_debugger.c
+++ b/coregrind/m_debugger.c
@@ -36,7 +36,6 @@
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
-#include "pub_core_libcassert.h" // I_die_here
#include "pub_core_options.h"
#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
@@ -85,9 +84,48 @@
regs.rip = vex->guest_RIP;
return VG_(ptrace)(VKI_PTRACE_SETREGS, pid, NULL, ®s);
+
#elif defined(VGA_ppc32)
- I_die_here;
- regs.gpr[0] = 0; // stop compiler complaints
+ regs.gpr[ 0] = vex->guest_GPR0;
+ regs.gpr[ 1] = vex->guest_GPR1;
+ regs.gpr[ 2] = vex->guest_GPR2;
+ regs.gpr[ 3] = vex->guest_GPR3;
+ regs.gpr[ 4] = vex->guest_GPR4;
+ regs.gpr[ 5] = vex->guest_GPR5;
+ regs.gpr[ 6] = vex->guest_GPR6;
+ regs.gpr[ 7] = vex->guest_GPR7;
+ regs.gpr[ 8] = vex->guest_GPR8;
+ regs.gpr[ 9] = vex->guest_GPR9;
+ regs.gpr[10] = vex->guest_GPR10;
+ regs.gpr[11] = vex->guest_GPR11;
+ regs.gpr[12] = vex->guest_GPR12;
+ regs.gpr[13] = vex->guest_GPR13;
+ regs.gpr[14] = vex->guest_GPR14;
+ regs.gpr[15] = vex->guest_GPR15;
+ regs.gpr[16] = vex->guest_GPR16;
+ regs.gpr[17] = vex->guest_GPR17;
+ regs.gpr[18] = vex->guest_GPR18;
+ regs.gpr[19] = vex->guest_GPR19;
+ regs.gpr[20] = vex->guest_GPR20;
+ regs.gpr[21] = vex->guest_GPR21;
+ regs.gpr[22] = vex->guest_GPR22;
+ regs.gpr[23] = vex->guest_GPR23;
+ regs.gpr[24] = vex->guest_GPR24;
+ regs.gpr[25] = vex->guest_GPR25;
+ regs.gpr[26] = vex->guest_GPR26;
+ regs.gpr[27] = vex->guest_GPR27;
+ regs.gpr[28] = vex->guest_GPR28;
+ regs.gpr[29] = vex->guest_GPR29;
+ regs.gpr[30] = vex->guest_GPR30;
+ regs.gpr[31] = vex->guest_GPR31;
+ regs.orig_gpr3 = vex->guest_GPR3;
+ regs.ctr = vex->guest_CTR;
+ regs.link = vex->guest_LR;
+ regs.xer = LibVEX_GuestPPC32_get_XER(vex);
+ regs.ccr = LibVEX_GuestPPC32_get_CR(vex);
+ regs.nip = vex->guest_CIA + 4;
+
+ return VG_(ptrace)(VKI_PTRACE_SETREGS, pid, NULL, ®s);
#else
# error Unknown arch
#endif
diff --git a/include/vki-ppc32-linux.h b/include/vki-ppc32-linux.h
index d5ade89..f6edced 100644
--- a/include/vki-ppc32-linux.h
+++ b/include/vki-ppc32-linux.h
@@ -870,16 +870,12 @@
//.. ///* We need to pay attention to this, because it mmaps memory */
//.. //#define VKI_DRM_IOCTL_MAP_BUFS _VKI_IOWR('d', 0x19, struct vki_drm_buf_map)
-//.. //----------------------------------------------------------------------
-//.. // From linux-2.6.9/include/asm-i386/ptrace.h
-//.. //----------------------------------------------------------------------
-//..
-//.. #define VKI_PTRACE_GETREGS 12
-//.. #define VKI_PTRACE_SETREGS 13
-//.. #define VKI_PTRACE_GETFPREGS 14
-//.. #define VKI_PTRACE_SETFPREGS 15
-//.. #define VKI_PTRACE_GETFPXREGS 18
-//.. #define VKI_PTRACE_SETFPXREGS 19
+//----------------------------------------------------------------------
+// From linux-2.6.13/include/asm-ppc64/ptrace.h
+//----------------------------------------------------------------------
+
+#define VKI_PTRACE_SETREGS 0x98
+
//----------------------------------------------------------------------
// And that's it!