On March 31, 2023 10:35:52 AM GMT-03:00, Eduard Zingerman <eddyz87@xxxxxxxxx> wrote: >On Fri, 2023-03-31 at 09:13 -0300, Arnaldo Carvalho de Melo wrote: >> [...] >> > >> > +static type_id_t skip_llvm_annotations(const struct cu *cu, type_id_t id) >> > +{ >> > + struct tag *type; >> > + >> > + for (;;) { >> > + if (id == 0) >> > + break; >> > + type = cu__type(cu, id); >> > + if (type == NULL || type->tag != DW_TAG_LLVM_annotation || type->type == id) >> > + break; >> > + id = type->type; >> > + } >> > + >> > + return id; >> > +} >> >> This part I didn't understand, do you see any possibility of a >> DW_TAG_LLVM_annotation pointing to another DW_TAG_LLVM_annotation? > >Not at the moment, but it is no illegal, it is possible to write >something like this: > > #define __t1 __attribute__((btf_type_tag("t1"))) > #define __t2 __attribute__((btf_type_tag("t2"))) > > int __t1 __t2 *g; > >And to get BTF like ptr --> __t2 --> __t1 --> int. Right, thanks for clarifying, I'll add this as a comment above the skip llvm function. This patch is already in the 'next' branch, will move to 'master' later today. - Arnaldo > >> [...]