Re: [PATCH dwarves] fprintf: Fix `*` not being printed for pointers with btf_type_tag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

> [...]




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux