diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index 91c8e99b..b3bec8fa 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -19115,7 +19115,8 @@ var_decl::get_pretty_representation(bool internal, bool qualified_name) const
(is_class_or_union_type(get_type()),
"", /*one_line=*/true, internal);
result += " ";
- if (member_of_anonymous_class || !qualified_name)
+ if (!internal
+ && (member_of_anonymous_class || !qualified_name))
// It doesn't make sense to name the member of an
// anonymous class or union like:
// "__anonymous__::data_member_name". So let's just use
@@ -19130,7 +19131,8 @@ var_decl::get_pretty_representation(bool internal, bool qualified_name) const
get_type_declaration(get_type())->get_qualified_name(internal)
+ " ";
- if (member_of_anonymous_class || !qualified_name)
+ if (!internal
+ && (member_of_anonymous_class || !qualified_name))
// It doesn't make sense to name the member of an
// anonymous class or union like:
// "__anonymous__::data_member_name". So let's just use
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
index 782dd7f3..94f3c7bc 100644
--- a/tests/data/Makefile.am
+++ b/tests/data/Makefile.am
@@ -599,6 +599,9 @@ test-read-dwarf/test-libaaudio.so.abi \
test-read-dwarf/PR28584/PR28584-smv.cc \
test-read-dwarf/PR28584/PR28584-smv.clang.o \
test-read-dwarf/PR28584/PR28584-smv.clang.o.abi \
+tests/data/test-read-dwarf/PR29443-missing-xx.cc \
+tests/data/test-read-dwarf/PR29443-missing-xx.o \
+tests/data/test-read-dwarf/PR29443-missing-xx.o.abi \
\
test-read-ctf/test0 \
test-read-ctf/test0.abi \
@@ -714,6 +717,7 @@ test-annotate/libtest24-drop-fns.so.abi \
test-annotate/test-anonymous-members-0.cc \
test-annotate/test-anonymous-members-0.o \
test-annotate/test-anonymous-members-0.o.abi \
+tests/data/test-annotate/PR29443-missing-xx.o.annotated.abi \
\
test-types-stability/pr19434-elf0 \
test-types-stability/pr19139-DomainNeighborMapInst.o \
diff --git a/tests/data/test-annotate/PR29443-missing-xx.o.annotated.abi b/tests/data/test-annotate/PR29443-missing-xx.o.annotated.abi
new file mode 100644
index 00000000..dde6a745
--- /dev/null
+++ b/tests/data/test-annotate/PR29443-missing-xx.o.annotated.abi
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/data/test-read-dwarf/PR29443-missing-xx.cc b/tests/data/test-read-dwarf/PR29443-missing-xx.cc
new file mode 100644
index 00000000..e9e53583
--- /dev/null
+++ b/tests/data/test-read-dwarf/PR29443-missing-xx.cc
@@ -0,0 +1,8 @@
+struct A {
+ struct {
+ int xx;
+ };
+};
+
+struct A a;
+int xx;
diff --git a/tests/data/test-read-dwarf/PR29443-missing-xx.o b/tests/data/test-read-dwarf/PR29443-missing-xx.o
new file mode 100644
index 00000000..681c958f
Binary files /dev/null and b/tests/data/test-read-dwarf/PR29443-missing-xx.o differ
diff --git a/tests/data/test-read-dwarf/PR29443-missing-xx.o.abi b/tests/data/test-read-dwarf/PR29443-missing-xx.o.abi
new file mode 100644
index 00000000..5c5e4f96
--- /dev/null
+++ b/tests/data/test-read-dwarf/PR29443-missing-xx.o.abi
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/test-annotate.cc b/tests/test-annotate.cc
index 750f5e88..b8a1ee75 100644
--- a/tests/test-annotate.cc
+++ b/tests/test-annotate.cc
@@ -131,6 +131,11 @@ InOutSpec in_out_specs[] =
"data/test-annotate/test-anonymous-members-0.o.abi",
"output/test-annotate/test-anonymous-members-0.o.abi",
},
+ {
+ "data/test-read-dwarf/PR29443-missing-xx.o",
+ "data/test-annotate/PR29443-missing-xx.o.annotated.abi",
+ "output/test-annotate/PR29443-missing-xx.o.annotated.abi",
+ },
// This should be the last entry.
{NULL, NULL, NULL}
};
diff --git a/tests/test-read-dwarf.cc b/tests/test-read-dwarf.cc
index 0de4bdd1..0227c89b 100644
--- a/tests/test-read-dwarf.cc
+++ b/tests/test-read-dwarf.cc
@@ -488,6 +488,14 @@ static InOutSpec in_out_specs[] =
"data/test-read-dwarf/PR28584/PR28584-smv.clang.o.abi",
"output/test-read-dwarf/PR28584/PR28584-smv.clang.o.abi",
},
+ {
+ "data/test-read-dwarf/PR29443-missing-xx.o",
+ "",
+ "",
+ SEQUENCE_TYPE_ID_STYLE,
+ "data/test-read-dwarf/PR29443-missing-xx.o.abi",
+ "output/test-read-dwarf/PR29443-missing-xx.o.abi",
+ },
// This should be the last entry.
{NULL, NULL, NULL, SEQUENCE_TYPE_ID_STYLE, NULL, NULL}
};