aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorKeven Boell <keven.boell@linux.intel.com>2015-03-20 17:45:20 -0400
committerJoel Brobecker <brobecker@adacore.com>2015-03-20 17:52:03 -0400
commitd9823cbb391e015f79687f4d17d7f9a32d27b5eb (patch)
treeb54acb333256046c9cf62f69b5c74db80b8bd081 /gdb/dwarf2read.c
parent2e7bf1d7210ee79b93ba9ce4462e22e71097a102 (diff)
downloadgdb-d9823cbb391e015f79687f4d17d7f9a32d27b5eb.zip
gdb-d9823cbb391e015f79687f4d17d7f9a32d27b5eb.tar.gz
gdb-d9823cbb391e015f79687f4d17d7f9a32d27b5eb.tar.bz2
[gdb/DWARF] Introduce linked list for dynamic attributes
This patch introduces a linked list for dynamic attributes of a type. This is a pre-work for the Fortran dynamic array support. The Fortran dynamic array support will add more dynamic attributes to a type. As only a few types will have such dynamic attributes set, a linked list is more efficient in terms of memory consumption than adding multiple attributes to main_type. gdb/ChangeLog: * gdbtypes.c (resolve_dynamic_type_internal): Adapt data_location usage to linked list. (resolve_dynamic_type_internal): Adapt data_location to linked list. (get_dyn_prop, add_dyn_prop, copy_dynamic_prop_list): New function. (copy_type_recursive, copy_type): Add copy of linked list. * gdbtypes.h (enum dynamic_prop_node_kind): New enum. (struct dynamic_prop_list): New struct. * dwarf2read.c (set_die_type): Set data_location data.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index c185d51..898706f 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -22085,11 +22085,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
/* Read DW_AT_data_location and set in type. */
attr = dwarf2_attr (die, DW_AT_data_location, cu);
if (attr_to_dynamic_prop (attr, die, cu, &prop))
- {
- TYPE_DATA_LOCATION (type)
- = obstack_alloc (&objfile->objfile_obstack, sizeof (prop));
- *TYPE_DATA_LOCATION (type) = prop;
- }
+ add_dyn_prop (DYN_ATTR_DATA_LOCATION, prop, type, objfile);
if (dwarf2_per_objfile->die_type_hash == NULL)
{