|
From: <sv...@va...> - 2013-11-24 17:19:50
|
Author: mjw
Date: Sun Nov 24 17:19:35 2013
New Revision: 13718
Log:
Bug 327916 - DW_TAG_typedef may have no name
We already accepted DW_TAG_typedef without a name for Ada. But g++ for
OpenMP can also emit such nameless DW_TAG_typedefs. Just accept them.
Also fix up anonymous enum and typedef printing in tytypes.c.
Modified:
trunk/coregrind/m_debuginfo/readdwarf3.c
trunk/coregrind/m_debuginfo/tytypes.c
Modified: trunk/coregrind/m_debuginfo/readdwarf3.c
==============================================================================
--- trunk/coregrind/m_debuginfo/readdwarf3.c (original)
+++ trunk/coregrind/m_debuginfo/readdwarf3.c Sun Nov 24 17:19:35 2013
@@ -2926,19 +2926,17 @@
= cook_die_using_form( cc, (UWord)cts.u.val, form );
}
}
- /* Do we have something that looks sane? */
- if (/* must have a name */
- typeE.Te.TyTyDef.name == NULL
- /* However gcc gnat Ada generates minimal typedef
- such as the below => accept no name for Ada.
- <6><91cc>: DW_TAG_typedef
- DW_AT_abstract_ori: <9066>
- */
- && parser->language != 'A'
- /* but the referred-to type can be absent */)
- goto bad_DIE;
- else
- goto acquire_Type;
+ /* Do we have something that looks sane?
+ gcc gnat Ada generates minimal typedef
+ such as the below
+ <6><91cc>: DW_TAG_typedef
+ DW_AT_abstract_ori: <9066>
+ g++ for OMP can generate artificial functions that have
+ parameters that refer to pointers to unnamed typedefs.
+ See https://bugs.kde.org/show_bug.cgi?id=273475
+ So we cannot require a name for a DW_TAG_typedef.
+ */
+ goto acquire_Type;
}
if (dtag == DW_TAG_subroutine_type) {
Modified: trunk/coregrind/m_debuginfo/tytypes.c
==============================================================================
--- trunk/coregrind/m_debuginfo/tytypes.c (original)
+++ trunk/coregrind/m_debuginfo/tytypes.c Sun Nov 24 17:19:35 2013
@@ -265,8 +265,8 @@
VG_(printf)("&&");
break;
case Te_TyEnum:
- if (!ent->Te.TyEnum.name) goto unhandled;
- VG_(printf)("enum %s", ent->Te.TyEnum.name);
+ VG_(printf)("enum %s", ent->Te.TyEnum.name ? ent->Te.TyEnum.name
+ : "<anonymous>" );
break;
case Te_TyStOrUn:
VG_(printf)("%s %s",
@@ -287,8 +287,8 @@
}
break;
case Te_TyTyDef:
- if (!ent->Te.TyTyDef.name) goto unhandled;
- VG_(printf)("%s", ent->Te.TyTyDef.name);
+ VG_(printf)("%s", ent->Te.TyTyDef.name ? ent->Te.TyTyDef.name
+ : "<anonymous>" );
break;
case Te_TyFn:
VG_(printf)("%s", "<function_type>");
|