14.7 Advanced OS awareness extension

You can extend the OS awareness features by defining more parameters.

The OS awareness extension might sometimes be unable to determine all the necessary information about the OS at runtime. There might be a compile option that controls the presence of a feature which fundamentally changes how a section of the OS works, and this might be undetectable at runtime. An example is whether the OS is compiled with hard or soft floating point support.
In the majority of cases, these features can be detected at runtime. However in rare instances this might not be possible. To deal with these cases you can define parameters for the OS awareness extension, which you can then specify at runtime. For example, you can inform the OS awareness extension of the state of a compile flag. These parameters are then revealed to the debugger as Operating System settings which can be queried from within the OS awareness Python scripts.

Note

This API feature is only available in API version 5.23 and later. You must change the version attribute of the os element to prevent running in incompatible versions.
The extension.xml file declares the OS awareness extension, as described in 14.2 Creating an OS awareness extension. You can define the additional parameters by adding to the os element in extension.xml using the syntax that this example shows:
<parameter name="my-setting" description="myos.param.my_setting.desc" type="enum" default="enabled" help="myos.param.my_setting.help">
    <value name="enabled"  description="myos.param.my_setting.enabled"/>
    <value name="disabled" description="myos.param.my_setting.disabled"/>
</parameter>
For this example, you must also add the following to message.properties:
myos.param.my_setting.desc=My setting
myos.param.my_setting.help=This is my setting
myos.param.my_setting.enabled=Enabled
myos.param.my_setting.disabled=Disabled
Each parameter has:
type
The only supported type is enum.
name
The string used to identify the parameter within the debugger. The string can contain alphanumeric characters a-z, A-Z and 0-9. The string can also contain - and _ but must not contain whitespace or any other special characters. The string must be unique among other parameters.
description
The localizable string shown in the GUI.
help
The localizable string shown in the parameter tooltip.
default
The name string corresponding to the default value of the parameter.
Each value has:
name
The string used to identify it within the debugger. The string can contain alphanumeric characters a-z, A-Z and 0-9. The string can also contain - and _ but must not contain whitespace or any other special characters. The string must be unique among other parameters.
description
The localizable string shown in the GUI.

How to set the parameter value in DS-5

When you define these parameter settings in the OS awareness extension, you can set the parameter as an Operating System setting, either from the GUI or using the command-line. You can change or view these parameters using the set os and show os commands respectively, for example set os my-setting enabled.
DS-5 debugger shows these settings in the OS Awareness tab in the Debug Configurations dialog box
Figure 14-10 OS awareness with parameters
OS awareness with parameters

Note

When using the command-line debugger the parameter is set to its default value initially. It is then possible to manually change it after connecting to the target.
The parameters can be read from the OS awareness API using the getConnectionSetting method, for example debugger.getConnectionSetting("os my-setting"). This returns the name string of the selected value, or throws a DebugSessionException if the parameter does not exist.
Non-ConfidentialPDF file icon PDF versionARM DUI0446W
Copyright © 2010-2015 ARM. All rights reserved.