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

Method GetDbgTypeInfo

IDEHelper/Compiler/CeDebugger.cpp:1444–1486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1442}
1443
1444CeDbgTypeInfo* 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
1488CeDbgTypeInfo* CeDebugger::GetDbgTypeInfo(BfIRType irType)
1489{

Callers

nothing calls this directly

Calls 9

CeDbgFieldEntryClass · 0.85
FindTypeByIdMethod · 0.80
GetConstantByIdMethod · 0.80
CreatePointerTypeMethod · 0.80
TryAddMethod · 0.45
RemoveMethod · 0.45
ToTypeInstanceMethod · 0.45
AddMethod · 0.45
IsObjectOrInterfaceMethod · 0.45

Tested by

no test coverage detected