mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-24 12:35:55 +08:00
3672e32622
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.
37 lines
343 B
C
37 lines
343 B
C
struct A
|
|
{
|
|
int a;
|
|
char *b;
|
|
struct
|
|
{
|
|
struct
|
|
{
|
|
char *one;
|
|
int two;
|
|
};
|
|
union
|
|
{
|
|
char *three;
|
|
};
|
|
};
|
|
struct
|
|
{
|
|
int four;
|
|
};
|
|
union
|
|
{
|
|
struct
|
|
{
|
|
double x;
|
|
long y;
|
|
};
|
|
struct
|
|
{
|
|
struct { char *foo; } z;
|
|
float aleph;
|
|
};
|
|
};
|
|
};
|
|
|
|
struct A used;
|