ptrace(2) on Sun 4

Steve Mabbs steve at mullian.ee.mu.oz.au
Thu Oct 12 12:42:01 AEST 1989


I'm using ptrace(2) to trace memory references on a sun4 during program
execution.  Ptrace allows you to read the registers into a structure,
which is defined in reg.h, as follows:

	#include machine/reg.h
	struct regs registers;
	ptrace(GETREGS, pid, &registers);

	etc.....

It seems, though, (looking at reg.h) that only the global registers and
the 'out' registers of the current window can be read by this ptrace call.
I need to be able to look at all the registers to form the effective
addresses of the memory load/stores.  Is there any easy way of examining
the contents of the 'ins' and 'locals' either by using ptrace(GETREGS) or
ptrace(PEEKDATA)?

(There is already a structure called rwindow defined in reg.h, but there
is no mention of this in the ptrace manual page.  Also, gdb declares a
structure (local_and_ins) as rwindow in sparc-dep.c, but doesn't seem to
use it anywhere)

Stephen A. Mabbs
Dept of Electrical and Electronic Engineering
University of Melbourne	
PARKVILLE VIC 3052
AUSTRALIA		INTERNET/ARPANET: steve at mullian.ee.mu.OZ.AU



More information about the Comp.sys.sun mailing list