2.3.2 CADIDisassemblerProtocol protocol

To support disassembly, implement all of these functions. None of them is optional.

These functions are in a different port, of type CADIDisassemblerProtocol, that can have any name and only need to be implemented when disassembly must be exposed in the debugger. The functionality of this port is then exposed by CADIProtocol::CADIGetDisassembler(). See CADIProtocol for information on how to use this port and CADIDisassemblerAdapter.

In the function slave behavior GetType(): eslapi::CADIDisassemblerType; components must always return eslapi::CADI_DISASSEMBLER_TYPE_STANDARD.

The function slave behavior GetModeCount(): uint32_t; returns the number of supported disassembler modes, and at least 1 mode must be returned.

The function slave behavior GetModeNames(eslapi::CADIDisassemblerCB *callback_); returns information about all supported modes. A component that only supports one mode calls, for example, callback_->ReceiveModeName(0, "Normal"); only once. This is similar for multiple modes with different names and Ids.

The function slave behavior GetCurrentMode(): uint32_t; returns the most suitable mode of disassembly at the time, based on the current state variables of the component:

For the function:

slave behavior GetSourceReferenceForAddress(eslapi::CADIDisassemblerCB *callback_, const eslapi::CADIAddr_t &address): eslapi::CADIDisassemblerStatus;

components must return eslapi::CADI_DISASSEMBLER_STATUS_ERROR;

For the function:

slave behavior GetAddressForSourceReference(const char *sourceFile, uint32_t sourceLine, eslapi::CADIAddr_t &address): eslapi::CADIDisassemblerStatus;

components must return eslapi::CADI_DISASSEMBLER_STATUS_ERROR;

The following function is the main disassembler function:

slave behavior GetDisassembly(eslapi::CADIDisassemblerCB *callback_,
                              const eslapi::CADIAddr_t &address,
                              eslapi::CADIAddr_t &nextAddr,
                              const uint32_t mode,
                              uint32_t desiredCount):
                              eslapi::CADIDisassemblerStatus;

The component must call callback_ for all disassembler lines for the specified address and desiredCount, and it must finally set nextAddr to the next disassembled address at that point after the requested block.

// Query if an instruction is a call instruction
    slave behavior GetInstructionType(const eslapi::CADIAddr_t &address, eslapi::CADIDisassemblerInstructionType &insn_type): eslapi::CADIDisassemblerStatus;

Components must return insn_type = eslapi::CADI_DISASSEMBLER_INSTRUCTION_TYPE_NOCALL; and return eslapi::CADI_DISASSEMBLER_STATUS_OK;

Non-ConfidentialPDF file icon PDF version100964_1161_00_en
Copyright © 2014–2019 Arm Limited or its affiliates. All rights reserved.