The PtraceByteBuffer peek and poke routines expect to be reading/writing an int. They also align addresses to an int boundary. This does not work on AMD64, for example, where a long-aligned address is expected and a word is actually 64-bits (or a C long). Trying to read on a 32-bit boundary that is not a 64-bit boundary results in a ptrace error to occur. If PtraceByteBuffer uses the word size, then it can make the proper call.
From the following ChangeLog, frysk.proc.live.AddressSpaceByteBuffer.java is the current java wrapper to do the peek and poke routine. It use frysk.sys.Ptrace.AddressSpace to do actual work. CNI implementation for frysk.sys.Ptrace.AddressSpace reads and writes long. Index: frysk-core/frysk/proc/live/ChangeLog 2007-06-18 Andrew Cagney <cagney@redhat.com> * Rename package frysk.proc.ptrace to frysk.proc.live. date: 2007/04/15 22:56:46; author: cagney; state: Exp; lines: +4 -0 Index: frysk-core/frysk/proc/ChangeLog 2007-04-15 Andrew Cagney <cagney@redhat.com> * IsaPowerPC.java: Replace frysk.sys.PtraceByteBuffer with frysk.proc.ptrace.AddressSpaceByteBuffer. * LinuxPtraceTask.java: Ditto. Index: frysk-imports/frysk/sys/ChangeLog 2007-04-15 Andrew Cagney <cagney@redhat.com> * PtraceServer.java (peek, poke): Delete. * Ptrace.java (peek, poke): Delete. * cni/Ptrace.cxx: Update. * PtraceByteBuffer.java: Delete. * cni/PtraceByteBuffer.cxx (peek): Delete. * TestPtraceByteBuffer.java: Delete. * StressMapRead.java: Delete.