| |||
| Home > Connecting to Targets > Disconnecting from a target > Setting disconnect mode | |||
When you disconnect from a target, RealView Debugger attempts to
disconnect using the default disconnect mode, that is As-is
with Debug. This mode is used when you disconnect from
the Connection Control window in any of the following ways:
Double-click on a connected connection entry.
Select the check box for a required connection entry so that it is unchecked.
Right-click on a connection entry and select Disconnect from the Disconnection context menu (see Disconnection context menu options).
This default disconnect mode is also used when you disconnect from the Code window using either:
Select Target → Disconnect from the Code window main menu.
Click the Disconnect button from the Connection group on the Actions toolbar.
Before disconnecting, RealView Debugger checks to see if a user-defined disconnect mode has been specified in your board file (see User-defined disconnect mode for details). If such a setting is found, it overrides the default disconnect mode and is used instead. If there is no disconnect mode specified in your target configuration file, RealView Debugger proceeds to disconnect using the default disconnect mode.
However, the disconnect mode that is actually used depends on the target hardware, the target vehicle, and the associated interface software that manages the connection. In some cases, the interface cannot complete the disconnection using the mode requested, for example where your RealView ICE or RVI-ME unit configuration conflicts with the disconnect mode. In this case, the RealView ICE or RVI-ME unit determines the disconnect mode and disconnects. RealView Debugger displays a warning message to say that the requested disconnect mode cannot be honored and tells you what disconnection mode was used instead.
This behavior also applies to connect mode, for example mode substitution might occur when you try to connect to a running target. See Setting connect mode for more details.
RealView Debugger provides a mechanism to enable you to override both the default disconnect mode and any user-defined settings in your board file. This is useful when debugging a single processor target system, for example to download your application and leave it running without the debugger connected. Therefore, you can control the way a processor stops when you disconnect. To do this you must select the option Disconnect (Defining Mode)... from the Disconnection context menu in the Connection Control window or from the Target menu from the Code window main menu. See Disconnect (Defining Mode)... for details on how to use this option.
Before disconnecting, RealView Debugger checks to see if a user-defined
disconnect mode has been specified by the Disconnect_mode setting
in the Advanced_Information block in your board
file, or in any .bcd file linked to the connection.
If such a setting is found, it becomes the default disconnect mode
for this connection and is used if you disconnect in any of the
following ways:
Double-click on a connected connection entry.
Select the check box for a required connection entry so that it is unchecked.
Right-click on a connection entry and select Disconnect from the Disconnection context menu (see Disconnection context menu options).
Select Target → Disconnect from the Code window main menu.
Click the Disconnect button from the Connection group on the Actions toolbar.
For more information about setting disconnect mode in your board file, see:
About target configuration in Chapter 13 Configuring Custom Targets
the example Specifying connect and disconnect mode in Chapter 13 Configuring Custom Targets
the description of the Advanced_Information block
in Appendix B Configuration Properties Reference.
To set the disconnect mode, either:
select Target → Disconnect (Defining Mode)... from the Code window main menu
select the Disconnect (Defining Mode)... option from the Connection Control window Disconnection context menu (see Disconnection context menu options).
To define a disconnect mode using the Disconnect (Defining Mode)... option:
Right-click
on a connected connection entry, for example ARM940T_0,
using RVI-ME, to display the Disconnection context
menu (see Disconnection context menu options).
Select Disconnect (Defining Mode)... to display the Disconnect Mode list selection box shown in Figure 2.5.
The state options shown depend on the interface software managing the connection, but are always one or more from:
Leaves the target in its current state, whether stopped or running, and removes any debugging controls such as software breakpoints.
If this leaves the processor running, any defined breakpoints are disabled. This means the program does not enter debug state after the debugger has disconnected.
Leaves the target in its current state, whether stopped or running, and maintains any debugging controls such as software breakpoints.
If this leaves the processor running, any defined breakpoints are still active. This means the program might enter debug state after the debugger has disconnected, depending on the code paths the program takes.
Highlight the required state and click OK. This has the following results:
the current connection is disconnected
the command is reflected in the Cmd tab of the Output pane
the toolbar state group is set to Unknown
any windows attached to the current connection are unattached
title bars and Color Boxes for all unattached windows are updated.
The state options specify that the target is left in the current state, that is running or stopped. There is no option to stop the processor before disconnecting. To ensure that the processor is left in a particular state, you must stop (or start) the processor before disconnecting.
Remember that the disconnect mode that is actually used depends on the target hardware, the target vehicle, and the associated interface software that manages the connection. In some cases, the interface cannot complete the disconnection using the mode requested, for example where your RealView ICE or RVI-ME unit configuration conflicts with the disconnect mode. In this case, the RealView ICE or RVI-ME unit determines the disconnect mode and disconnects. RealView Debugger displays a warning message to say that the requested disconnect mode cannot be honored and tells you what mode was used instead.
If you set disconnect mode from the Connection Control window, this temporarily overrides any user-defined setting in your target configuration file.
The selection box, shown in Figure 2.5, offers one or more state options to
disconnect from your target. The options shown depend on the interface
software that manages the target connection and so vary depending
on the connection entry you select in the Connection Control window.
In this example, the selection box contains an entry As-is
with Debug (default). This is either the:
default disconnect mode chosen by the debugger (see Setting disconnect mode for details)
user-defined disconnect mode specified in the target configuration file (see User-defined disconnect mode for details).
Any user-defined disconnect mode takes precedence over the default disconnect mode chosen by the debugger.
If you click Cancel, RealView Debugger disconnects using the disconnect mode shown as the default. Where this mode is not supported by your target, a different disconnect mode is used and you are warned about the substitution.
This selection box is also displayed if you specify a prompt as your user-defined disconnect mode. In this case, there is no default entry (see Using a prompt for details).
You can specify a user-defined disconnect mode to display a prompt to enable you to choose the disconnection mode for each connection. In this case, RealView Debugger displays the Disconnect Mode selection box shown in Figure 2.5. However, where the prompt setting is defined, the state options offered are all supported by the target vehicle and so do not include a default option.
If a prompt is specified in your board file, or in any .bcd file
linked to the connection, it takes priority over any other user-defined
disconnect mode setting. This prompt-first rule holds true regardless
of where the setting is in the configuration hierarchy.
For more information about using a prompt, see:
the example Specifying connect and disconnect mode in Chapter 13 Configuring Custom Targets
the description of the Advanced_Information block
in Appendix B Configuration Properties Reference.