This is the mail archive of the gdb-testers@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]

[binutils-gdb] [Ada] Cache all static structures and reset cache during resolution


*** TEST RESULTS FOR COMMIT 9e19566105546654ab24b2b58c890fd7e2b9e00c ***

Author: Pierre-Marie de Rodat <derodat@adacore.com>
Branch: master
Commit: 9e19566105546654ab24b2b58c890fd7e2b9e00c

[Ada] Cache all static structures and reset cache during resolution
Currently, ada-lang.c:template_to_static_fixed_type (working on
structure types only) caches its result into the unused TYPE_TARGET_TYPE
field. This introduces inconsistencies when the input type is
specialized, for instance during type resolution: the cached static
fixed type is copied along with the original type, but it's no longer
adapted to the copy once the copy is modified:
template_to_static_fixed_type has to compute another static fixed type
for it.

This change first introduces a cache reset during type resolution for
structure types so that this inconsistency does not happen anymore. It
also makes template_to_static_fixed_type smarter with respect to types
that do not need static fixed copies so that less computations is done
in general.

This inconsistency was spotted thanks to code reading, not because of
any sort of failure and we did not manage to exhibit a failure yet, so
no testcase for this.

gdb/ChangeLog:

	* ada-lang.c (template_to_static_fixed_type): Return input type
	when it is already fixed. Cache the input type itself when not
	creating a static fixed copy. Make it explicit that we never
	molestate the input type.
	* gdbtypes.c (resolve_dynamic_struct): Reset the
	TYPE_TARGET_TYPE field for resolved copies.


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