libctf: get the offsets of fields of unnamed structs/unions right
authorNick Alcock <nick.alcock@oracle.com>
Thu, 23 Mar 2023 00:15:17 +0000 (00:15 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 24 Mar 2023 13:37:32 +0000 (13:37 +0000)
commit3672e3262210d1a08a3fdc44569ea8b5696c43cc
treec943257469b7e0a989a265e32089319fd9e75254
parent04d91c807eaf4395472409a53e2acd9ad89683f0
libctf: get the offsets of fields of unnamed structs/unions right

We were failing to add the offsets of the containing struct/union
in this case, leading to all offsets being relative to the unnamed
struct/union itself.

libctf/
PR libctf/30264
* ctf-types.c (ctf_member_info): Add the offset of the unnamed
member of the current struct as necessary.
* testsuite/libctf-lookup/unnamed-field-info*: New test.
libctf/ctf-types.c
libctf/testsuite/libctf-lookup/unnamed-field-info-ctf.c [new file with mode: 0644]
libctf/testsuite/libctf-lookup/unnamed-field-info.c [new file with mode: 0644]
libctf/testsuite/libctf-lookup/unnamed-field-info.lk [new file with mode: 0644]