| 1323 | } |
| 1324 | |
| 1325 | unsigned int FillVariableInfoTree(bool lastIsCurrent = false) |
| 1326 | { |
| 1327 | TreeView_DeleteAllItems(hVars); |
| 1328 | |
| 1329 | tiExtra.clear(); |
| 1330 | tiExtra.push_back(TreeItemExtra(NULL, NULL, 0, false)); |
| 1331 | |
| 1332 | TVINSERTSTRUCT helpInsert; |
| 1333 | helpInsert.hParent = NULL; |
| 1334 | helpInsert.hInsertAfter = TVI_ROOT; |
| 1335 | helpInsert.item.mask = TVIF_TEXT; |
| 1336 | helpInsert.item.cchTextMax = 0; |
| 1337 | |
| 1338 | unsigned int dataCount = ~0u; |
| 1339 | char *data = stateRemote ? RemoteData::stackData : (char*)nullcGetVariableData(&dataCount); |
| 1340 | |
| 1341 | unsigned int variableCount = stateRemote ? RemoteData::varCount : 0; |
| 1342 | unsigned int functionCount = stateRemote ? RemoteData::funcCount : 0; |
| 1343 | codeTypeCount = stateRemote ? RemoteData::typeCount : 0; |
| 1344 | codeVars = stateRemote ? RemoteData::vars : nullcDebugVariableInfo(&variableCount); |
| 1345 | codeTypes = stateRemote ? RemoteData::types : nullcDebugTypeInfo(&codeTypeCount); |
| 1346 | codeFunctions = stateRemote ? RemoteData::functions : nullcDebugFunctionInfo(&functionCount); |
| 1347 | codeLocals = stateRemote ? RemoteData::locals : nullcDebugLocalInfo(NULL); |
| 1348 | codeTypeExtra = stateRemote ? RemoteData::typeExtra : nullcDebugTypeExtraInfo(NULL); |
| 1349 | codeSymbols = stateRemote ? RemoteData::symbols : nullcDebugSymbols(NULL); |
| 1350 | |
| 1351 | char name[256]; |
| 1352 | unsigned int offset = 0; |
| 1353 | |
| 1354 | for(unsigned int i = 0; i < variableCount; i++) |
| 1355 | { |
| 1356 | ExternTypeInfo &type = codeTypes[codeVars[i].type]; |
| 1357 | |
| 1358 | char *it = name; |
| 1359 | memset(name, 0, 256); |
| 1360 | it += safeprintf(it, 256 - int(it - name), "0x%x: %s %s", data + codeVars[i].offset, codeSymbols + type.offsetToName, codeSymbols + codeVars[i].offsetToName); |
| 1361 | |
| 1362 | if(type.subCat == ExternTypeInfo::CAT_NONE || type.subCat == ExternTypeInfo::CAT_POINTER) |
| 1363 | it += safeprintf(it, 256 - int(it - name), " = %s", GetBasicVariableInfo(type, data + codeVars[i].offset)); |
| 1364 | else if(&type == &codeTypes[8]) // for typeid |
| 1365 | it += safeprintf(it, 256 - int(it - name), " = %s", codeSymbols + codeTypes[*(int*)(data + codeVars[i].offset)].offsetToName); |
| 1366 | |
| 1367 | helpInsert.item.mask = TVIF_TEXT | TVIF_CHILDREN | TVIF_PARAM; |
| 1368 | helpInsert.item.pszText = name; |
| 1369 | helpInsert.item.cChildren = type.subCat == ExternTypeInfo::CAT_POINTER ? I_CHILDRENCALLBACK : (type.subCat == ExternTypeInfo::CAT_NONE ? 0 : 1); |
| 1370 | helpInsert.item.lParam = tiExtra.size(); |
| 1371 | |
| 1372 | tiExtra.push_back(TreeItemExtra()); |
| 1373 | HTREEITEM lastItem = TreeView_InsertItem(hVars, &helpInsert); |
| 1374 | tiExtra.back() = TreeItemExtra(data + codeVars[i].offset, &type, lastItem, type.subCat == ExternTypeInfo::CAT_POINTER, codeSymbols + codeVars[i].offsetToName); |
| 1375 | |
| 1376 | FillVariableInfo(type, data + codeVars[i].offset, lastItem); |
| 1377 | |
| 1378 | if(codeVars[i].offset + type.size > offset) |
| 1379 | offset = codeVars[i].offset + type.size; |
| 1380 | } |
| 1381 | |
| 1382 | unsigned int codeLine = ~0u; |
no test coverage detected