This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] "info registers" is misleading
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Michael Snyder <msnyder at redhat dot com>
- Cc: fnf at redhat dot com, gdb-patches at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Date: Tue, 22 Jan 2002 10:27:33 +0000
- Subject: Re: [RFC] "info registers" is misleading
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
msnyder@redhat.com said:
> This is an old old issue. The frame pointer register is special.
> Info registers does not show the actual value of the fp register -- it
> shows the virtual frame pointer (the address of the function's stack
> frame). Usually it's the same value -- unles you're in a frameless
> function (ie. one that does not use the frame pointer register).
> Now that we have pseudo-registers, we've talked about adding a
> pseudo-frame-pointer register and using it for FP_REGNUM, so that the
> "real" frame pointer register can always display its real value.
Indeed. It isn't even confined to Thumb code. If you have ARM code
compiled with -fomit-frame-pointer, then gdb will confuse the
stack-pointer and frame-pointer registers. Very hard to work out what is
happening, especially if you want to force a register.
If we add extra gloop to "info registers" for printing out the
pseudo-frame-pointer register, then please don't call it "fp" (or at least
allow a target to provide its own name): "fp" is a well-known alias on the
arm (defined by the APCS) for r11. Users should be able to use fp as the
ARM register r11 and will get confused if it represents anything else.
R.