Пример #1
0
 std::vector<uint64> NascentModelCommandStream::GetInputInterface() const
 {
     std::vector<uint64> inputInterface(_transformationMachineOutputs.size());
     unsigned c=0;
     for (auto i=_transformationMachineOutputs.begin(); i!=_transformationMachineOutputs.end(); ++i, ++c)
         inputInterface[c] = Hash64(AsPointer(i->_name.begin()), AsPointer(i->_name.end()));
     return std::move(inputInterface);
 }
Пример #2
0
status_t
DwarfImageDebugInfo::GetType(GlobalTypeCache* cache,
	const BString& name, Type*& _type)
{
	int32 registerCount = fArchitecture->CountRegisters();
	const Register* registers = fArchitecture->Registers();

	// get the DWARF -> architecture register map
	RegisterMap* fromDwarfMap;
	status_t error = fArchitecture->GetDwarfRegisterMaps(NULL, &fromDwarfMap);
	if (error != B_OK)
		return error;
	Reference<RegisterMap> fromDwarfMapReference(fromDwarfMap, true);

	// create the target interface
	BasicTargetInterface inputInterface(registers, registerCount, fromDwarfMap,
		fArchitecture, fTeamMemory);

	// iterate through all compilation units
	for (int32 i = 0; CompilationUnit* unit = fFile->CompilationUnitAt(i);
		i++) {
		DwarfTypeContext* typeContext = NULL;
		Reference<DwarfTypeContext> typeContextReference;

		// iterate through all types of the compilation unit
		for (DebugInfoEntryList::ConstIterator it
				= unit->UnitEntry()->Types().GetIterator();
			DIEType* typeEntry = dynamic_cast<DIEType*>(it.Next());) {
			if (typeEntry->IsDeclaration())
				continue;

			BString typeEntryName;
			DwarfUtils::GetFullyQualifiedDIEName(typeEntry, typeEntryName);
			if (typeEntryName != name)
				continue;

			// The name matches and the entry is not just a declaration --
			// create the type. First create the type context lazily.
			if (typeContext == NULL) {
				typeContext = new(std::nothrow)
					DwarfTypeContext(fArchitecture, fImageInfo.ImageID(), fFile,
					unit, NULL, 0, 0, &inputInterface, fromDwarfMap);
				if (typeContext == NULL)
					return B_NO_MEMORY;
				typeContextReference.SetTo(typeContext, true);
			}

			// create the type
			DwarfType* type;
			DwarfTypeFactory typeFactory(typeContext, fTypeLookup, cache);
			error = typeFactory.CreateType(typeEntry, type);
			if (error != B_OK)
				continue;

			_type = type;
			return B_OK;
		}
	}

	return B_ENTRY_NOT_FOUND;
}