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: [6/7] Introduce per-type architecture


>>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:

Ulrich> this patch finally adds an architecture reference to each type.

I read through this patch series.  Well... I skimmed most of it, since
it mostly seemed mechanical.

It all seems reasonable to me.

Ulrich> In order to avoid growing the space-critical "struct type" or
Ulrich> "struct main_type", the existing reference to the objfile
Ulrich> associated with a type is replaced by a union that refers to
Ulrich> either an objfile or a gdbarch, depending on a new type flag.

Ulrich> The existing type allocation routines alloc_type and init_type
Ulrich> now always create per-objfile types; it is now a bug to call
Ulrich> them with a NULL objfile parameter.  The helpers init_float_type,
Ulrich> init_complex_type, init_flags_type, and init_composite_type are
Ulrich> removed (and replaced by per-arch variants).

Ulrich> There is new routine alloc_type_arch that allocates a non-
Ulrich> objfile related type; you have to specify a (non-NULL) gdbarch
Ulrich> argument instead.  A number of helper routines are provided
Ulrich> to simplify architecture-specific type creation (arch_type,
Ulrich> arch_integer_type, arch_character_type, arch_boolean_type,
Ulrich> arch_float_type, arch_complex_type, arch_flags_type, and
Ulrich> arch_composite_type).

Ulrich> Finally, if you want to allocate a new type with the same
Ulrich> ownership information (objfile or architecture) as an existing
Ulrich> type, you can use alloc_type_copy to do so.

I noticed that many of the new functions don't have introductory
comments.  We've been asking everybody to write these recently; and I
think the quoted text here would be good to have in the code
somewhere.  So, I would like to ask that this be split up and attached
to the appropriate functions.

Tom


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