Three register layers

Andrew Cagney ac131313@redhat.com
Sun Jun 22 21:58:00 GMT 2003


Hello,

I think the recent MIPS register discussion has identified a technical 
limitation with the current register/frame structure.

At present there are two register layers:

	cooked/frame
	   |
	  raw

where the cooked/frame registers are constructed from raw registers and 
memory.

To implement the registers proposed in Kevin's patch in a way that will 
work with CFI, I think a third layer is needed vis:

	user
	 |
	cooked/frame
	 |
	raw

The user visible registers being constructed from the frame/abi 
registers, and the frame/abi registers being (eventually) constructed 
from raw registers / memory.  If this isn't done, each frame will need 
to know how to unwind not just the ABI registers but also these extra 
user registers - making for much complexity.

I should note that this is, sort of, already in place.  The builtin 
registers ($fp, $sp, $ps) are layered above the frame registers vis:

	builtin-regs
	    |
	cooked/frame
	    |
	   raw

with this in place I think it becomes possible to convert the somewhat 
messy MIPS and SH.

As an example, the MIPS thread proposed a $fpr0 that is constructed from 
the ABI register pair: $cop0r0 ||| $cop0r1.  The frame unwinders would 
know how to unwind the ABI based $cop0r0 and $cop0r1, but not the user 
visible composite $fpr0.

thoughts,
Andrew



More information about the Gdb mailing list