This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] MIPS: Fix pc_regnum and sp_regnum initialisation


>  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]