Re: [rfc] [00/16] Get rid of current gdbarch

Ulrich Weigand
2007-10-09T19:59:46Z

Daniel Jacobowitz wrote:
> On Mon, Oct 08, 2007 at 04:01:36PM +0200, Ulrich Weigand wrote:
> > Agreed for that particular usage. In general, the reg_to_regnum
> > routines should probably still be converted to "m" -- e.g. the
> > rs6000 versions do make non-trivial use of the gdbarch ...
>
> Isn't that problematic? We do not know what the architecture will
> be at this point. Only the bits common to all architectures using
> the same init routine are safe to use.

Hmm, good point, I'll have to think about this ...

> As for the rs6000 version, the patches I posted last week allow a
> followup patch which propogates some constants. Most of the values
> being read from the tdep are now constants. Some (e.g. ppc_mq_regnum)
> are not constants, but have either a single constant value or -1 if
> the register is not present; for those the constant is appropriate
> in the reg_to_regnum routines anyway.

I agree that everything would be much easier if the register numbers
were constants. But note that rs6000 is not the only platform where
this is not the case, I see the same (or even worse) also in mips,
m32c, xtensa, ... (The mep usage also seems suspicious.)

Bye,
Ulrich

--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com