MCPcopy Create free account
hub / github.com/beefytech/Beef / HandleCustomExpandedItems

Method HandleCustomExpandedItems

IDEHelper/Compiler/CeDebugger.cpp:3835–4228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3833}
3834
3835void CeDebugger::HandleCustomExpandedItems(String& retVal, DebugVisualizerEntry* debugVis, BfTypedValue typedValue, addr_ce addr, addr_ce addrInst, Array<String>& dbgVisWildcardCaptures, CeFormatInfo& formatInfo)
3836{
3837 auto debugVisualizers = mDebugManager->mDebugVisualizers;
3838 auto ceModule = mCeMachine->mCeModule;
3839
3840 if (formatInfo.mExpandItemDepth > 10) // Avoid crashing on circular ExpandItems
3841 return;
3842
3843 bool isReadOnly = false;
3844// if (useTypedValue.mIsReadOnly)
3845// isReadOnly = true;
3846
3847 String ptrUseDataStr = StrFormat("%d@0x%X", typedValue.mType->mTypeId, addrInst);
3848
3849 for (auto entry : debugVis->mExpandItems)
3850 {
3851 if (!entry->mCondition.empty())
3852 {
3853 String error;
3854 if (!EvalCondition(debugVis, typedValue, formatInfo, entry->mCondition, dbgVisWildcardCaptures, error))
3855 {
3856 if (!error.empty())
3857 retVal += "\n" + entry->mName + "\t@!<DbgVis Failed>@!";
3858 continue;
3859 }
3860 }
3861 String replacedStr = debugVisualizers->DoStringReplace(entry->mValue, dbgVisWildcardCaptures);
3862 retVal += "\n" + entry->mName + "\t" + replacedStr + ", this=" + ptrUseDataStr;
3863 }
3864
3865 String referenceId = ceModule->TypeToString(typedValue.mType);
3866
3867 if (debugVis->mCollectionType == DebugVisualizerEntry::CollectionType_ExpandedItem)
3868 {
3869 BfTypedValue itemValue = EvaluateInContext(typedValue, debugVisualizers->DoStringReplace(debugVis->mValuePointer, dbgVisWildcardCaptures), &formatInfo);
3870 if (itemValue)
3871 {
3872 CeFormatInfo itemFormatInfo = formatInfo;
3873 itemFormatInfo.mExpandItemDepth++;
3874 String itemRetVal = TypedValueToString(itemValue, "", itemFormatInfo, NULL);
3875
3876 int crIdx = (int)itemRetVal.IndexOf('\n');
3877 if (crIdx != -1)
3878 {
3879 crIdx = (int)itemRetVal.IndexOf('\n', crIdx + 1);
3880 if (crIdx != -1)
3881 retVal += itemRetVal.Substring(crIdx);
3882 }
3883 }
3884 }
3885 else if (debugVis->mCollectionType == DebugVisualizerEntry::CollectionType_Array)
3886 {
3887 BfTypedValue sizeValue = EvaluateInContext(typedValue, debugVisualizers->DoStringReplace(debugVis->mSize, dbgVisWildcardCaptures), &formatInfo);
3888 Array<int> lowerDimSizes;
3889 for (auto lowerDim : debugVis->mLowerDimSizes)
3890 {
3891 BfTypedValue lowerDimValue = EvaluateInContext(typedValue, debugVisualizers->DoStringReplace(lowerDim, dbgVisWildcardCaptures), &formatInfo);
3892 int dimSize = 0;

Callers

nothing calls this directly

Calls 15

DecodeTargetDataPtrFunction · 0.85
DoStringReplaceMethod · 0.80
SubstringMethod · 0.80
CreatePointerTypeMethod · 0.80
emptyMethod · 0.45
TypeToStringMethod · 0.45
IndexOfMethod · 0.45
IsIntegerMethod · 0.45
push_backMethod · 0.45
IsEmptyMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected