3.8.5. Acquiring Disassembly

Call GetDisassembly() to get the disassembly from a CADI Disassembler, The method has the following parameters:

callback

The callback object for the debugger to use to return the disassembly information.

address

The address the disassembly starts from.

nextAddr

Used by the disassembler to return the next address that can be disassembled. This gives the debugger a hint where to continue with disassembling after the last instruction of the current request.

This information is particularly useful for uncompleted calls. It gives the debugger an address from which it can resume.

mode

The mode used to disassemble the data. This can either be an explicitly selected mode or the mode the processing unit is currently in. For the latter case, the don’t care ID of 0 must be forwarded.

desiredCount

The number of instructions for the disassembler to process. This must also be the maximum number of ReceivedDisassembly() callbacks issued.

Note

The desiredCount refers to the number of requested instructions. If the mode ID is 0, the size of the instruction words can vary if the mode changes in between. It is therefore possible that the distance between the addresses (as returned by the callback) is not equally spaced.

Updating nextAddr after the last instruction is reached

If the last valid instruction within a memory space is reached, nextAddr must be set to this last instruction. The last valid instruction can be determined by testing the following conditions:

  • nextAddr is identical to the requested address

  • the GetDisassembly() call returns with CADI_DISASSEMBLER_STATUS_OK and triggers only one ReceiveDisassembly() callback no matter how many instructions are requested.

Figure 3.4 shows a call where the last instruction in the range is a valid instruction.

Figure 3.4. nextAddr set to last instruction

To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.


Figure 3.5 shows a call where the last instruction in the range is the last instruction in the memory space.

Figure 3.5. nextAddr set to last valid instruction

To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.


Copyright © 2014 ARM. All rights reserved.ARM DUI 0842B
Non-ConfidentialID111014