Re: [patch 2/2] Implement gdbarch hook user_register_name on ARM

Richard Earnshaw
2010-12-22T17:35:35Z

On Wed, 2010-12-15 at 18:47 +0800, Yao Qi wrote:
> On 12/15/2010 06:22 PM, Yao Qi wrote:
> > Once this patch is applied, we leave more flexibility to backend to
> > determine what is the correct register number given a register alias.
>
> This patch is to implement user_register_name on ARM. With this, we can
> handle alias "fp" according to the current frame's mode (ARM or Thumb).
>
> Regression testing is still running on ARM. Comments are welcome.

I think this is misguided. Historically, the ARM back-end to gcc
defined an alias of fp for R11, whether in ARM or Thumb mode. The fact
that the Thumb-1 back-end doesn't use that register as a frame-pointer
is not particularly relevant.

The situation is quite messy, as GCC uses different registers in Thumb-1
and Thumb-2 code for a frame pointer; your code doesn't handle that
case, but seems to assume that all thumb code will use R7 as the frame
pointer.

Overall, I think it's just best if 'fp' is treated like any other
standard register alias on ARM and therefore that it always refers to
R11. If we really want a register alias that refers to the *current*
frame pointer register, then we need a new name that doesn't conflict
with anything in the current or previous ABIs. Maybe a
slightly-long-winded name like 'frame'?

R.