mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-20 04:44:26 +08:00
Merge branch 'libbpf: Fix BTF dump of pointer-to-array-of-struct'
Jean-Philippe Brucker says: ==================== Fix an issue with the libbpf BTF dump, see patch 1 for details. Since [v1] I added the selftest in patch 2, though I couldn't figure out a way to make it independent from the order in which debug info is issued by the compiler. [v1]: https://lore.kernel.org/bpf/20210318122700.396574-1-jean-philippe@linaro.org/ ==================== Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
This commit is contained in:
commit
e75b513ec6
@ -462,7 +462,7 @@ static int btf_dump_order_type(struct btf_dump *d, __u32 id, bool through_ptr)
|
||||
return err;
|
||||
|
||||
case BTF_KIND_ARRAY:
|
||||
return btf_dump_order_type(d, btf_array(t)->type, through_ptr);
|
||||
return btf_dump_order_type(d, btf_array(t)->type, false);
|
||||
|
||||
case BTF_KIND_STRUCT:
|
||||
case BTF_KIND_UNION: {
|
||||
|
@ -174,6 +174,12 @@ struct struct_in_struct {
|
||||
};
|
||||
};
|
||||
|
||||
struct struct_in_array {};
|
||||
|
||||
struct struct_in_array_typed {};
|
||||
|
||||
typedef struct struct_in_array_typed struct_in_array_t[2];
|
||||
|
||||
struct struct_with_embedded_stuff {
|
||||
int a;
|
||||
struct {
|
||||
@ -203,6 +209,8 @@ struct struct_with_embedded_stuff {
|
||||
} r[5];
|
||||
struct struct_in_struct s[10];
|
||||
int t[11];
|
||||
struct struct_in_array (*u)[2];
|
||||
struct_in_array_t *v;
|
||||
};
|
||||
|
||||
struct root_struct {
|
||||
|
Loading…
Reference in New Issue
Block a user