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

Method GetLinkedListItems

IDEHelper/Compiler/CeDebugger.cpp:2077–2129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2075}
2076
2077String CeDebugger::GetLinkedListItems(DebugVisualizerEntry* debugVis, addr_ce endNodePtr, BfType* valueType, BfTypedValue& curNode, int& count, String* outContinuationData)
2078{
2079 CeEvaluationContext nextEvaluationContext(this, debugVis->mNextPointer);
2080 CeEvaluationContext valueEvaluationContext(this, debugVis->mValuePointer);
2081 auto ceModule = mCeMachine->mCeModule;
2082
2083 String addrs;
2084
2085 bool checkLeft = true;
2086
2087 int mapIdx;
2088 for (mapIdx = 0; mapIdx < count; mapIdx++)
2089 {
2090 CeTypedValue ceNodeVal = GetAddr(curNode);
2091 if (!ceNodeVal)
2092 break;
2093
2094 if (ceNodeVal.mAddr == endNodePtr)
2095 break;
2096 BfTypedValue val = valueEvaluationContext.EvaluateInContext(curNode);
2097 if (!val)
2098 break;
2099
2100 auto ceVal = GetAddr(val);
2101 if (!ceVal)
2102 break;
2103 if (ceVal.mAddr == 0)
2104 break;
2105
2106 if (valueType == NULL)
2107 {
2108 String typeAddr = StrFormat("comptype(%d)", val.mType->mTypeId);
2109 // RPad
2110 typeAddr.Append(' ', sizeof(addr_ce) * 2 - (int)typeAddr.length());
2111 addrs += typeAddr;
2112 }
2113
2114 String addr = EncodeDataPtr((addr_ce)ceVal.mAddr, false);
2115 addrs += addr;
2116
2117 curNode = nextEvaluationContext.EvaluateInContext(curNode);
2118 }
2119 count = mapIdx;
2120
2121 if (outContinuationData != NULL)
2122 {
2123 CeTypedValue ceNodeVal = GetAddr(curNode);
2124 *outContinuationData += EncodeDataPtr(debugVis, false) + EncodeDataPtr(endNodePtr, false) + EncodeDataPtr(valueType, false) +
2125 EncodeDataPtr(curNode.mType, false) + EncodeDataPtr((addr_ce)ceNodeVal.mAddr, false);
2126 }
2127
2128 return addrs;
2129}
2130
2131String CeDebugger::GetDictionaryItems(DebugVisualizerEntry* debugVis, BfTypedValue dictValue, int bucketIdx, int nodeIdx, int& count, String* outContinuationData)
2132{

Callers

nothing calls this directly

Calls 3

AppendMethod · 0.80
EvaluateInContextMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected