public void Setup() { _currAddress = CodeBaseAddress; _ram = new MemoryBlock(Size * 2); _memory = new MemoryManager(1ul << 16); _memory.IncrementReferenceCount(); _memory.Map(CodeBaseAddress, _ram.GetPointer(0, Size * 2), Size * 2); _context = CpuContext.CreateExecutionContext(); Translator.IsReadyForTranslation.Set(); _cpuContext = new CpuContext(_memory, for64Bit: true); // Prevent registering LCQ functions in the FunctionTable to avoid initializing and populating the table, // which improves test durations. Optimizations.AllowLcqInFunctionTable = false; Optimizations.UseUnmanagedDispatchLoop = false; if (_unicornAvailable) { _unicornEmu = new UnicornAArch64(); _unicornEmu.MemoryMap(CodeBaseAddress, Size, MemoryPermission.READ | MemoryPermission.EXEC); _unicornEmu.MemoryMap(DataBaseAddress, Size, MemoryPermission.READ | MemoryPermission.WRITE); _unicornEmu.PC = CodeBaseAddress; } }
public void Teardown() { _memory.Dispose(); _context.Dispose(); _ram.Dispose(); _memory = null; _context = null; _cpuContext = null; _unicornEmu = null; }
public void Teardown() { _memory.DecrementReferenceCount(); _context.Dispose(); _ram.Dispose(); _memory = null; _context = null; _cpuContext = null; _unicornEmu = null; _usingMemory = false; }
public void Setup() { _currAddress = CodeBaseAddress; _ram = new MemoryBlock(Size * 2); _memory = new MemoryManager(_ram, 1ul << 16); _memory.Map(CodeBaseAddress, 0, Size * 2); _context = CpuContext.CreateExecutionContext(); _cpuContext = new CpuContext(_memory); if (_unicornAvailable) { _unicornEmu = new UnicornAArch64(); _unicornEmu.MemoryMap(CodeBaseAddress, Size, MemoryPermission.READ | MemoryPermission.EXEC); _unicornEmu.MemoryMap(DataBaseAddress, Size, MemoryPermission.READ | MemoryPermission.WRITE); _unicornEmu.PC = CodeBaseAddress; } }
public void Setup() { _currAddress = 0x1000; _size = 0x1000; _entryPoint = _currAddress; _ram = new MemoryBlock(_size); _memory = new MemoryManager(_ram, 1UL << 16); _memory.Map(_currAddress, 0, _size); _context = CpuContext.CreateExecutionContext(); _cpuContext = new CpuContext(_memory); if (_unicornAvailable) { _unicornEmu = new UnicornAArch64(); _unicornEmu.MemoryMap(_currAddress, _size, MemoryPermission.READ | MemoryPermission.EXEC); _unicornEmu.PC = _entryPoint; } }
public void Setup() { _currAddress = CodeBaseAddress; _ram = new MemoryBlock(Size * 2); _memory = new MemoryManager(1ul << 16); _memory.IncrementReferenceCount(); _memory.Map(CodeBaseAddress, _ram.GetPointer(0, Size * 2), Size * 2); _context = CpuContext.CreateExecutionContext(); Translator.IsReadyForTranslation.Set(); _cpuContext = new CpuContext(_memory); if (_unicornAvailable) { _unicornEmu = new UnicornAArch64(); _unicornEmu.MemoryMap(CodeBaseAddress, Size, MemoryPermission.READ | MemoryPermission.EXEC); _unicornEmu.MemoryMap(DataBaseAddress, Size, MemoryPermission.READ | MemoryPermission.WRITE); _unicornEmu.PC = CodeBaseAddress; } }