From: Keven Boell <keven.boell@intel.com>
To: gdb-patches@sourceware.org
Cc: Keven Boell <keven.boell@intel.com>
Subject: [V4 01/18] vla: introduce allocated/associated flags
Date: Wed, 14 Jan 2015 13:49:00 -0000 [thread overview]
Message-ID: <1421243390-24015-2-git-send-email-keven.boell@intel.com> (raw)
In-Reply-To: <1421243390-24015-1-git-send-email-keven.boell@intel.com>
Fortran 90 provide types whose values may be dynamically
allocated or associated with a variable under explicit
program control. The purpose of this commit is to read
allocated/associated DWARF tags and store them to the
main_type.
2014-05-28 Keven Boell <keven.boell@intel.com>
Sanimir Agovic <sanimir.agovic@intel.com>
* dwarf2read.c (set_die_type): Add reading of
allocated/associated flags.
* gdbtypes.h (struct main_type): Add allocated/
associated dwarf2_prop attributes.
(TYPE_ALLOCATED_PROP): New macro.
(TYPE_ASSOCIATED_PROP): New macro.
(TYPE_NOT_ALLOCATED): New macro.
(TYPE_NOT_ASSOCIATED): New macro.
Signed-off-by: Keven Boell <keven.boell@intel.com>
---
gdb/dwarf2read.c | 28 ++++++++++++++++++++++++++++
gdb/gdbtypes.h | 26 ++++++++++++++++++++++++++
2 files changed, 54 insertions(+)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 86c3a73..df3ada1 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -21857,6 +21857,34 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
&& !HAVE_GNAT_AUX_INFO (type))
INIT_GNAT_SPECIFIC (type);
+ /* Read DW_AT_allocated and set in type. */
+ attr = dwarf2_attr (die, DW_AT_allocated, cu);
+ if (attr_form_is_block (attr))
+ {
+ struct dynamic_prop prop;
+
+ if (attr_to_dynamic_prop (attr, die, cu, &prop))
+ {
+ TYPE_ALLOCATED_PROP (type)
+ = obstack_alloc (&objfile->objfile_obstack, sizeof (prop));
+ *TYPE_ALLOCATED_PROP (type) = prop;
+ }
+ }
+
+ /* Read DW_AT_associated and set in type. */
+ attr = dwarf2_attr (die, DW_AT_associated, cu);
+ if (attr_form_is_block (attr))
+ {
+ struct dynamic_prop prop;
+
+ if (attr_to_dynamic_prop (attr, die, cu, &prop))
+ {
+ TYPE_ASSOCIATED_PROP (type)
+ = obstack_alloc (&objfile->objfile_obstack, sizeof (prop));
+ *TYPE_ASSOCIATED_PROP (type) = prop;
+ }
+ }
+
/* 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))
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 7c06a4f..6a8a74d 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -720,6 +720,18 @@ struct main_type
this field yields to the location of the data for an object. */
struct dynamic_prop *data_location;
+
+ /* Structure for DW_AT_allocated.
+ The presence of this attribute indicates that the object of the type
+ can be allocated/deallocated. The value can be a dwarf expression,
+ reference, or a constant. */
+ struct dynamic_prop *allocated;
+
+ /* Structure for DW_AT_associated.
+ The presence of this attribute indicated that the object of the type
+ can be associated. The value can be a dwarf expression,
+ reference, or a constant. */
+ struct dynamic_prop *associated;
};
/* * A ``struct type'' describes a particular instance of a type, with
@@ -1208,6 +1220,20 @@ extern void allocate_gnat_aux_type (struct type *);
TYPE_DATA_LOCATION (thistype)->data.const_val
#define TYPE_DATA_LOCATION_KIND(thistype) \
TYPE_DATA_LOCATION (thistype)->kind
+#define TYPE_ALLOCATED_PROP(thistype) TYPE_MAIN_TYPE(thistype)->allocated
+#define TYPE_ASSOCIATED_PROP(thistype) TYPE_MAIN_TYPE(thistype)->associated
+
+/* Allocated status of type object. If set to non-zero it means the object
+ is allocated. A zero value means it is not allocated. */
+#define TYPE_NOT_ALLOCATED(t) (TYPE_ALLOCATED_PROP (t) \
+ && TYPE_ALLOCATED_PROP (t)->kind == PROP_CONST \
+ && !TYPE_ALLOCATED_PROP (t)->data.const_val)
+
+/* Associated status of type object. If set to non-zero it means the object
+ is associated. A zero value means it is not associated. */
+#define TYPE_NOT_ASSOCIATED(t) (TYPE_ASSOCIATED_PROP (t) \
+ && TYPE_ASSOCIATED_PROP (t)->kind == PROP_CONST \
+ && !TYPE_ASSOCIATED_PROP (t)->data.const_val)
/* Moto-specific stuff for FORTRAN arrays. */
--
1.7.9.5
next prev parent reply other threads:[~2015-01-14 13:49 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-14 13:49 [V4 00/21] Fortran dynamic array support Keven Boell
2015-01-14 13:49 ` Keven Boell [this message]
2015-02-09 6:52 ` [V4 01/18] vla: introduce allocated/associated flags Joel Brobecker
2015-02-09 23:37 ` Doug Evans
2015-02-11 8:44 ` Joel Brobecker
2015-02-11 17:36 ` Doug Evans
2015-02-18 15:54 ` Keven Boell
2015-01-14 13:49 ` [V4 04/18] test: evaluate dynamic arrays using Fortran primitives Keven Boell
2015-01-14 13:49 ` [V4 07/18] test: evaluating allocation/association status Keven Boell
2015-01-14 13:50 ` [V4 03/18] test: basic tests for dynamic array evaluations in Fortran Keven Boell
2015-01-14 13:50 ` [V4 16/18] vla: Fortran dynamic string support Keven Boell
2015-01-14 13:50 ` [V4 15/18] vla: get dynamic array corner cases to work Keven Boell
2015-01-14 13:50 ` [V4 05/18] test: dynamic arrays passed to subroutines Keven Boell
2015-01-14 13:50 ` [V4 12/18] test: add archer dynamic other frame test Keven Boell
2015-01-14 13:50 ` [V4 06/18] test: correct ptype of dynamic arrays in Fortran Keven Boell
2015-01-14 13:50 ` [V4 09/18] test: accessing dynamic array history values Keven Boell
2015-01-14 13:50 ` [V4 18/18] vla: add NEWS entry for dynamic array support Keven Boell
2015-01-14 18:01 ` Eli Zaretskii
2015-01-14 13:50 ` [V4 14/18] vla: use value constructor instead of raw-buffer manipulation Keven Boell
2015-01-14 13:50 ` [V4 10/18] test: basic MI test for the dynamic array support Keven Boell
2015-01-14 13:50 ` [V4 17/18] vla: add stride support to fortran arrays Keven Boell
2015-01-14 13:50 ` [V4 11/18] test: test sizeof for dynamic " Keven Boell
2015-01-14 13:50 ` [V4 08/18] test: dynamic arrays passed to functions Keven Boell
2015-01-14 13:50 ` [V4 02/18] vla: make dynamic fortran arrays functional Keven Boell
2015-02-09 7:09 ` Joel Brobecker
2015-02-18 16:02 ` Keven Boell
2015-02-22 4:23 ` Joel Brobecker
2015-01-14 13:50 ` [V4 13/18] vla: reconstruct value to compute bounds of target type Keven Boell
2015-05-28 20:36 ` [V4 00/21] Fortran dynamic array support Jan Kratochvil
2015-05-28 20:52 ` Joel Brobecker
2015-06-14 8:15 ` Jan Kratochvil
2015-06-17 11:42 ` Boell, Keven
2015-07-01 12:43 ` Keven Boell
2016-07-07 8:30 ` Jan Kratochvil
2016-07-07 9:16 ` Bernhard Heckel
2016-07-07 9:23 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1421243390-24015-2-git-send-email-keven.boell@intel.com \
--to=keven.boell@intel.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox