public abstract class AbstractBackend extends Object implements Backend
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractBackend.BreakPointImpl |
| Constructor and Description |
|---|
AbstractBackend() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkVectorRegId(int regId,
boolean is64Bit) |
protected static int |
decodeSWI(Emulator<?> emulator,
Backend backend,
boolean is64Bit) |
protected void |
enableVFP(boolean is64Bit) |
Map<String,Integer> |
getCpuFeatures()
Returns the CPU feature flags supported by the backend.
|
long |
getMemAllocatedSize()
Returns the total virtual memory size allocated via
Backend.mem_map(long, long, int). |
long |
getMemResidentSize()
Returns the actual physical memory resident in RAM.
|
int |
getPageSize()
Returns the memory page size used by this backend.
|
void |
onInitialize()
Called after the backend is constructed to perform any additional initialization,
such as mapping exception vector tables (hypervisor) or setting up initial CPU state.
|
void |
registerEmuCountHook(long emu_count)
Registers a hook that stops emulation after the specified number of instructions
have been executed.
|
void |
removeJitCodeCache(long begin,
long end)
Invalidates the JIT code cache for the specified address range.
|
protected void |
switchUserMode(boolean is64Bit) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddBreakPoint, context_alloc, context_free, context_restore, context_save, debugger_add, destroy, emu_start, emu_stop, enableVFP, hook_add_new, hook_add_new, hook_add_new, hook_add_new, hook_add_new, hook_add_new, isHypervisor, mem_map, mem_protect, mem_read, mem_unmap, mem_write, reg_read_vector, reg_read, reg_write_vector, reg_write, removeBreakPoint, setFastDebug, setSingleStep, switchUserModeprotected void switchUserMode(boolean is64Bit)
protected void enableVFP(boolean is64Bit)
protected static void checkVectorRegId(int regId,
boolean is64Bit)
public void onInitialize()
BackendonInitialize in interface Backendpublic int getPageSize()
BackendgetPageSize in interface Backendpublic void registerEmuCountHook(long emu_count)
BackendregisterEmuCountHook in interface Backendemu_count - maximum number of instructions before the hook fires; must be > 0public void removeJitCodeCache(long begin,
long end)
throws BackendException
BackendremoveJitCodeCache in interface Backendbegin - start address of the range (inclusive)end - end address of the range (exclusive)BackendException - if the operation failspublic Map<String,Integer> getCpuFeatures()
Backendarm64_features hw.optional.floatingpoint hw.optional.AdvSIMD hw.optional.arm.AdvSIMD hw.optional.arm.FEAT_AES hw.optional.arm.FEAT_PMULL hw.optional.arm.FEAT_SHA1 hw.optional.arm.FEAT_SHA256 hw.optional.armv8_crc32 hw.optional.arm.FEAT_LSE hw.optional.arm.FEAT_FP16 hw.optional.arm.AdvSIMD_HPFPCvt hw.optional.arm.FEAT_RDM hw.optional.arm.FEAT_JSCVT hw.optional.arm.FEAT_FCMA hw.optional.arm.FEAT_LRCPC hw.optional.arm.FEAT_DPB hw.optional.arm.FEAT_SHA3 hw.optional.arm.FEAT_DotProd hw.optional.arm.FEAT_SHA512 hw.optional.arm.FEAT_FHM hw.optional.arm.FEAT_DIT hw.optional.arm.FEAT_LSE2 hw.optional.arm.FEAT_FlagM hw.optional.arm.FEAT_SSBS hw.optional.arm.FEAT_SB hw.optional.arm.FEAT_FlagM2 hw.optional.arm.FEAT_FRINTTS hw.optional.arm.FEAT_I8MM hw.optional.arm.FEAT_BF16 hw.optional.arm.FEAT_BTI
getCpuFeatures in interface Backendpublic long getMemAllocatedSize()
BackendBackend.mem_map(long, long, int).
This is the sum of all mapped pages tracked by the backend's native memory hash table.
For unicorn2, this is computed from uc_mem_regions().
getMemAllocatedSize in interface Backendpublic long getMemResidentSize()
Backend
On macOS/Linux, this uses mincore() to check which pages are actually
backed by physical memory, since mmap(MAP_ANONYMOUS) allocates lazily.
Only pages that have been read from or written to will be counted.
On Windows (dynarmic) and unicorn2 (QEMU-based), host memory pointers are not
accessible, so this returns the same value as Backend.getMemAllocatedSize().
getMemResidentSize in interface BackendCopyright © 2026. All rights reserved.