summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Marie de Rodat <derodat@adacore.com>2018-03-14 13:51:19 (GMT)
committerPierre-Marie de Rodat <derodat@adacore.com>2018-03-23 18:02:51 (GMT)
commit2cf835ec3870fccb97757a7ad87593f116c6238b (patch)
treeb6d240ca3436e5f50af3f50e2d76123ffa85ca36
parentd3e00de86c2afafc1779c3e6f403d150e1df6538 (diff)
downloadcv2pdb-2cf835ec3870fccb97757a7ad87593f116c6238b.zip
cv2pdb-2cf835ec3870fccb97757a7ad87593f116c6238b.tar.gz
cv2pdb-2cf835ec3870fccb97757a7ad87593f116c6238b.tar.bz2
CV2PDB::addDWARFEnum: provide a default name for enumeration types
It seems that UDTs (User Defined Types) are required to have names, otherwise the resulting PDB type stream is considered to be corrupted. So just like what we do for structure types, provide a default type name for enumeration types.
-rw-r--r--src/dwarf2pdb.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dwarf2pdb.cpp b/src/dwarf2pdb.cpp
index 5c403a4..cb078e3 100644
--- a/src/dwarf2pdb.cpp
+++ b/src/dwarf2pdb.cpp
@@ -1259,10 +1259,11 @@ int CV2PDB::addDWARFEnum(DWARF_InfoData& enumid, DWARF_CompilationUnit* cu, DIEC
? getTypeByDWARFPtr(cu, enumid.type)
: getDWARFBasicType(enumid.encoding, enumid.byte_size);
dtype = (codeview_type*)(userTypes + cbUserTypes);
- cbUserTypes += addEnum(dtype, count, firstFieldlistType, 0, basetype, enumid.name);
+ const char* name = (enumid.name ? enumid.name : "__noname");
+ cbUserTypes += addEnum(dtype, count, firstFieldlistType, 0, basetype, name);
int enumType = nextUserType++;
- addUdtSymbol(enumType, enumid.name);
+ addUdtSymbol(enumType, name);
return enumType;
}