| 100 | |
| 101 | |
| 102 | DWORD CScriptObjectScript::Debug_Buckets_recursive( IScriptObject *pCurrent, string &sPath, std::set<const void *> &setVisited, |
| 103 | const DWORD dwMinBucket ) |
| 104 | { |
| 105 | assert(pCurrent); |
| 106 | |
| 107 | DWORD dwTableElementCount=0; |
| 108 | |
| 109 | pCurrent->BeginIteration(); |
| 110 | |
| 111 | while(pCurrent->MoveNext()) |
| 112 | { |
| 113 | char *szKeyName; |
| 114 | |
| 115 | dwTableElementCount++; |
| 116 | |
| 117 | if(!pCurrent->GetCurrentKey(szKeyName)) |
| 118 | szKeyName="NO"; |
| 119 | |
| 120 | ScriptVarType type=pCurrent->GetCurrentType(); |
| 121 | |
| 122 | if(type==svtObject) // svtNull,svtFunction,svtString,svtNumber,svtUserData,svtObject |
| 123 | { |
| 124 | const void *pVis; |
| 125 | |
| 126 | pCurrent->GetCurrentPtr(pVis); |
| 127 | |
| 128 | if(setVisited.count(pVis)!=0) |
| 129 | continue; |
| 130 | |
| 131 | setVisited.insert(pVis); |
| 132 | |
| 133 | { |
| 134 | IScriptObject *pNewObject = m_pScriptSystem->CreateEmptyObject(); |
| 135 | |
| 136 | pCurrent->GetCurrent(pNewObject); |
| 137 | |
| 138 | #if defined(LINUX) |
| 139 | string s = sPath+string("/")+szKeyName; |
| 140 | DWORD dwSubTableCount = Debug_Buckets_recursive(pNewObject,s,setVisited,dwMinBucket); |
| 141 | #else |
| 142 | DWORD dwSubTableCount = Debug_Buckets_recursive(pNewObject,sPath+string("/")+szKeyName,setVisited,dwMinBucket); |
| 143 | #endif |
| 144 | pNewObject->Release(); |
| 145 | |
| 146 | if(dwSubTableCount>=dwMinBucket) |
| 147 | { |
| 148 | GetISystem()->GetILog()->Log(" %8d '%s/%s'\n",dwSubTableCount,sPath.c_str(),szKeyName); |
| 149 | } |
| 150 | else dwTableElementCount+=dwSubTableCount; |
| 151 | } |
| 152 | } |
| 153 | /* else if(type==svtFunction) // svtNull,svtFunction,svtString,svtNumber,svtUserData,svtObject |
| 154 | { |
| 155 | unsigned int *pCode=0; |
| 156 | int iSize=0; |
| 157 | |
| 158 | if(pCurrent->GetCurrentFuncData(pCode,iSize)) |
| 159 | if(pCode) |
nothing calls this directly
no test coverage detected