aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJerome Guitton <guitton@adacore.com>2012-11-29 16:29:54 +0000
committerJerome Guitton <guitton@adacore.com>2012-11-29 16:29:54 +0000
commitac4a2da45da0729c656d0d7d9fca5b661ba69fcd (patch)
treea27fdc3005337b3b214682394fd1af28961370e2 /gdb
parentb50d69b5aa88f7d46a360d4d4a5b088f3370ad9d (diff)
downloadgdb-ac4a2da45da0729c656d0d7d9fca5b661ba69fcd.zip
gdb-ac4a2da45da0729c656d0d7d9fca5b661ba69fcd.tar.gz
gdb-ac4a2da45da0729c656d0d7d9fca5b661ba69fcd.tar.bz2
Strip interface tags from visible fields
The following Ada type: type Circle is new Shape and Drawable with record Center : Point; Radius : Natural; end record; ...is displayed as follow in GDB: (gdb) ptype circle type = new classes.shape with record V51s: ada.tags.interface_tag; center: classes.point; radius: natural; end record V51s is an internal field that is of no interest for the user. It should not be displayed. gdb/ChangeLog: * ada-lang.c (ada_is_interface_tag): New function. (ada_is_ignored_field): Add interface tags to the list of ignored fields.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/ada-lang.c19
2 files changed, 23 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 60d4dc3..e552e4d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2012-11-29 Jerome Guitton <guitton@adacore.com>
+ * ada-lang.c (ada_is_interface_tag): New function.
+ (ada_is_ignored_field): Add interface tags to the list
+ of ignored fields.
+
+2012-11-29 Jerome Guitton <guitton@adacore.com>
+
* ada-lang.h (ada_tag_value_at_base_address): New function
declaration.
* ada-lang.c (is_ada95_tag, ada_tag_value_at_base_address):
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index a34ba29..deefcfb 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -5937,6 +5937,19 @@ ada_is_dispatch_table_ptr_type (struct type *type)
return (strcmp (name, "ada__tags__dispatch_table") == 0);
}
+/* Return non-zero if TYPE is an interface tag. */
+
+static int
+ada_is_interface_tag (struct type *type)
+{
+ const char *name = TYPE_NAME (type);
+
+ if (name == NULL)
+ return 0;
+
+ return (strcmp (name, "ada__tags__interface_tag") == 0);
+}
+
/* True if field number FIELD_NUM in struct or union type TYPE is supposed
to be invisible to users. */
@@ -5967,9 +5980,11 @@ ada_is_ignored_field (struct type *type, int field_num)
return 1;
}
- /* If this is the dispatch table of a tagged type, then ignore. */
+ /* If this is the dispatch table of a tagged type or an interface tag,
+ then ignore. */
if (ada_is_tagged_type (type, 1)
- && ada_is_dispatch_table_ptr_type (TYPE_FIELD_TYPE (type, field_num)))
+ && (ada_is_dispatch_table_ptr_type (TYPE_FIELD_TYPE (type, field_num))
+ || ada_is_interface_tag (TYPE_FIELD_TYPE (type, field_num))))
return 1;
/* Not a special field, so it should not be ignored. */