3.7. Application loading

Loading an application from a debugger to a target is simplified by the CADI interface. A debugger typically writes the application program code directly to the platform memory. To simplify this, CADI has a CADIExecLoadApplication() method that autonomously writes the application code to the target. The debugger must extract debug information, if it was provided, from the executable. This can be used to initialize more hardware resources of the simulation model such as, for example, setting the program counter to the entry point of the application.

Note

The file path to the binary must be visible to both the debugger and the target because only the path string is passed through the interface.

It is implementation dependent which types of executable are supported by the model. For example, some models might, or might not, support ELF files.

It is possible to load multiple applications to a target. This might, for example, be required to load several different applications to a multi-core processor. The information about each loaded application and its received command line parameters are stored in an internal list in the target.

This list always represents the currently loaded applications. To determine which applications are loaded on a connected target, call the CADIExecGetLoadedApplications(). It returns all information, including the file paths and the applied command line parameters, used to load the corresponding binary. This data can be used by other debuggers connecting to this core to obtain the required debug information.

The list of loaded applications must be preserved until a hard reset, that is until CADIExecReset(level=0). Other reset levels that modify program memory can also empty this list. See the documentation for the model to determine the model behavior.

Note

A simple CADIMemWrite() does not have an impact on the list of loaded applications even if it breaks one of them.

To unload an application from the target (or even better, to invalidate the application) without using a CADI reset, the debugger can call CADIExecUnloadApplication(). This removes the application information and, if loaded, the debug information from the target. Memory contents are not, however, erased by this call. The passed file path must be identical with the one used for CADIExecLoadApplication().

Note

It is implementation dependent if the model supports handling debug information. This is typically not required as the debugger side must extract the information from the application image anyway.

Copyright © 2008-2011 ARM. All rights reserved.ARM DUI 0444H
Non-ConfidentialID010512