This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [2/10] Remove &builtin_type_ from tdep code (amd64/s390/sparc64)
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: drow at false dot org (Daniel Jacobowitz)
- Cc: vladimir at codesourcery dot com (Vladimir Prus), gdb-patches at sourceware dot org
- Date: Tue, 12 Jun 2007 18:07:00 +0200 (CEST)
- Subject: Re: [2/10] Remove &builtin_type_ from tdep code (amd64/s390/sparc64)
Daniel Jacobowitz wrote:
> On Sat, Jun 09, 2007 at 01:14:58AM +0200, Ulrich Weigand wrote:
> > Hello,
> >
> > a number of platforms (amd64, s390, sparc64) were using a global data
> > structure containing pointers to types describing the register types.
> > This is broken if those types need to be platform-specific.
> >
> > The following patch removes those global data structures, and converts
> > the affected architectures to simply return the types dynamically from
> > the register_type callback, as all other platforms do as well.
>
> In-flight collision warning: the m68k ColdFire patch may reintroduce an
> occurance of this, for the long double type.
Ah, good catch:
+ /* Type of an fpreg. NULL if there are no fpregs. This is a
+ pointer to the pointer to type struct, because when architecture
+ init function is running, the types for the old architecture are swapped
+ out, and the types for the new architecture are not yet swapped in,
+ so all types that don't have specific sizes (like builting_type_double)
+ are NULL. */
+ struct type **fpreg_type;
Vladimir, would you mind rewriting this? I'd suggest to remove the
fpreg_type variable, and instead check the "flavour" in m68k_register_type.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com