| 1442 | } |
| 1443 | |
| 1444 | CeDbgTypeInfo* CeDebugger::GetDbgTypeInfo(int typeId) |
| 1445 | { |
| 1446 | CeDbgTypeInfo* dbgTypeInfo = NULL; |
| 1447 | if (mDbgTypeInfoMap.TryAdd(typeId, NULL, &dbgTypeInfo)) |
| 1448 | { |
| 1449 | auto type = mCeMachine->mCeModule->mContext->FindTypeById(typeId); |
| 1450 | if (type == NULL) |
| 1451 | { |
| 1452 | mDbgTypeInfoMap.Remove(typeId); |
| 1453 | return NULL; |
| 1454 | } |
| 1455 | dbgTypeInfo->mType = type; |
| 1456 | |
| 1457 | auto typeInst = type->ToTypeInstance(); |
| 1458 | if (typeInst != NULL) |
| 1459 | { |
| 1460 | for (int fieldIdx = 0; fieldIdx < typeInst->mFieldInstances.mSize; fieldIdx++) |
| 1461 | { |
| 1462 | auto& fieldInst = typeInst->mFieldInstances[fieldIdx]; |
| 1463 | if (fieldInst.mDataIdx >= 0) |
| 1464 | { |
| 1465 | while (fieldInst.mDataIdx >= dbgTypeInfo->mFieldOffsets.mSize) |
| 1466 | dbgTypeInfo->mFieldOffsets.Add(CeDbgFieldEntry()); |
| 1467 | dbgTypeInfo->mFieldOffsets[fieldInst.mDataIdx].mType = fieldInst.mResolvedType; |
| 1468 | dbgTypeInfo->mFieldOffsets[fieldInst.mDataIdx].mDataOffset = fieldInst.mDataOffset; |
| 1469 | } |
| 1470 | |
| 1471 | if (fieldInst.mConstIdx != -1) |
| 1472 | { |
| 1473 | auto constant = typeInst->mConstHolder->GetConstantById(fieldInst.mConstIdx); |
| 1474 | if ((constant != NULL) && (BfIRConstHolder::IsInt(constant->mTypeCode))) |
| 1475 | { |
| 1476 | CeDbgTypeInfo::ConstIntEntry constIntEntry; |
| 1477 | constIntEntry.mFieldIdx = fieldIdx; |
| 1478 | constIntEntry.mVal = constant->mInt64; |
| 1479 | dbgTypeInfo->mConstIntEntries.Add(constIntEntry); |
| 1480 | } |
| 1481 | } |
| 1482 | } |
| 1483 | } |
| 1484 | } |
| 1485 | return dbgTypeInfo; |
| 1486 | } |
| 1487 | |
| 1488 | CeDbgTypeInfo* CeDebugger::GetDbgTypeInfo(BfIRType irType) |
| 1489 | { |
nothing calls this directly
no test coverage detected