This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] MIPS: Handle the DSP registers for bare metal
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 19 Dec 2014 15:06:59 +0000
- Subject: Re: [PATCH] MIPS: Handle the DSP registers for bare metal
- Authentication-results: sourceware.org; auth=none
- References: <1418909149-29929-1-git-send-email-yao at codesourcery dot com> <54930ED2 dot 1080806 at redhat dot com> <87r3vwqooq dot fsf at codesourcery dot com> <5494098B dot 7080002 at redhat dot com> <87egrvrczm dot fsf at codesourcery dot com>
On 12/19/2014 01:22 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> The proper solution for this issue is to decouple GDB's internal
>> register numbers from the target's g/G packet layout, which is exactly
>> what happens when you have a description -- GDB uses the offsets found
>> in the target description. And you're touching code that is parsing a
>> description, so the real issue should be in the target description.
>
> So, these dsp registers on bare metal target have different layout from
> them on linux target, the stub should send the org.gnu.gdb.mips.dsp
> feature with some different "regnum", is that correct? On linux target,
> gdbserver sends
>
> <feature name="org.gnu.gdb.mips.dsp">
> <reg name="hi1" bitsize="32" regnum="72"/>
> ...
> </feature>
>
> on bare metal target, the stub should send
>
> <feature name="org.gnu.gdb.mips.dsp">
> <reg name="hi1" bitsize="32" regnum="73"/>
> ...
> </feature>
>
> is it right?
>
That should work. "regnum=" is really only needed to force gaps. If
you include extra registers in the description, GDB will display them.
So you could also do:
<feature name="org.gnu.gdb.mips.dsp">
<reg name="acx" bitsize="32"/>
<reg name="hi1" bitsize="32"/>
<reg name="lo1" bitsize="32"/>
<reg name="acx1" bitsize="32"/>
<reg name="hi2" bitsize="32"/>
<reg name="lo2" bitsize="32"/>
<reg name="acx2" bitsize="32"/>
<reg name="hi3" bitsize="32"/>
<reg name="lo3" bitsize="32"/>
<reg name="acx2" bitsize="32"/>
<reg name="dspctl" bitsize="32"/>
</feature>
Thanks,
Pedro Alves