This is the mail archive of the mailing list for the elfutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libdw: Add dwarf_peel_type. Use it in dwarf_aggregate_size.

The description in your prologue and the libdw.h comment do not match what
the code actually does.  You describe it as going until it hits one of the
known categories of actual type.  But what it actually does is go only as
long as it is seeing one of the known categories of wrapper type.  I'm not
really sure which it should do (or if it should instead do something
different from either), but the description should match the behavior.

As described, it would fall down if a new tag were introduced for a new
category of actual type.  As implemented, it would fall down if a new tag
were introduced for a new category of wrapper type.

A third potential approach would be to attempt future-proofing for those
cases.  That is, just keep going as long as there is a DW_AT_type
attribute.  But that would need a special case for DW_TAG_pointer_type and
DW_TAG_reference_type, where you want to stop even though it has a
DW_AT_type referring to another type.  I can't think of any other cases
where an "actual" type has a DW_AT_type, but there might well be some.  If
any new tag were like DW_TAG_pointer_type rather than like
DW_TAG_const_type et al, then this approach would fall down there.

So firstly we need to decide which kinds of future addition we expect and
thus how to handle the future-proofing.  Then we need to have descriptions
and implementation that match.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]