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: Joel Brobecker <brobecker at adacore dot com>
- To: "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 8 Dec 2011 09:24:56 +0100
- Subject: Re: [PATCH] MIPS: Fix pc_regnum and sp_regnum initialisation
- References: <alpine.DEB.1.10.1112062048380.6710@tp.orcam.me.uk>
> Register numbers used for pc_regnum and sp_regnum are in the cooked range
> and therefore depend on the total number of registers. At some point the
> MIPS/Linux OS ABI initialiser has been changed such that it may change the
> number of available registers to add the artificial "restart" register.
> Therefore cooked register numbers stored in gdbarch may only be
> initialised once the OS ABI initialiser has run.
Ugh...
> 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.
> + /* 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 :-).
--
Joel