aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2015-02-09 14:58:25 +0100
committerMark Wielaard <mjw@redhat.com>2015-02-09 15:09:22 +0100
commita2c2acaf15e9cc40bae8a6eebba78aadd3a31b8e (patch)
treed83d74ca8ec983bc4abc4d401d816abb2eb53d48 /gdb/gdbtypes.c
parente051a5b512a282642030720c69b5b4f9a85314ea (diff)
downloadgdb-a2c2acaf15e9cc40bae8a6eebba78aadd3a31b8e.zip
gdb-a2c2acaf15e9cc40bae8a6eebba78aadd3a31b8e.tar.gz
gdb-a2c2acaf15e9cc40bae8a6eebba78aadd3a31b8e.tar.bz2
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.
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 140fc6f..2abaffe 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -714,6 +714,17 @@ make_unqualified_type (struct type *type)
NULL);
}
+/* Make a '_Atomic'-qualified version of TYPE. */
+
+struct type *
+make_atomic_type (struct type *type)
+{
+ return make_qualified_type (type,
+ (TYPE_INSTANCE_FLAGS (type)
+ | TYPE_INSTANCE_FLAG_ATOMIC),
+ NULL);
+}
+
/* Replace the contents of ntype with the type *type. This changes the
contents, rather than the pointer for TYPE_MAIN_TYPE (ntype); thus
the changes are propogated to all types in the TYPE_CHAIN.
@@ -4012,6 +4023,10 @@ recursive_dump_type (struct type *type, int spaces)
{
puts_filtered (" TYPE_FLAG_RESTRICT");
}
+ if (TYPE_ATOMIC (type))
+ {
+ puts_filtered (" TYPE_FLAG_ATOMIC");
+ }
puts_filtered ("\n");
printfi_filtered (spaces, "flags");