Re: [SH] regs command

Thomas Schwinge
2012-05-16T17:21:00Z

[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]

Hi!

On Wed, 16 May 2012 09:57:30 -0700, Joel Brobecker <brobecker@adacore.com> wrote:
> > Sounds good, and thusly implemented, OK to commit?
>
> I have only skimmed the patch for now. Perhaps Kevin would like
> to look at the purely sh-related changes. They look good to me,
> but I don't know if you might have missed something.

Sure, we can wait.

> In the meantime, I have noticed something:
>
> > _initialize_sh_tdep (void)
> > {
> > struct cmd_list_element *c;
> > + extern void all_registers_info (char *, int);
> >
> > gdbarch_register (bfd_arch_sh, sh_gdbarch_init, NULL);
> >
> > - add_com ("regs", class_vars, sh_show_regs_command, _("Print all registers"));
> > -
> > + c = add_com ("regs", class_vars, all_registers_info,
> > + _("Print all registers"));
> > + deprecate_cmd (c, "info all-registers");
> > +
>
> Can you use add_alias_cmd instead of add_com? The only think I am not
> sure about is whether it is going to work with the deprecation mechanism.
> The command system is kind of obscure to me (in the fact that it has so
> many attributes), but a look at the code seems to indicate that it will.
> And as a bonus, you'll inherit all the attributes of the "info all-reg"
> command...

That's actually what I have tried first, but failed: due to add_alias_cmd
returning a NULL pointer (in c), deprecated_cmd obviously failed. And as
we'd remove this code in a few weeks anyway, I decided not to spend more
time on this, and instead go the easy route.

Grüße,
Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]