A.10.1 CADIDisassembler class definition

If a component supports disassembly, the Disassembly API can be used to display the disassembly during a simulation.

CAUTION:

ARM deprecates obtaining a disassembler from the CADI interface by calling CADIGetDissambler(). The function is retained to enable compatibility with CADI 1.1. New code must use the ObtainInterface() call for both disassembler and profiling support.

Note:

A program memory space must exist to use the disassembly feature.
class CADIDisassembler  : public CAInterface  
{
public:
    static if_name_t IFNAME() { return "eslapi.CADIDisassembler2"; }
    static if_rev_t IFREVISION() { return 0; }
    // Two types: distinguish standard and history type.
    virtual CADIDisassemblerType GetType() const = 0;
    // Support for multiple modes (e.g. 32-bit versus 16-bit mode).
    virtual uint32_t GetModeCount() const = 0;
    virtual void GetModeNames(CADIDisassemblerCB *callback) = 0;
    virtual uint32_t GetCurrentMode() = 0;
    virtual CADIDisassemblerStatus GetSourceReferenceForAddress(
        CADIDisassemblerCB *callback, const CADIAddr_t &address) = 0;
    virtual CADIDisassemblerStatus GetAddressForSourceReference(
        const char *sourceFile, uint32_t sourceLine, CADIAddr_t &address) = 0
    //    Function for standard type disassembly.
    virtual CADIDisassemblerStatus GetDisassembly(CADIDisassemblerCB *callback,
        const CADIAddr_t &address, CADIAddr_t &nextAddr, const uint32_t mode,
        uint32_t desiredCount = 1) = 0;
    // Query if an instruction is a call instruction.
    virtual CADIDisassemblerStatus GetInstructionType(const CADIAddr_t &address,
        CADIDisassemblerInstructionType &insn_type) = 0;
    // A default minimum implementation, to provide backwards-compatibility.
    // This implementation assumes that there will be no other interfaces
    // implemented on the component providing CADIDisassembler.
    virtual CAInterface *ObtainInterface(if_name_t ifName, if_rev_t minRev,
         if_rev_t *actualRev)
        {
            if((strcmp(ifName,IFNAME()) == 0) && (minRev <= IFREVISION()))
           {
                if (actualRev) // make sure this is not a NULL pointer
                {
                    *actualRev = IFREVISION();
                }
               return this;
            }
            if((strcmp(ifName, CAInterface::IFNAME()) == 0) &&
                minRev <= CAInterface::IFREVISION())
            {
                if (actualRev != NULL)
                {
                    *actualRev = CAInterface::IFREVISION();
                }
                return this;
            }
            return NULL;
        }
};
Non-ConfidentialPDF file icon PDF versionARM 100963_0200_00_en
Copyright © 2014–2017 ARM Limited or its affiliates. All rights reserved.