mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
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.
This commit is contained in:
@ -1417,7 +1417,10 @@ ctf_member_info (ctf_dict_t *fp, ctf_id_t type, const char *name,
|
||||
&& (ctf_type_kind (fp, memb.ctlm_type) == CTF_K_STRUCT
|
||||
|| ctf_type_kind (fp, memb.ctlm_type) == CTF_K_UNION)
|
||||
&& (ctf_member_info (fp, memb.ctlm_type, name, mip) == 0))
|
||||
return 0;
|
||||
{
|
||||
mip->ctm_offset += (unsigned long) CTF_LMEM_OFFSET (&memb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strcmp (membname, name) == 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user