mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 07:53:51 +08:00
Implement support for Ada interface types.
* ada-lang.c (ada_is_dispatch_table_ptr_type): New function. (ada_is_ignored_field): Ignore fields that are a dispatch table of a tagged type.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2008-01-01 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
|
Implement support for Ada interface types.
|
||||||
|
|
||||||
|
* ada-lang.c (ada_is_dispatch_table_ptr_type): New function.
|
||||||
|
(ada_is_ignored_field): Ignore fields that are a dispatch table
|
||||||
|
of a tagged type.
|
||||||
|
|
||||||
2008-01-01 Joel Brobecker <brobecker@adacore.com>
|
2008-01-01 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
* top.c (print_gdb_version): Update copyright year.
|
* top.c (print_gdb_version): Update copyright year.
|
||||||
|
@ -5277,6 +5277,24 @@ ada_add_block_symbols (struct obstack *obstackp,
|
|||||||
|
|
||||||
/* Field Access */
|
/* Field Access */
|
||||||
|
|
||||||
|
/* Return non-zero if TYPE is a pointer to the GNAT dispatch table used
|
||||||
|
for tagged types. */
|
||||||
|
|
||||||
|
static int
|
||||||
|
ada_is_dispatch_table_ptr_type (struct type *type)
|
||||||
|
{
|
||||||
|
char *name;
|
||||||
|
|
||||||
|
if (TYPE_CODE (type) != TYPE_CODE_PTR)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
name = TYPE_NAME (TYPE_TARGET_TYPE (type));
|
||||||
|
if (name == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return (strcmp (name, "ada__tags__dispatch_table") == 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* True if field number FIELD_NUM in struct or union type TYPE is supposed
|
/* True if field number FIELD_NUM in struct or union type TYPE is supposed
|
||||||
to be invisible to users. */
|
to be invisible to users. */
|
||||||
|
|
||||||
@ -5285,12 +5303,30 @@ ada_is_ignored_field (struct type *type, int field_num)
|
|||||||
{
|
{
|
||||||
if (field_num < 0 || field_num > TYPE_NFIELDS (type))
|
if (field_num < 0 || field_num > TYPE_NFIELDS (type))
|
||||||
return 1;
|
return 1;
|
||||||
else
|
|
||||||
|
/* Check the name of that field. */
|
||||||
{
|
{
|
||||||
const char *name = TYPE_FIELD_NAME (type, field_num);
|
const char *name = TYPE_FIELD_NAME (type, field_num);
|
||||||
return (name == NULL
|
|
||||||
|| (name[0] == '_' && strncmp (name, "_parent", 7) != 0));
|
/* Anonymous field names should not be printed.
|
||||||
|
brobecker/2007-02-20: I don't think this can actually happen
|
||||||
|
but we don't want to print the value of annonymous fields anyway. */
|
||||||
|
if (name == NULL)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
/* A field named "_parent" is internally generated by GNAT for
|
||||||
|
tagged types, and should not be printed either. */
|
||||||
|
if (name[0] == '_' && strncmp (name, "_parent", 7) != 0)
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If this is the dispatch table of a tagged type, then ignore. */
|
||||||
|
if (ada_is_tagged_type (type, 1)
|
||||||
|
&& ada_is_dispatch_table_ptr_type (TYPE_FIELD_TYPE (type, field_num)))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
/* Not a special field, so it should not be ignored. */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* True iff TYPE has a tag field. If REFOK, then TYPE may also be a
|
/* True iff TYPE has a tag field. If REFOK, then TYPE may also be a
|
||||||
|
Reference in New Issue
Block a user