|
From: <sv...@va...> - 2005-11-08 20:59:24
|
Author: sewardj
Date: 2005-11-08 20:59:14 +0000 (Tue, 08 Nov 2005)
New Revision: 5046
Log:
Try to fill in ptrace_setregs. Dunno if it's right.
Modified:
trunk/coregrind/m_debugger.c
trunk/include/vki-ppc32-linux.h
Modified: trunk/coregrind/m_debugger.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debugger.c 2005-11-08 20:03:08 UTC (rev 5045)
+++ trunk/coregrind/m_debugger.c 2005-11-08 20:59:14 UTC (rev 5046)
@@ -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"
=20
#define WIFSTOPPED(status) (((status) & 0xff) =3D=3D 0x7f)
@@ -85,9 +84,48 @@
regs.rip =3D vex->guest_RIP;
=20
return VG_(ptrace)(VKI_PTRACE_SETREGS, pid, NULL, ®s);
+
#elif defined(VGA_ppc32)
- I_die_here;
- regs.gpr[0] =3D 0; // stop compiler complaints
+ regs.gpr[ 0] =3D vex->guest_GPR0;
+ regs.gpr[ 1] =3D vex->guest_GPR1;
+ regs.gpr[ 2] =3D vex->guest_GPR2;
+ regs.gpr[ 3] =3D vex->guest_GPR3;
+ regs.gpr[ 4] =3D vex->guest_GPR4;
+ regs.gpr[ 5] =3D vex->guest_GPR5;
+ regs.gpr[ 6] =3D vex->guest_GPR6;
+ regs.gpr[ 7] =3D vex->guest_GPR7;
+ regs.gpr[ 8] =3D vex->guest_GPR8;
+ regs.gpr[ 9] =3D vex->guest_GPR9;
+ regs.gpr[10] =3D vex->guest_GPR10;
+ regs.gpr[11] =3D vex->guest_GPR11;
+ regs.gpr[12] =3D vex->guest_GPR12;
+ regs.gpr[13] =3D vex->guest_GPR13;
+ regs.gpr[14] =3D vex->guest_GPR14;
+ regs.gpr[15] =3D vex->guest_GPR15;
+ regs.gpr[16] =3D vex->guest_GPR16;
+ regs.gpr[17] =3D vex->guest_GPR17;
+ regs.gpr[18] =3D vex->guest_GPR18;
+ regs.gpr[19] =3D vex->guest_GPR19;
+ regs.gpr[20] =3D vex->guest_GPR20;
+ regs.gpr[21] =3D vex->guest_GPR21;
+ regs.gpr[22] =3D vex->guest_GPR22;
+ regs.gpr[23] =3D vex->guest_GPR23;
+ regs.gpr[24] =3D vex->guest_GPR24;
+ regs.gpr[25] =3D vex->guest_GPR25;
+ regs.gpr[26] =3D vex->guest_GPR26;
+ regs.gpr[27] =3D vex->guest_GPR27;
+ regs.gpr[28] =3D vex->guest_GPR28;
+ regs.gpr[29] =3D vex->guest_GPR29;
+ regs.gpr[30] =3D vex->guest_GPR30;
+ regs.gpr[31] =3D vex->guest_GPR31;
+ regs.orig_gpr3 =3D vex->guest_GPR3;
+ regs.ctr =3D vex->guest_CTR;
+ regs.link =3D vex->guest_LR;
+ regs.xer =3D LibVEX_GuestPPC32_get_XER(vex);
+ regs.ccr =3D LibVEX_GuestPPC32_get_CR(vex);
+ regs.nip =3D vex->guest_CIA + 4;
+
+ return VG_(ptrace)(VKI_PTRACE_SETREGS, pid, NULL, ®s);
#else
# error Unknown arch
#endif
Modified: trunk/include/vki-ppc32-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/vki-ppc32-linux.h 2005-11-08 20:03:08 UTC (rev 5045)
+++ trunk/include/vki-ppc32-linux.h 2005-11-08 20:59:14 UTC (rev 5046)
@@ -870,17 +870,13 @@
//.. ///* We need to pay attention to this, because it mmaps memory */
//.. //#define VKI_DRM_IOCTL_MAP_BUFS _VKI_IOWR('d', 0x19, struct vki_d=
rm_buf_map)
=20
-//.. //-----------------------------------------------------------------=
-----
-//.. // From linux-2.6.9/include/asm-i386/ptrace.h
-//.. //-----------------------------------------------------------------=
-----
-//..=20
-//.. #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
+//----------------------------------------------------------------------
=20
+#define VKI_PTRACE_SETREGS 0x98
+
+
//----------------------------------------------------------------------
// And that's it!
//----------------------------------------------------------------------
|