|Non-Confidential||PDF version||ARM DUI0446Z|
|Home > Debugging with Scripts > Use case scripts|
Use case scripts provide an extension to existing scripts that can be used in DS-5.
DS-5 provides many pre-defined platform and model configurations in the configuration database for connecting to and debugging a range of targets. The configuration database can be extended using the Platform Configuration Editor or Model Configuration editor.
When a connection to a configuration is established, you can then run a use case script to invoke custom behavior. You can use Jython and access the ARM Debug and Trace Services Layer (DTSL) libraries and debugger APIs. You can use use case scripts to provide a complex trace configuration, trace pin multiplexing or configure multiple Coresight components within a single script.
Use case scripts provide a simple but highly configurable way to implement user-defined functionality without having to write any boilerplate code for setting up, configuring and maintaining a script. Use case scripts still have access to the full scripting APIs.
The benefits of use case scripts include:
There are built-in functions within DS-5 to query, list, and run use case scripts including those in configuration databases and platform specific scripts. Use case scripts are analyzed and validated before they are run. A clear error message is reported if there are errors in the construction of the script.
Use case scripts take a set of options to configure the values given to the script on the command line and have a built-in mechanism to save and load sets of options. A trace configuration for a particular target or a complex set of options to recreate a bug can be saved and loaded when the script is run.
Use case scripts provide an easy way of changing the number of arguments, options, and names of methods as the script develops. You can define positional arguments to use case scripts. It is easy to add, remove or modify positional arguments. When running the script from the command line, you must specify values for the positional arguments. Multiple use cases are supported within a single use case script to allow sharing of common code, where each use case provides a single piece of functionality.