| 2129 | } |
| 2130 | |
| 2131 | String CeDebugger::GetDictionaryItems(DebugVisualizerEntry* debugVis, BfTypedValue dictValue, int bucketIdx, int nodeIdx, int& count, String* outContinuationData) |
| 2132 | { |
| 2133 | CeEvaluationContext nextEvaluationContext(this, debugVis->mNextPointer); |
| 2134 | auto ceModule = mCeMachine->mCeModule; |
| 2135 | |
| 2136 | BfTypedValue bucketsPtr = EvaluateInContext(dictValue, debugVis->mBuckets); |
| 2137 | BfTypedValue entriesPtr = EvaluateInContext(dictValue, debugVis->mEntries); |
| 2138 | if ((!bucketsPtr) || (!entriesPtr)) |
| 2139 | { |
| 2140 | count = -1; |
| 2141 | return ""; |
| 2142 | } |
| 2143 | |
| 2144 | auto ceDictTypedVal = GetAddr(dictValue); |
| 2145 | if (!ceDictTypedVal) |
| 2146 | return ""; |
| 2147 | |
| 2148 | auto ceBucketsTypedVal = GetAddr(bucketsPtr); |
| 2149 | if (!ceBucketsTypedVal) |
| 2150 | return ""; |
| 2151 | |
| 2152 | String addrs; |
| 2153 | |
| 2154 | if ((!entriesPtr) || (!entriesPtr.mType->IsPointer())) |
| 2155 | return ""; |
| 2156 | if ((!bucketsPtr) || (!bucketsPtr.mType->IsPointer())) |
| 2157 | return ""; |
| 2158 | |
| 2159 | auto entryType = entriesPtr.mType->GetUnderlyingType(); |
| 2160 | int entrySize = entryType->GetStride(); |
| 2161 | int bucketIdxSize = bucketsPtr.mType->GetUnderlyingType()->GetStride(); |
| 2162 | |
| 2163 | auto ceElemTypedVal = GetAddr(entriesPtr); |
| 2164 | if (!ceElemTypedVal) |
| 2165 | return ""; |
| 2166 | |
| 2167 | bool checkLeft = true; |
| 2168 | |
| 2169 | int encodeCount = 0; |
| 2170 | while (encodeCount < count) |
| 2171 | { |
| 2172 | if (nodeIdx != -1) |
| 2173 | { |
| 2174 | addr_ce entryAddr = (addr_ce)ceElemTypedVal.mAddr + (nodeIdx * entrySize); |
| 2175 | |
| 2176 | BfTypedValue entryValue = BfTypedValue(ceModule->mBfIRBuilder->CreateConstAggCE(ceModule->mBfIRBuilder->MapType(entryType), entryAddr), entryType); |
| 2177 | addrs += EncodeDataPtr(entryAddr, false); |
| 2178 | |
| 2179 | BfTypedValue nextValue = nextEvaluationContext.EvaluateInContext(entryValue); |
| 2180 | if ((!nextValue) || (!nextValue.mType->IsInteger())) |
| 2181 | { |
| 2182 | break; |
| 2183 | } |
| 2184 | |
| 2185 | nodeIdx = (int)ValueToInt(nextValue); |
| 2186 | encodeCount++; |
| 2187 | } |
| 2188 | else |
nothing calls this directly
no test coverage detected