aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2022-02-02 17:39:36 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-02-02 17:39:36 -0300
commit6afc296eeb180e25f3a8adf10762c0850a8ae9fa (patch)
treef0e60b26c08a2bd900049ad786771cb71911954b
parent49a2dd657728675b019f7d4a2028d5f47f33f9d7 (diff)
downloadpahole-6afc296eeb180e25f3a8adf10762c0850a8ae9fa.tar.gz
emit: Fix printing typedef of nameless struct/union
E.g: typedef struct { __u8 b[16]; /* 0 16 */ /* size: 16, cachelines: 1, members: 1 */ /* last cacheline: 16 bytes */ } guid_t; typedef guid_t efi_guid_t; Before we were not emitting the guid_t typedef, fix it. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--dwarves_emit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/dwarves_emit.c b/dwarves_emit.c
index 5bf7946c..deb8c695 100644
--- a/dwarves_emit.c
+++ b/dwarves_emit.c
@@ -165,9 +165,8 @@ static int typedef__emit_definitions(struct tag *tdef, struct cu *cu,
struct type *ctype = tag__type(type);
if (type__name(ctype) == NULL) {
- if (type__emit_definitions(type, cu, emissions, fp))
- type__emit(type, cu, "typedef",
- type__name(def), fp);
+ type__emit_definitions(type__tag(ctype), cu, emissions, fp);
+ type__emit(type__tag(ctype), cu, "typedef", type__name(def), fp);
goto out;
} else if (type__emit_definitions(type, cu, emissions, fp))
type__emit(type, cu, NULL, NULL, fp);