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

Daniel Jacobowitz
2007-10-08T14:10:47Z

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.

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.

For a concrete example, suppose the default PowerPC architecture
selected by GDB did not include AltiVec registers. Variables
living in such registers would get bogus locations from the
reg_to_regnum routine and it would not be fixed up when we
connected to an AltiVec-capable target.

--
Daniel Jacobowitz
CodeSourcery