diff --git a/IDEHelper/COFF.cpp b/IDEHelper/COFF.cpp index 129a76a7..a5907124 100644 --- a/IDEHelper/COFF.cpp +++ b/IDEHelper/COFF.cpp @@ -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); diff --git a/IDEHelper/DbgModule.cpp b/IDEHelper/DbgModule.cpp index 368a728a..c4eebfd9 100644 --- a/IDEHelper/DbgModule.cpp +++ b/IDEHelper/DbgModule.cpp @@ -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); diff --git a/IDEHelper/DbgModule.h b/IDEHelper/DbgModule.h index a4c9b925..18731463 100644 --- a/IDEHelper/DbgModule.h +++ b/IDEHelper/DbgModule.h @@ -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);