debug_symbol_file follower_agent
API Reference Manual  /  7 Simulator-to-Simulator Interfaces  / 

disassemble

Description
The disassemble interface can be used to disassemble code from a buffer in memory. It is typically used to disassemble code for the host architecture independent of the target architecture implemented in a particular version of Simics.

SIM_INTERFACE(disassemble) {
        /* Set up new block to disassemble */
        void (*init)(conf_object_t *obj, uint8 *buff,
                     int buff_len, uint64 address);
        /* Disassemble the next instruction */
        disasm_instr_t (*next)(conf_object_t *obj);
};

#define DISASSEMBLE_INTERFACE "disassemble"

init() is used to initialize a new disassemble session. You should provide a buffer in buff, the buffer length in bytes in buff_len and the base address for this chunk in address. The address parameter is used to calculate program counter relative offsets (for branches and other program counter relative constructs).

typedef struct {
        int start;          /* Where the instructions starts in the buffer */
        int length;         /* Length of instruction, or -1 if incomplete */
        char *string;       /* Disassembly string (allocated) */
} disasm_instr_t;

next() returns a structure with the next disassembled instruction. Repeated use of next() will disassemble additional instructions.

Execution Context
Cell Context for all methods.

debug_symbol_file follower_agent