This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: internal error reading f0-f7 registers in arm-elf targets.



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]