| 8593 | } |
| 8594 | |
| 8595 | void 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; |
nothing calls this directly
no test coverage detected