3.4.2. CADIDisassemblerProtocol

The following 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. All these functions must be implemented if disassembly is supported. None of them is optional. 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):

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 should return insn_type = eslapi::CADI_DISASSEMBLER_INSTRUCTION_TYPE_NOCALL; and return eslapi::CADI_DISASSEMBLER_STATUS_OK;

See the Component Architecture Debug Interface v2.0 Developer Guide for the exact semantics of all the functions and parameters. The information in this section is intended only to provide additional information for the LISA component use case.

Copyright © 2008-2013 ARM. All rights reserved.ARM DUI 0423O