This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: SH5 compact register numbering in gcc -> gdb interface - include/elf/sh.h?
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: Joern Rennecke <joern dot rennecke at st dot com>
- Cc: ezannoni at redhat dot com, binutils at sources dot redhat dot com,aoliva at redhat dot com, gcc at gcc dot gnu dot org, gdb at sources dot redhat dot com,bje at redhat dot com
- Date: Fri, 10 May 2002 10:33:28 -0400
- Subject: Re: SH5 compact register numbering in gcc -> gdb interface - include/elf/sh.h?
- References: <3CCED903.294513BE@st.com> <15568.36275.110744.510692@localhost.redhat.com> <3CD12BF8.7E1650C1@st.com> <or4rhotrng.fsf@livre.redhat.lsd.ic.unicamp.br> <3CD7EB51.7816DD1@st.com> <3CD803BC.5060900@cygnus.com> <3CD823D1.FC1E3717@st.com> <3CD85192.7020100@cygnus.com> <3CDAEDA4.3DE4A2D5@st.com> <15578.63785.429521.553723@localhost.redhat.com> <3CDB9C75.27044AE@st.com>
> + enum
>> > + {
>> > + SH_DEBUG_INFO_R0 = 0,
>> > + SH_DEBUG_INFO_PR = 17,
>> > + SH_DEBUG_INFO_GBR = 18,
>> > + SH_DEBUG_INFO_MACH_BIG = 20, SH_DEBUG_INFO_MACL, SH_DEBUG_INFO_MACH_LITTLE,
>>
>> This will break gdb. Register 22 ir SR. What are these registers?
>
>
> gcc does not emit debug information for SR - if it was encountered in
> DBX_REGISTER_NUMBER, the compiler would abort. So we don't actually have a
> number
> allocated in the interface right now, and if we need one, we are free to choose
> any.
>
>
>> Doesn't SH have only mach and macl?
>
>
> Yes, it has only mach and macl. But you could hold a 64 bit value in this
> register
> pair, in which case MACH always holds the high part and MACL holds the low part.
> So the idea is to use SH_DEBUG_INFO_MACH_BIG for big endian, and
> SH_DEBUG_INFO_MACH_LITTLE for little endian. This way, it is clear where low
> and high
> part are. both SH_DEBUG_INFO_MACH_BIG and SH_DEBUG_INFO_MACH_LITTLE are then
> mapped
> to gdb's MACH. Note that SH_DEBUG_INFO_MACH_BIG is the old MACH number, and
> SH_DEBUG_INFO_MACL is the old MACL number, so we have full backwards
> compatibility.
> Having both this backwards compatibility and the ability to represent a 64 bit
> value
> in MACH/MACL for little endian was the point of using 22 for
> SH_DEBUG_INFO_MACH_LITTLE.
The correct way to represent a 64 bit value in MACH and MACL is to emit
a location expression indicating that the value is split across the
MACL/MACH registers. GDB currently only handles the simple case of this
(but hey that is just a bug). If GCC can't emit this info correctly in
all cases then I guess GCC also has a bug and that bug also needs to be
fixed.
enjoy,
Andrew