This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: internal error reading f0-f7 registers in arm-elf targets.
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: Richard dot Earnshaw at arm dot com
- Cc: amichelotti at ipitec dot it, Daniel Jacobowitz <drow at mvista dot com>,Richard Earnshaw <rearnsha at arm dot com>, gdb-patches at sources dot redhat dot com
- Date: Mon, 28 Jul 2003 11:11:59 -0400
- Subject: Re: internal error reading f0-f7 registers in arm-elf targets.
- References: <200307280841.h6S8fLd03396@pc960.cambridge.arm.com>
That's because 12 bytes are stored on the stack for each FP register.
This is all somewhat complicated. The FPA has support for IEEE
extended-precision arithmetic, but it's never used by the compiler/ABI.
However, to ensure that register values are correctly preserved across
function calls and don't generate conversion traps in the prologue, they
have to be saved in either in extended precision or in internal format by
the prologue. Old implementations of the FPE (the Emulator for the FPA)
did not have support for SFM instructions, so values were stored out in
extended precision (STFE), and that mode was configured not to trap on
conversion. The FPA (and newer versions of the FPE) have the
store-float-multiple (SFM) which stores out the registers in their
internal form to guarantee that things won't trap.
This all means that to correctly unwind floating point values we either
need to execute the LFM instructions (not generally possible in
remote/cross debugging) or understand the internal representation in use
(which isn't documented!).
The latter.
GDB already thinks it knows the answer: builtin_type_arm_ext_big or
builtin_type_arm_ext_littlebyte_bigword. If the on-stack format is
going to be different to the target format then (in addition to from
inflicting physical pain to the h/w designer) some playing with pseudo
registers will be needed.
To make things worse, some FPEs (eg the ARM-Linux one) use yet another
internal format... That is at least public, but it's just "different". :-(
And I haven't even mentioned the VFP yet!
I noticed that when looking for doco. Finding anything on FPA10 / FPA11
is hard - I eventually found something in the ARM7500FE manual.
Andrew