aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2022-10-13 15:46:58 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-10-13 15:46:58 -0300
commitd85b86ecc1df40761320a177e79556ee9d574e13 (patch)
tree3f9fdf7aa6431ba8fbea255255566b5e84d84f09
parent7d0bc9334d2f1143a8682b141eda79f8be1bd5d2 (diff)
downloadpahole-d85b86ecc1df40761320a177e79556ee9d574e13.tar.gz
emit: Support DW_TAG_atomic_type when emitting definitions for a typedef
I.e. now this works: typedef unsigned int __uint32_t; typedef __uint32_t uint32_t; typedef _Atomic uint32_t atomic_uint32_t; That is, emitting the atomic_uint32_t works as it notices its _Atomic that points to uint32_t and then fprintfs it and __uint32_t. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--dwarves_emit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/dwarves_emit.c b/dwarves_emit.c
index 102b7c48..01b33b7e 100644
--- a/dwarves_emit.c
+++ b/dwarves_emit.c
@@ -161,6 +161,13 @@ static int typedef__emit_definitions(struct tag *tdef, struct cu *cu,
goto emit;
switch (type->tag) {
+ case DW_TAG_atomic_type:
+ type = cu__type(cu, tdef->type);
+ if (type)
+ tag__emit_definitions(type, cu, emissions, fp);
+ else
+ fprintf(stderr, "%s: couldn't find the type pointed from _Atomic for '%s'\n", __func__, type__name(def));
+ break;
case DW_TAG_array_type:
tag__emit_definitions(type, cu, emissions, fp);
break;