Emulation Functions Reference

Arm Instruction Emulator (ArmIE) is based on the DynamoRIO dynamic binary instrumentation tool platform (DBI) and allows developers to use DynamoRIO’s API to write instrumentation clients which run alongside the SVE emulation client to analyse SVE binaries at runtime. This topic describes the emulation functions applicable to Arm Instruction Emulator. 

drmgr_is_emulation_start()

Checks the instruction instr to see if it is an emulation start label created by drmgr_insert_emulation_start(). Typically used in an instrumentation client running with an emulation client.

Syntax

bool drmgr_is_emulation_start ( instr_t* instr )

Returns

Returns true if instr is an emulation start label, false if it is not an emulation start label.


drmgr_is_emulation_end()

Checks the instruction instr to see if it is an emulation end label created by drmgr_insert_emulation_end(). Typically used in an instrumentation client running with an emulation client.

Syntax

bool drmgr_is_emulation_end ( instr_t* instr )

Returns

Returns true if instr is an emulation end label, false if it is not an emulation end label.


drmgr_get_emulated_instr_data()

Loads emulated with the emulated instruction data from instr set by drmgr_insert_emulation_start(). When calling this function, the size field of  emulated should be set using  sizeof(). This enables the API to check for compatibility.

Syntax

bool drmgr_get_emulated_instr_data ( instr_t* instr, emulated_instr_t* emulated )

Parameters

instr

Input parameter. The label instruction that specifies the start of emulation.

emulated

Output parameter. The emulated instruction data.

Returns

Returns false if the caller's emulated_instr_t is not compatible, true if it is compatible.


emulated_instr_t

Holds data about an emulated instruction, typically populated by an emulation client and read by an observational client.

Data fields:

size_t size
app_pc pc
instr_t* instr

The emulated instruction instr is part of the label represented by  emulated_instr_t and as such it will be freed when the label created by  drmgr_insert_emulation_start() is freed.

Syntax

typedef struct _emulated_instr_t emulated_instr_t

Fields

instr

The emulated instruction.

instr_t* _emulated_instr_t::instr

pc

The PC address of the emulated instruction.

app_pc _emulated_instr_t::pc

size

The size of this struct, used for API compatibility checks.

size_t _emulated_instr_t::size