[2/9] include: add BTF decl tag defines
Checks
Commit Message
Add definitions for btf_decl_tag and the DW_TAG_GNU_annotation
DWARF extension.
include/
* btf.h (struct btf_type): Update comment.
(BTF_KIND_DECL_TAG): New define.
(struct btf_decl_tag): New.
* dwarf2.def (DW_TAG_GNU_annotation): New DW_TAG extension.
---
include/btf.h | 14 +++++++++++++-
include/dwarf2.def | 4 ++++
2 files changed, 17 insertions(+), 1 deletion(-)
@@ -69,7 +69,7 @@ struct btf_type
/* SIZE is used by INT, ENUM, STRUCT, UNION, DATASEC kinds.
TYPE is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT, FUNC,
- FUNC_PROTO and VAR kinds. */
+ FUNC_PROTO, VAR and DECL_TAG kinds. */
union
{
uint32_t size; /* Size of the entire type, in bytes. */
@@ -109,6 +109,7 @@ struct btf_type
#define BTF_KIND_VAR 14 /* Variable. */
#define BTF_KIND_DATASEC 15 /* Section such as .bss or .data. */
#define BTF_KIND_FLOAT 16 /* Floating point. */
+#define BTF_KIND_DECL_TAG 17 /* Decl Tag. */
#define BTF_KIND_ENUM64 19 /* Enumeration up to 64 bits. */
#define BTF_KIND_MAX BTF_KIND_ENUM64
#define NR_BTF_KINDS (BTF_KIND_MAX + 1)
@@ -222,6 +223,17 @@ struct btf_enum64
uint32_t val_hi32; /* high 32-bit value for a 64-bit value Enumerator */
};
+/* BTF_KIND_DECL_TAG is followed by a single struct btf_decl_tag, which
+ describes the tag location:
+ - If component_idx == -1, then the tag is applied to a struct, union,
+ variable or function.
+ - Otherwise it is applied to a struct/union member or function argument
+ with the given given index numbered 0..vlen-1. */
+struct btf_decl_tag
+{
+ int32_t component_idx;
+};
+
#ifdef __cplusplus
}
#endif
@@ -174,6 +174,10 @@ DW_TAG (DW_TAG_GNU_formal_parameter_pack, 0x4108)
are properly part of DWARF 5. */
DW_TAG (DW_TAG_GNU_call_site, 0x4109)
DW_TAG (DW_TAG_GNU_call_site_parameter, 0x410a)
+
+/* Extension for BTF annotations. */
+DW_TAG (DW_TAG_GNU_annotation, 0x6000)
+
/* Extensions for UPC. See: http://dwarfstd.org/doc/DWARF4.pdf. */
DW_TAG (DW_TAG_upc_shared_type, 0x8765)
DW_TAG (DW_TAG_upc_strict_type, 0x8766)