Fix parsing of recoverable malformed datatypes

MSVC sometimes generates pdbs where there is an implied datatype such as
pointers `*` or arrays `[16]`. While the actual datatype is unknown,
Ghidra has undefined to cover this use case.

This avoids an error on PDB import which would have a cryptic message:
"Symbol list must contain at least one symbol name!" without any info
on what caused the issue.
This commit is contained in:
Alan Tse 2024-07-22 00:44:04 -07:00
parent a46009f287
commit d8ae172125

View File

@ -184,6 +184,17 @@ class PdbDataTypeParser {
String dataTypeName = datatype;
// Handle potential malformed datatypes where some datatype is implied
// *
// **
// [16]
if (dataTypeName.startsWith("*") || dataTypeName.startsWith("[")) {
// prepend undefined since intent is some datatype
Msg.warn(this, "dataTypeName \"" + dataTypeName +
"\" references a pointer or array without a declared datatype; assuming undefined");
dataTypeName = "undefined" + dataTypeName;
}
// Example type representations:
// char *[2][3] pointer(array(array(char,3),2))
// char *[2][3] * pointer(array(array(pointer(char),3),2))