Blob Blame History Raw
From 145fd522e786962dd00f946c574a8d59daf945b4 Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Tue, 4 Oct 2022 18:19:46 -0300
Subject: [PATCH 2/7] btf_encoder: Add extra debug info for unsupported DWARF
 tags

Recently we got a report of DW_TAG_unspecified_type triggering this
warning:

[ 1413s]   BTF     .btf.vmlinux.bin.o
[ 1413s] Unsupported DW_TAG_unspecified_type(0x3b)
[ 1413s] Encountered error while encoding BTF.

Probably tag->type is zero, but would be great to have this offhand, add
that info to the error message.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 btf_encoder.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/btf_encoder.c b/btf_encoder.c
index daa8e3b507d4a856..babeefa0dc51e62b 100644
--- a/btf_encoder.c
+++ b/btf_encoder.c
@@ -940,8 +940,8 @@ static int btf_encoder__encode_tag(struct btf_encoder *encoder, struct tag *tag,
 	case DW_TAG_subroutine_type:
 		return btf_encoder__add_func_proto(encoder, tag__ftype(tag), type_id_off);
 	default:
-		fprintf(stderr, "Unsupported DW_TAG_%s(0x%x)\n",
-			dwarf_tag_name(tag->tag), tag->tag);
+		fprintf(stderr, "Unsupported DW_TAG_%s(0x%x): type: 0x%x\n",
+			dwarf_tag_name(tag->tag), tag->tag, ref_type_id);
 		return -1;
 	}
 }
-- 
2.39.1