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

Method HandleCustomExpandedItems

IDEHelper/WinDebugger.cpp:8595–9043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8593}
8594
8595void WinDebugger::HandleCustomExpandedItems(String& retVal, DbgCompileUnit* dbgCompileUnit, DebugVisualizerEntry* debugVis, DbgType* dwUseType, DbgType* dwValueType, String& ptrUseDataStr, String& ptrDataStr, DbgTypedValue useTypedValue, Array<String>& dbgVisWildcardCaptures, DwFormatInfo& formatInfo)
8596{
8597 auto debugVisualizers = mDebugManager->mDebugVisualizers;
8598 auto dbgModule = dbgCompileUnit->mDbgModule;
8599
8600 if (formatInfo.mExpandItemDepth > 10) // Avoid crashing on circular ExpandItems
8601 return;
8602
8603 auto language = formatInfo.mLanguage;
8604
8605 bool isReadOnly = false;
8606 if (useTypedValue.mIsReadOnly)
8607 isReadOnly = true;
8608
8609 for (auto entry : debugVis->mExpandItems)
8610 {
8611 if (!entry->mCondition.empty())
8612 {
8613 String error;
8614 if (!EvalCondition(debugVis, dbgCompileUnit, useTypedValue, formatInfo, entry->mCondition, dbgVisWildcardCaptures, error))
8615 {
8616 if (!error.empty())
8617 retVal += "\n" + entry->mName + "\t@!<DbgVis Failed>@!";
8618 continue;
8619 }
8620 }
8621 String replacedStr = debugVisualizers->DoStringReplace(entry->mValue, dbgVisWildcardCaptures);
8622 retVal += "\n" + entry->mName + "\t" + replacedStr + ", this=(" + ptrUseDataStr + ")";
8623 }
8624
8625 String referenceId = dwUseType->ToString();
8626
8627 if (debugVis->mCollectionType == DebugVisualizerEntry::CollectionType_ExpandedItem)
8628 {
8629 DbgTypedValue itemValue = EvaluateInContext(dbgCompileUnit, useTypedValue, debugVisualizers->DoStringReplace(debugVis->mValuePointer, dbgVisWildcardCaptures), &formatInfo);
8630 if (itemValue)
8631 {
8632 DwFormatInfo itemFormatInfo = formatInfo;
8633 itemFormatInfo.mExpandItemDepth++;
8634 String itemRetVal = DbgTypedValueToString(itemValue, "", itemFormatInfo, NULL);
8635
8636 int crIdx = (int)itemRetVal.IndexOf('\n');
8637 if (crIdx != -1)
8638 {
8639 crIdx = (int)itemRetVal.IndexOf('\n', crIdx + 1);
8640 if (crIdx != -1)
8641 retVal += itemRetVal.Substring(crIdx);
8642 }
8643 }
8644 }
8645 else if (debugVis->mCollectionType == DebugVisualizerEntry::CollectionType_Array)
8646 {
8647 DbgTypedValue sizeValue = EvaluateInContext(dbgCompileUnit, useTypedValue, debugVisualizers->DoStringReplace(debugVis->mSize, dbgVisWildcardCaptures), &formatInfo);
8648 Array<int> lowerDimSizes;
8649 for (auto lowerDim : debugVis->mLowerDimSizes)
8650 {
8651 DbgTypedValue lowerDimValue = EvaluateInContext(dbgCompileUnit, useTypedValue, debugVisualizers->DoStringReplace(lowerDim, dbgVisWildcardCaptures), &formatInfo);
8652 int dimSize = 0;

Callers

nothing calls this directly

Calls 15

DecodeTargetDataPtrFunction · 0.85
DoStringReplaceMethod · 0.80
SubstringMethod · 0.80
GetInt64Method · 0.80
ToStringRawMethod · 0.80
RemoveModifiersMethod · 0.80
FindSubProgramMethod · 0.80
emptyMethod · 0.45
ToStringMethod · 0.45
IndexOfMethod · 0.45
IsIntegerMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected