|Non-Confidential||PDF version||ARM DUI0446Z|
|Home > Debug and Trace Services Layer (DTSL) > DTSL as used by DS-5 Debugger > DTSL access from Debugger Jython scripts|
DTSL uses Jython scripting to create the DTSL configuration. The configuration typically stores objects for each debug component in the target system.
DS-5 Debugger also uses Jython scripting, but at a different level, to DTSL, in the debugger software stack. In debugger scripting, the debugger provides an object interface to the debugger features. For example, a debugger script can:
These operations cause operations on the objects in the DTSL configuration, but there is not always a direct mapping from debugger operations to DTSL object operations. This is especially true for SMP systems.
Sometimes, however, it makes sense for a debugger script to access low level DTSL objects. For example, a user with in-depth CoreSight experience might want to manually program up a PTM sequencer, or directly drive CTI inputs. In such cases, the debugger script can get the DTSL configuration, locate the objects of interest and call their methods directly. Although this is a very powerful feature, it must be used with care, because the debugger has no way of knowing that such operations have taken place. In many cases this does not matter, especially if the DTSL objects being used are not directly used by the debugger. However, more care is required when directly accessing core objects used by the debugger.
The following is an example of how a debugger Jython script might get access to a DTSL object called “PTM”:
from arm_ds.debugger_v1 import Debugger from com.arm.debug.dtsl import ConnectionManager from com.arm.debug.dtsl.interfaces import IConfiguration # Connect to DS-5 Debugger debugger = Debugger() assert isinstance(debugger, Debugger) if not debugger.isConnected(): return # Access the underlying DTSL configuration dtslConnectionConfigurationKey = debugger.getConnectionConfigurationKey() dtslConnection = ConnectionManager.openConnection(dtslConnectionConfigurationKey) dtslConfiguration = dtslConnection.getConfiguration() assert isinstance(dtslConfiguration, IConfiguration) deviceList = dtslConfiguration.getDevices() for device in deviceList: assert isinstance(device, IDevice) if device.getName() == "PTM": …