[RFC dwarves 1/6] btf_loader: Make BTF representation match DWARF

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

 



The function prototype representation for BTF needs to be modified to
fit with the DWARF-generated one.

Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
---
 btf_loader.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/btf_loader.c b/btf_loader.c
index 64ea680..42bca92 100644
--- a/btf_loader.c
+++ b/btf_loader.c
@@ -84,6 +84,8 @@ out_free_parameters:
 static int create_new_function(struct cu *cu, const struct btf_type *tp, uint32_t id)
 {
 	struct function *func = tag__alloc(sizeof(*func));
+	struct btf *btf = cu->priv;
+	const struct btf_type *t;
 
 	if (func == NULL)
 		return -ENOMEM;
@@ -95,7 +97,9 @@ static int create_new_function(struct cu *cu, const struct btf_type *tp, uint32_
 	func->proto.tag.type = tp->type;
 	func->name = cu__btf_str(cu, tp->name_off);
 	INIT_LIST_HEAD(&func->lexblock.tags);
-	cu__add_tag_with_id(cu, &func->proto.tag, id);
+	INIT_LIST_HEAD(&func->annots);
+	t = btf__type_by_id(btf, tp->type);
+	cu__load_ftype(cu, &func->proto, DW_TAG_subprogram, t, id);
 
 	return 0;
 }
@@ -124,6 +128,7 @@ static void type__init(struct type *type, uint32_t tag, const char *name, size_t
 	type->size = size;
 	type->namespace.tag.tag = tag;
 	type->namespace.name = name;
+	INIT_LIST_HEAD(&type->namespace.annots);
 	type->template_parameter_pack = NULL;
 }
 
-- 
2.43.5





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux