This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] MIPS: Fix pc_regnum and sp_regnum initialisation
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Thu, 1 Mar 2012 23:07:22 +0000
- Subject: Re: [PATCH] MIPS: Fix pc_regnum and sp_regnum initialisation
- References: <alpine.DEB.1.10.1112062048380.6710@tp.orcam.me.uk> <20111208082456.GG21915@adacore.com>
On Thu, 8 Dec 2011, Joel Brobecker wrote:
> > 2011-12-06 Maciej W. Rozycki <macro@codesourcery.com>
> >
> > gdb/
> > * mips-tdep.c (mips_gdbarch_init): Only set pc_regnum and
> > sp_regnum once the gdbarch_init_osabi hook has been called.
>
> Thanks. This looks OK to me.
This relied on gdb-mips-dsp-linux.diff somewhat as well, applied now too.
Thanks for the review.
> > + /* The hook may have adjusted num_regs, fetch the final value and
> > + set pc_regnum and sp_regnum now that it has been fixed. */
> > + /* FIXME: cagney/2003-11-15: For MIPS, hasn't gdbarch_pc_regnum been
> > + replaced by gdbarch_read_pc? */
>
> It'd be interesting to answer Andrew's question, but that's for another
> rainy day (that would mean tomorrow if you lived in Vancouver :-).
Given the special handling of the ISA bit it makes sense to replace
pc_regnum entirely with read_pc/write_pc, but then I think pc_regnum
should be set for safety to something that would signal an error if ever
used, like -1 or suchlike that would be trapped by gdbarch_pc_regnum.
I'll see if I can have a look into it (Cambridge isn't that rainy though
-- perhaps one of the driest places in England, as far as precipitation is
concerned, that is -- we have more than enough water elsewhere: in the
Fens ;) ).
And the handling of the ISA bit requires another discussion that I'll
start shortly -- we're definitely not getting it right.
Maciej