Re: [rfa] add 'parent' field to struct die_info

Elena Zannoni
2003-10-01T17:24:07Z

David Carlton writes:
> On 30 Sep 2003 17:09:38 -0500, Jim Blandy <jimb@redhat.com> said:
>
> > Looks great --- please commit.
>
> Thanks, done.
>
> > Adding the parent pointer is great. But I also really appreciate the
> > child/sibling rearrangement... the way it stands is really confusing,
> > and I think this is much more intuitive.
>
> That was my attitude, too: before, we were too closely tied to the
> data structure that the debug info was originally stored in, for no
> good reason.

May I suggest to add a comment where the structure is defined that explains
in plain English the structure/relations of the dies?
From the Dwarf manual:

"The ownership relation of debugging information entries is achieved
naturally because the debugging information is represented as a
tree. The nodes of the tree are the debugging information entries
themselves. The child entries of any node are exactly those debugging
information entries owned by that node. While the ownership relation
of the debugging information entries is represented as a tree, other
relations among the entries exist, for example, a pointer from an
entry representing a variable to another entry representing the type
of that variable. If all such relations are taken into account, the
debugging entries form a graph, not a tree. The tree itself is
represented by flattening it in prefix order. Each debugging
information entry is defined either to have child entries or not to
have child entries. If an entry is defined not to have children, the
next physically succeeding entry is a sibling. If an entry is defined
to have children, the next physically succeeding entry is its first
child. Additional children are represented as siblings of the first
child. A chain of sibling entries is terminated by a null entry."

I think this would help a bit too (of course a bit shortened/paraphrased).

elena