This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] Handle DW_TAG_subrange_type
- From: Joel Brobecker <brobecker at gnat dot com>
- To: Elena Zannoni <ezannoni at redhat dot com>
- Cc: Andreas Schwab <schwab at suse dot de>, gdb-patches at sources dot redhat dot com
- Date: Thu, 4 Dec 2003 09:49:39 -0800
- Subject: Re: [PATCH] Handle DW_TAG_subrange_type
- References: <je1xs0p3nd.fsf@sykes.suse.de> <16335.26147.29714.759783@localhost.redhat.com>
> Can you post an example of the debug info you see for Ada in this
> case, just for the record?
In addition to the example posted by Andreas, here is the code in GCC
that generates these subrange types:
static dw_die_ref
subrange_type_die (tree type)
{
dw_die_ref subtype_die;
dw_die_ref subrange_die;
tree name = TYPE_NAME (type);
subtype_die = base_type_die (TREE_TYPE (type));
if (TREE_CODE (name) == TYPE_DECL)
name = DECL_NAME (name);
subrange_die = new_die (DW_TAG_subrange_type, comp_unit_die, type);
add_name_attribute (subrange_die, IDENTIFIER_POINTER (name));
if (TYPE_MIN_VALUE (type) != NULL)
add_bound_info (subrange_die, DW_AT_lower_bound,
TYPE_MIN_VALUE (type));
if (TYPE_MAX_VALUE (type) != NULL)
add_bound_info (subrange_die, DW_AT_upper_bound,
TYPE_MAX_VALUE (type));
add_AT_die_ref (subrange_die, DW_AT_type, subtype_die);
return subrange_die;
}
So the only information we are stuffing in these types are the name,
the bounds, and a reference to the parent type.
--
Joel