2.2.3 CADISimulation

The CADISimulation class represents the connection to a simulated platform and provides information about platform targets that expose a CADI interface.

Querying this object returns a list with an element for each target. The descriptions include:

  • The target ID that must be used for interaction between the caller and CADI simulation related to this target.
  • Fundamental properties that might have a major impact on the behavior of an attached debugger (for example if the target is able to execute software).

The caller uses the returned information to select a target. To retrieve a pointer to the corresponding target, call the GetTarget() method of the CADISimulation. The returned pointer is to CAInterface in the base class of the CADI interface.

As with other classes in the target connection mechanism, CADISimulation contains a Release() method to disconnect the caller from a simulation. After Release() is called, an attached debugger must not address the simulation or a target previously obtained from the simulation. Calling a released simulation might raise an access violation because the connected target or simulation, and the associated CADI object, might already be destroyed. The CADI simulation object owns all target interfaces associated with the simulation and is therefore responsible for their creation and destruction.

A major difference between the Release() call of CADISimulation and those of the other classes is the shutdown parameter:

  • If true, the implementation for this method must manage shutting down the connected simulation. Shutdown includes informing other connected callers about the shutdown and waiting for them to acknowledge the request by calling Release() themselves.
  • If false, a simulation might be kept alive after disconnection. This might be the case if the debugger is one of multiple callers and there is no requirement to enforce a shutdown on disconnect.

Typically, a CADISimulationCallback object and a CADIErrorCallback object are registered to a CADISimulation through the corresponding methods that established the connection. Dedicated methods are provided to add additional callback objects to the simulation.

Non-ConfidentialPDF file icon PDF versionARM 100963_0200_00_en
Copyright © 2014–2017 ARM Limited or its affiliates. All rights reserved.