Skip to content

Commit bc77517

Browse files
committed
dwarf_loader: Handle const and volatile bitfields in tag__recode_dwarf_bitfield
We should do just as with typedefs, i.e. find the type these tags point to, and create a new volatile/const tag pointing to the underlying bitfield tag. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 9f4cedc commit bc77517

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

dwarf_loader.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,26 @@ int tag__recode_dwarf_bitfield(struct tag *self, struct cu *cu, uint16_t bit_siz
480480
}
481481
break;
482482

483+
case DW_TAG_const_type:
484+
case DW_TAG_volatile_type: {
485+
const struct dwarf_tag *dself = self->priv;
486+
struct dwarf_tag *dtype = dwarf_cu__find_type_by_id(cu->priv,
487+
dself->type);
488+
struct tag *type = dtype->tag;
489+
490+
id = tag__recode_dwarf_bitfield(type, cu, bit_size);
491+
if (id == self->type)
492+
return id;
493+
494+
recoded = zalloc(sizeof(*recoded));
495+
if (recoded == NULL)
496+
return -ENOMEM;
497+
498+
recoded->tag = DW_TAG_volatile_type;
499+
recoded->type = id;
500+
}
501+
break;
502+
483503
case DW_TAG_base_type:
484504
/*
485505
* Here we must search on the final, core cu, not on

0 commit comments

Comments
 (0)