[PATCH] gdb/riscv: Split ISA and ABI features

John Baldwin jhb@FreeBSD.org
Tue Dec 18 23:56:00 GMT 2018


On 12/18/18 3:29 PM, Andrew Burgess wrote:
>>> Note that I think the current patch will always report the floating point
>>> registers as the target width?  I think for other architectures in GDB we
>>> store the target registers as "raw" registers, but would present the
>>> abi registers as "cooked".  I think this is how we treat an i386 binary on
>>> x86_64 for example where 'info registers' shows 32-bit registers instead of
>>> 64-bit.  MIPS does some similar things to handle 32-bit MIPS binaries on
>>> 64-bit targets.  Perhaps this is less important for FP registers, but I'm
>>> curious if GDB will DTRT if you have a 'float' variable that DWARF indicates
>>> is stored in $f0 if $f0 is actually a 64-bit double register?
>>
>> When gdb knows that it is a float, it prints a float, so this works
>> OK.  The problem occurs when you use a command like "info registers
>> float" and gdb doesn't know if it is a float or a double value.  This
>> is why I added support to treat 64-bit FP registers as a union of
>> float and double, so that gdb would print both.  I also added support
>> to nan-box float values for inferior calls.  I haven't seen any
>> serious FP register related issues when I run the gdb testsuite
>> natively on my Fedora Core system.  I haven't tested Andrew's latest
>> patch yet, but if I see issues I will report them.
> 
> I did think about having a cooked view as John described, so if you
> load a binary marked as being for 'F' extension then you'd only see
> 32-bit float registers, even on a target with 64-bit float.  However,
> I think such a feature would be orthogonal to that changes I've
> presented here.  On my list of things to fix / improve it's a nice to
> have, but not a super high priority, especially as we have your (Jim)
> union view of 64-bit float registers now.

Please don't take my questions/suggestions as requirements, btw.  I'm not
certain that cooked registers would really be the right thing.  Having
floats as a union the way the vector registers are on x86 is definitely a
plus and probably does give you most of the gain a cooked register set
would bring.

-- 
John Baldwin

                                                                            



More information about the Gdb-patches mailing list