diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index f39abfe1..f1b3e570 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -12860,7 +12860,7 @@ namespace IDE deferredOutput.Append(param); } - else if (cmd == "error") + else if ((cmd == "error") || (cmd == "errorsoft")) { if ((mRunningTestScript) && (!IsCrashDump) && (!mScriptManager.IsErrorExpected(param, false))) mScriptManager.Fail(param); @@ -12944,7 +12944,7 @@ namespace IDE } OutputLineSmart(scope String("ERROR: ", scope String(errorMsg))); - if (gApp.mRunningTestScript) + if ((gApp.mRunningTestScript) || (cmd == "errorsoft")) { // The 'OutputLineSmart' would already call 'Fail' when running test scripts } diff --git a/IDEHelper/COFF.cpp b/IDEHelper/COFF.cpp index 3ea34ea0..83374d40 100644 --- a/IDEHelper/COFF.cpp +++ b/IDEHelper/COFF.cpp @@ -773,7 +773,7 @@ DbgSubprogram* COFF::CvParseMethod(DbgType* parentType, const char* methodName, } else { - Fail(StrFormat("Unhandled func type at tagId %d ipi %d", tagIdx, ipi)); + SoftFail(StrFormat("Unhandled func type at tagId %d ipi %d", tagIdx, ipi)); } @@ -996,6 +996,12 @@ void COFF::CvParseMembers(DbgType* parentType, int tagIdx, bool ipi) CvAutoReleaseTempData releaseTempData(this, listData); int16 trLeafType = GET_FROM(listData, int16); + if (trLeafType != LF_METHODLIST) + { + SoftFail("Invalid LF_METHOD member"); + return; + } + BF_ASSERT(trLeafType == LF_METHODLIST); for (int methodIdx = 0; methodIdx < count; methodIdx++) @@ -1178,7 +1184,8 @@ void COFF::CvParseMembers(DbgType* parentType, int tagIdx, bool ipi) } break; default: - HardFail(StrFormat("Unhandled leaf id 0x%X", leafType)); + SoftFail(StrFormat("Unhandled leaf id 0x%X", leafType)); + return; } PTR_ALIGN(data, sectionStart, 4); @@ -5831,6 +5838,11 @@ void COFF::Fail(const StringImpl& error) DbgModule::Fail(StrFormat("%s in %s", error.c_str(), mPDBPath.c_str())); } +void COFF::SoftFail(const StringImpl& error) +{ + DbgModule::SoftFail(StrFormat("%s in %s", error.c_str(), mPDBPath.c_str())); +} + void COFF::HardFail(const StringImpl& error) { DbgModule::HardFail(StrFormat("%s in %s", error.c_str(), mPDBPath.c_str())); @@ -6444,7 +6456,7 @@ intptr COFF::EvaluateLocation(DbgSubprogram* dwSubprogram, const uint8* locData, break; default: if (!mFailed) - Fail(StrFormat("Unknown symbol type '0x%X' in EvaluateLocation", symType)); + SoftFail(StrFormat("Unknown symbol type '0x%X' in EvaluateLocation", symType)); return 0; } @@ -7192,7 +7204,7 @@ void COFF::ParseFrameDescriptors(uint8* data, int size, addr_target baseAddr) else { failed = true; - Fail(StrFormat("Invalid COFF frame program: %s", curCmd.c_str())); + SoftFail(StrFormat("Invalid COFF frame program: %s", curCmd.c_str())); } } if (c == 0) diff --git a/IDEHelper/COFF.h b/IDEHelper/COFF.h index 83e6b13a..d3c83a1d 100644 --- a/IDEHelper/COFF.h +++ b/IDEHelper/COFF.h @@ -297,6 +297,7 @@ public: public: virtual void Fail(const StringImpl& error) override; + virtual void SoftFail(const StringImpl& error); virtual void HardFail(const StringImpl& error) override; virtual void ParseGlobalsData() override; diff --git a/IDEHelper/DbgModule.cpp b/IDEHelper/DbgModule.cpp index 15ecc0a5..e4599d43 100644 --- a/IDEHelper/DbgModule.cpp +++ b/IDEHelper/DbgModule.cpp @@ -2313,6 +2313,28 @@ void DbgModule::Fail(const StringImpl& error) mFailed = true; } +void DbgModule::SoftFail(const StringImpl& error) +{ + if (mFailMsgPtr != NULL) + { + if (mFailMsgPtr->IsEmpty()) + *mFailMsgPtr = error; + } + + String errorStr = "errorsoft "; + if (!mFilePath.IsEmpty()) + { + errorStr += "Error in "; + errorStr += mFilePath; + errorStr += ": "; + } + errorStr += error; + errorStr += "\n"; + + mDebugger->OutputRawMessage(errorStr); + mFailed = true; +} + void DbgModule::HardFail(const StringImpl& error) { if (mFailMsgPtr != NULL) diff --git a/IDEHelper/DbgModule.h b/IDEHelper/DbgModule.h index 0cf5f242..830a25fa 100644 --- a/IDEHelper/DbgModule.h +++ b/IDEHelper/DbgModule.h @@ -1232,8 +1232,9 @@ public: virtual addr_target LocateSymbol(const StringImpl& name) { return 0; } virtual DbgSubprogram* FindSubprogram(DbgType* dbgType, const char* methodName); const char* GetStringTable(DataStream* stream, int stringTablePos); - + virtual void Fail(const StringImpl& error); + virtual void SoftFail(const StringImpl& error); virtual void HardFail(const StringImpl& error); void FindTemplateStr(const char*& name, int& templateNameIdx); void TempRemoveTemplateStr(const char*& name, int& templateNameIdx); diff --git a/IDEHelper/WinDebugger.cpp b/IDEHelper/WinDebugger.cpp index b57ffb9b..74293aa1 100644 --- a/IDEHelper/WinDebugger.cpp +++ b/IDEHelper/WinDebugger.cpp @@ -9508,6 +9508,9 @@ static void PdbTestFile(WinDebugger* debugger, const StringImpl& path) coffFile.ParseTypeData(); coffFile.ParseSymbolData(); coffFile.ParseGlobalsData(); + + for (int i = 0; i < coffFile.mTypes.mSize; i++) + coffFile.mTypes[i]->PopulateType(); } static void PdbTest(WinDebugger* debugger, const StringImpl& path) @@ -9622,6 +9625,8 @@ String WinDebugger::Evaluate(const StringImpl& expr, DwFormatInfo formatInfo, in { PdbTest(this, "c:\\"); } + else if (cmd.StartsWith("!pdbtest ")) + PdbTestFile(this, cmd.Substring(9)); } }