1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Improved some PDB failure cases

This commit is contained in:
Brian Fiete 2022-01-18 06:41:34 -05:00
parent bf5c19269b
commit b2eac81857
3 changed files with 24 additions and 2 deletions

View file

@ -764,7 +764,7 @@ DbgSubprogram* COFF::CvParseMethod(DbgType* parentType, const char* methodName,
}
else
{
BF_FATAL("Unhandled func type");
Fail(StrFormat("Unhandled func type at tagId %d ipi %d", tagIdx, ipi));
}
@ -1169,7 +1169,7 @@ void COFF::CvParseMembers(DbgType* parentType, int tagIdx, bool ipi)
}
break;
default:
BF_FATAL("Unhandled");
HardFail(StrFormat("Unhandled leaf id 0x%X", leafType));
}
PTR_ALIGN(data, sectionStart, 4);

View file

@ -2312,6 +2312,27 @@ void DbgModule::Fail(const StringImpl& error)
mFailed = true;
}
void DbgModule::HardFail(const StringImpl& error)
{
if (mFailMsgPtr != NULL)
{
if (mFailMsgPtr->IsEmpty())
*mFailMsgPtr = error;
}
String errorStr;
if (!mFilePath.IsEmpty())
{
errorStr += "Error in ";
errorStr += mFilePath;
errorStr += ": ";
}
errorStr += error;
errorStr += "\n";
BF_FATAL(errorStr.c_str());
}
char* DbgModule::DbgDupString(const char* str, const char* allocName)
{
int strLen = (int)strlen(str);

View file

@ -1232,6 +1232,7 @@ public:
const char* GetStringTable(DataStream* stream, int stringTablePos);
void Fail(const StringImpl& error);
void HardFail(const StringImpl& error);
void FindTemplateStr(const char*& name, int& templateNameIdx);
void TempRemoveTemplateStr(const char*& name, int& templateNameIdx);
void ReplaceTemplateStr(const char*& name, int& templateNameIdx);