This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch, nios2] Use "sstatus" as preferred name of r30
- From: Pedro Alves <palves at redhat dot com>
- To: Sandra Loosemore <sandra at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 14 Oct 2013 10:04:33 +0100
- Subject: Re: [patch, nios2] Use "sstatus" as preferred name of r30
- Authentication-results: sourceware.org; auth=none
- References: <525B43FF dot 5080305 at codesourcery dot com>
Hi Sandra,
On 10/14/2013 02:08 AM, Sandra Loosemore wrote:
> Altera has requested that the register r30 disassemble using the
> symbolic name "sstatus" rather than "ba". Both names are documented in
> the Nios II processor reference handbook.
>
> The binutils changes to support this are already checked in:
> https://sourceware.org/ml/binutils/2013-10/msg00211.html
>
> I've also checked in this patch to make the corresponding changes to
> GDB's lists of register names.
I think this means that GDB will no longer accept target descriptions
that used the old register name?
/* Check any target description for validity. */
if (tdesc_has_registers (tdesc))
{
const struct tdesc_feature *feature;
int valid_p;
feature = tdesc_find_feature (tdesc, "org.gnu.gdb.nios2.cpu");
if (feature == NULL)
return NULL;
tdesc_data = tdesc_data_alloc ();
valid_p = 1;
for (i = 0; i < NIOS2_NUM_REGS; i++)
valid_p &= tdesc_numbered_register (feature, tdesc_data, i,
nios2_reg_names[i]);
if (!valid_p)
{
tdesc_data_cleanup (tdesc_data);
return NULL;
}
}
Not sure this is a good idea. An older gdb against a newer gdbserver
will also not accept the target description for not finding "ba"
in the org.gnu.gdb.nios2.cpu feature.
If we want to change the description, then I think we should
do it with new alternative target descriptions and features instead.
But since this is a core register that GDB knows about, another option
would be to leave the "ba" spelling in the descriptions as it was,
and instead special case r30 in nios2_register_name.
--
Pedro Alves