Subject: deficiency in PowerPC ptrace(2)
To: None <>
From: Jason R Thorpe <>
List: port-powerpc
Date: 12/09/2001 11:57:35

While working on a new ELF coredump format for NetBSD, I noticed that
the PowerPC has some deficiencies in the info provided by ptrace(2).

Specifically, ptrace(2) doesn't export all the registers that debuggers
would like to have.

Also, the register information in core dumps is actually more complete
than the register information provided by ptrace(2).  Other NetBSD
platforms provide the registers to ptrace(2) and to core dumps in the
same format (which is extremely convenient for debuggers, to say the

I am planning to fix the PowerPC ptrace(2) (while still maintaining
binary compatibility, possible with some other ptrace(2) infrastructure
changes I made last week) to provide register info like so:

	struct reg {
		register_t	r_fixreg[32];
		register_t	r_srr0;		/* PC */
		register_t	r_srr1;		/* MSR */
		register_t	r_lr;
		register_t	r_ctr;
		register_t	r_mq;		/* unused on PowerPC */
		int		r_cr;
		int		r_xer;

...and the registers will appear in that format in ELF core dumps, as well.
(And, yes, I will update gdb to work with both formats, and auto-detect
which format corresponds to PT_GETREGS.)

        -- Jason R. Thorpe <>