GCC5/DWARFv5 Handle DW_TAG_atomic_type for C11 _Atomic type qualifier.

gdb/ChangeLog

	* c-typeprint.c (cp_type_print_method_args): Handle '_Atomic'.
	(c_type_print_modifier): Likewise.
	* dwarf2read.c (read_tag_atomic_type): New function.
	(read_type_die_1): Handle DW_TAG_atomic_type.
	* gdbtypes.c (make_atomic_type): New function.
	(recursive_dump_type): Handle TYPE_ATOMIC.
	* gdbtypes.h (enum type_flag_values): Renumber.
	(enum type_instance_flag_value): Add TYPE_INSTANCE_FLAG_ATOMIC.
	(TYPE_ATOMIC): New macro.
	(make_atomic_type): Declare.

gdb/testsuite/ChangeLog

	* gdb.dwarf2/atomic.c: New file.
	* gdb.dwarf2/atomic-type.exp: Likewise.

include/ChangeLog

	* dwarf2.def: Add DW_TAG_atomic_type.
This commit is contained in:
Mark Wielaard
2015-02-09 14:58:25 +01:00
parent e051a5b512
commit a2c2acaf15
10 changed files with 216 additions and 13 deletions

View File

@ -193,18 +193,18 @@ enum type_code
enum type_flag_value
{
TYPE_FLAG_UNSIGNED = (1 << 8),
TYPE_FLAG_NOSIGN = (1 << 9),
TYPE_FLAG_STUB = (1 << 10),
TYPE_FLAG_TARGET_STUB = (1 << 11),
TYPE_FLAG_STATIC = (1 << 12),
TYPE_FLAG_PROTOTYPED = (1 << 13),
TYPE_FLAG_INCOMPLETE = (1 << 14),
TYPE_FLAG_VARARGS = (1 << 15),
TYPE_FLAG_VECTOR = (1 << 16),
TYPE_FLAG_FIXED_INSTANCE = (1 << 17),
TYPE_FLAG_STUB_SUPPORTED = (1 << 18),
TYPE_FLAG_GNU_IFUNC = (1 << 19),
TYPE_FLAG_UNSIGNED = (1 << 9),
TYPE_FLAG_NOSIGN = (1 << 10),
TYPE_FLAG_STUB = (1 << 11),
TYPE_FLAG_TARGET_STUB = (1 << 12),
TYPE_FLAG_STATIC = (1 << 13),
TYPE_FLAG_PROTOTYPED = (1 << 14),
TYPE_FLAG_INCOMPLETE = (1 << 15),
TYPE_FLAG_VARARGS = (1 << 16),
TYPE_FLAG_VECTOR = (1 << 17),
TYPE_FLAG_FIXED_INSTANCE = (1 << 18),
TYPE_FLAG_STUB_SUPPORTED = (1 << 19),
TYPE_FLAG_GNU_IFUNC = (1 << 20),
/* * Used for error-checking. */
TYPE_FLAG_MIN = TYPE_FLAG_UNSIGNED
@ -223,7 +223,8 @@ enum type_instance_flag_value
TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1 = (1 << 4),
TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2 = (1 << 5),
TYPE_INSTANCE_FLAG_NOTTEXT = (1 << 6),
TYPE_INSTANCE_FLAG_RESTRICT = (1 << 7)
TYPE_INSTANCE_FLAG_RESTRICT = (1 << 7),
TYPE_INSTANCE_FLAG_ATOMIC = (1 << 8)
};
/* * Unsigned integer type. If this is not set for a TYPE_CODE_INT,
@ -355,6 +356,12 @@ enum type_instance_flag_value
#define TYPE_RESTRICT(t) \
(TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_RESTRICT)
/* * Atomic type. If this is set, the corresponding type has an
_Atomic modifier. */
#define TYPE_ATOMIC(t) \
(TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_ATOMIC)
/* * Instruction-space delimited type. This is for Harvard architectures
which have separate instruction and data address spaces (and perhaps
others).
@ -1656,6 +1663,8 @@ extern struct type *make_restrict_type (struct type *);
extern struct type *make_unqualified_type (struct type *);
extern struct type *make_atomic_type (struct type *);
extern void replace_type (struct type *, struct type *);
extern int address_space_name_to_int (struct gdbarch *, char *);