]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ctf: unnamed structure/union support
authorNick Alcock <nick.alcock@oracle.com>
Wed, 29 Aug 2012 13:18:57 +0000 (14:18 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 29 Jun 2015 21:40:30 +0000 (22:40 +0100)
commit6db727d0ec2e97a94ca0d58d0819cc1c89e31aca
tree90133fc51c3e12787b39d6597097af930a1eeb5d
parenteb154adeb753339faaaa8cb609aaafdef8fe9427
ctf: unnamed structure/union support

Since neither CTF nor DTrace userspace have support for unnamed structure/union
members, we have to cheat a bit.  We can model an unnamed structure member as
being precisely equivalent to simply naming the structure members in the
enclosing structure, with their offsets biased by the offset of the unnamed
member in its enclosing structure.  An unnamed union is the same, excepting the
overlapping offsets, which we don't need to pay any attention to since we
already get all our offset information directly from the debugging information
anyway.

So we handle this by detecting an anonymous member after offset computation,
skipping to its type DIE's first child (if any), and calling die_to_ctf()
directly with that child, so that die_to_ctf() works over the anonymous member's
members as if they were members of the enclosing structure, skipping all the
usual addition of that structure as a CTF entity in its own right.  We handle
the offset biasing by adding a parent_bias to die_to_ctf() and all CTF
construction functions, and adding that bias to all structure member offsets.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
scripts/dwarf2ctf/dwarf2ctf.c