| 1258 | } |
| 1259 | |
| 1260 | String WinDebugger::GetDbgAllocInfo() |
| 1261 | { |
| 1262 | AutoCrit autoCrit(mDebugManager->mCritSect); |
| 1263 | |
| 1264 | for (auto threadInfo : mThreadList) |
| 1265 | ::SuspendThread(threadInfo->mHThread); |
| 1266 | |
| 1267 | delete mHotResolveData; |
| 1268 | mHotResolveData = NULL; |
| 1269 | |
| 1270 | mHotResolveData = new DbgHotResolveData(); |
| 1271 | DbgHotScanner* hotScanner = new DbgHotScanner(this); |
| 1272 | hotScanner->Scan((DbgHotResolveFlags)(DbgHotResolveFlag_Allocations | DbgHotResolveFlag_KeepThreadState)); |
| 1273 | delete hotScanner; |
| 1274 | |
| 1275 | String result; |
| 1276 | |
| 1277 | if (mHotResolveData != NULL) |
| 1278 | { |
| 1279 | DbgExprEvaluator exprEvaluator(this, NULL, NULL, -1, -1); |
| 1280 | exprEvaluator.mDebugTarget = mDebugTarget; |
| 1281 | |
| 1282 | String typeName; |
| 1283 | |
| 1284 | result += ":types\n"; |
| 1285 | |
| 1286 | for (int typeId = 0; typeId < mHotResolveData->mTypeData.size(); typeId++) |
| 1287 | { |
| 1288 | auto& typeData = mHotResolveData->mTypeData[typeId]; |
| 1289 | if (typeData.mCount > 0) |
| 1290 | { |
| 1291 | auto type = exprEvaluator.GetBeefTypeById(typeId); |
| 1292 | typeName.Clear(); |
| 1293 | exprEvaluator.BeefTypeToString(type, typeName); |
| 1294 | if (typeName.IsEmpty()) |
| 1295 | typeName = StrFormat("Type #%d", typeId); |
| 1296 | result += StrFormat("type\t%d\t%s\t%lld\t%lld\n", typeId, typeName.c_str(), typeData.mCount, typeData.mSize); |
| 1297 | } |
| 1298 | } |
| 1299 | } |
| 1300 | |
| 1301 | for (auto threadInfo : mThreadList) |
| 1302 | ::ResumeThread(threadInfo->mHThread); |
| 1303 | |
| 1304 | return result; |
| 1305 | } |
| 1306 | |
| 1307 | static bool CreatePipeWithSecurityAttributes(HANDLE& hReadPipe, HANDLE& hWritePipe, SECURITY_ATTRIBUTES* lpPipeAttributes, int32 nSize) |
| 1308 | { |
no test coverage detected