Working with Registers. NXP CodeWarrior Development Studio
Oglas
Oglas
Working with Registers
Option
Expression to watch
Memory space
Units
Write
Read
Table 5-19. Add Watchpoint dialog box options
Description
Enter an expression that evaluates to an address on the target device. When the specified expression evaluates to an invalid address, the debugger halts execution and displays an error message. You can enter these types of expressions:
• An r-value, such as &variable
• A register-based expression. Use the $ character to denote register names. For example, enter $SP-12 to have the debugger set a watchpoint on the stack pointer address minus 12 bytes.
The
Add Watchpoint dialog box does not support entering expressions that evaluate to registers.
Select this option to specify an address, including memory space, at which to set the watchpoint. Use the text box to specify the address or address range on which to set the watchpoint. If a debugging session is not active, the text/list box is empty, but you can still type an address or address range.
Enter the number of addressable units that the watchpoint monitors.
Select this option to enable the watchpoint to monitor write activity on the specified memory space and address range. Clear this option if you do not want the watchpoint to monitor write activity.
Select this option to enable the watchpoint to monitor read activity on the specified memory space and address range. Clear this option if you do not want the watchpoint to monitor read activity.
5.5.2 Removing Watchpoints
To remove a watchpoint, perform these steps:
1. Open the Breakpoints view if it is not already open by selecting Window > Show
View > Breakpoints.
The Breakpoints view appears, displaying a list of watchpoints.
2. Right-click on the watchpoint you wish to remove and select Remove from the menu that appears.
The selected watchpoint is removed, and it disappears from the list in the
Breakpoints view.
5.6 Working with Registers
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
172 Freescale Semiconductor, Inc.
Chapter 5 Working with Debugger
Use the Registers view to display and modify the contents of the registers of the processor on your target board.
To display the Registers view, select Window > Show View > Other > Debug >
Registers. The Registers view appears (shown in the figure below). The default state of the Registers view provides details on the processor's registers.
The Registers view displays categories of registers in a tree format. To display the contents of a particular category of registers, expand the tree element of the register category of interest.
Tip
You can also view and update registers by issuing the reg
, change
, and display
commands in the Debugger Shell view.
Figure 5-19. Registers View
In this section:
•
•
•
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
173
Working with Registers
5.6.1 Viewing Register Details
This section explains how to use the Registers view to show the details of a register.
To open the Registers view, you must first start a debugging session.
To see the registers and their descriptions, follow these steps:
1. In the Debug perspective, click the Registers view tab.
The Registers view appears, as shown in the figure below.
Figure 5-20. Registers View - Register Details
2. Click the View Menu button (the inverted triangle) on the Registers view toolbar.
3. Select Layout > Vertical or Layout > Horizontal to show register details.
NOTE
Selecting Layout > Registers View Only hides the register details.
4. Expand a register group to see individual registers.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
174 Freescale Semiconductor, Inc.
Chapter 5 Working with Debugger
5. Select a specific register by clicking it.
The details of the selected register get displayed.
NOTE
Use the Format list box to change the format of data displayed for the selected register.
6. Examine register details. For example,
• Use the Bit Fields group to see a graphical representation of the selected register's bit fields. You can use this graphical representation to select specific bits or bit fields.
• Use the Actions group to perform operations, such as update bit field values and format the displayed register data.
• Use the Description group to see an explanation of the selected register, bit field, or bit value.
Tip
To enlarge the Registers view, click Maximize on the view's toolbar. After you finish looking at the register details, click Restore on the view's toolbar to return the view to its previous size. Alternatively, right-click the
Registers tab and select Detached. The Registers view becomes a floating window that you can resize. After you finish looking at the register details, right-click the
Registers tab of the floating window and select Detached again. You can rearrange the re-attached view by dragging its tab to a different collection of view tabs.
In this section:
•
•
•
•
5.6.1.1 Bit Fields
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
175
Working with Registers
The Bit Fields group of the Registers view (see the figure below) shows a graphical representation of the selected register's bit values. This graphical representation shows how the register organizes bits. You can use this representation to select and change the register's bit values. Hover the cursor over each part of the graphical representation to see additional information.
Figure 5-21. Register Details - Bit Fields Group
Tip
You can also view register details by issuing the reg
command in the Debugger Shell view.
A bit field is either a single bit or a collection of bits within a register. Each bit field has a mnemonic name that identifies it. You can use the Field list box to view and select a particular bit field of the selected register. The list box shows the mnemonic name and bit-value range of each bit field. In the Bit Fields graphical representation, a box surrounds each bit field. A red box surrounds the bit field shown in the Field list box.
After you use the Field list box to select a particular bit field, you see its current value in the = text box. If you change the value shown in the text box, the Registers view shows the new bit field value.
The minimum resolution of bit field descriptions is 2 bits. Consequently, register details are not available for single-bit overflow registers.
The maximum resolution of bit field descriptions is 32 bits.
5.6.1.2 Changing Bit Fields
To change a bit field in a register, you must first start a debugging session, and then open the Registers view.
To change a bit field, perform these steps:
1. In the Registers view, view register details.
2. Expand the register group that contains the bit field you want to change.
Register details appear in the Registers view.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
176 Freescale Semiconductor, Inc.
Chapter 5 Working with Debugger
3. From the expanded register group above the register details, select the name of the register that contains the bit field that you want to change.
The Bit Fields group displays a graphical representation of the selected bit field. The
Description group displays explanatory information about the selected bit field and parent register.
4. In the Bit Fields group, click the bit field that you want to change. Alternatively, use the Field list box to specify the bit field that you want to change.
5. In the = text box, type the new value that you want to assign to the bit field.
6. In the Action group, click Write.
The debugger updates the bit field value. The bit values in the Value column and the
Bit Fields group change to reflect your modification.
NOTE
Click Revert to discard your changes and restore the original bit field value.
5.6.1.3 Actions
Use the Actions group of the Registers view (see the figure below) to perform various operations on the selected register's bit field values.
Figure 5-22. Register View - Actions Group
The table below lists each item in the Actions group and explains the purpose of each.
Table 5-20. Actions Group Items
Revert
Write
Reset
Item Description
Discard your changes to the current bit field value and restore the original value. The debugger disables this button if you have not made any changes to the bit field value.
Save your changes to the current bit field value and write those changes into the register's bit field. The debugger disables this button after writing the new bit field value, or if you have not made any changes to that value.
Change each bit of the bit field value to its register-reset value. The register takes on this value after a target-device reset occurs. To confirm the bit field change, click Write.
To cancel the change, click Revert.
Table continues on the next page...
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
177
Working with Registers
Item
Summary
Format
Table 5-20. Actions Group Items (continued)
Description
Display Description group content in a pop-up window. Press the Esc key to close the pop-up window.
Specify the data format of the displayed bit field values.
5.6.1.4 Description
The Description group of the Registers view (see the figure below) shows explanatory information for the selected register.
Figure 5-23. Register View - Description Group
The register information covers:
• Current value
• Description
• Bit field explanations and values
Some registers have multiple modes (meaning that the register's bits can have multiple meanings, depending on the current mode). If the register you examine has multiple modes, you must select the appropriate mode.
5.6.2 Registers View Context Menu
The Registers view context menu provides you various options for working with registers.
To display the Registers view context menu, right-click a register in the Registers view.
The table below lists the options of the Registers view context menu.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
178 Freescale Semiconductor, Inc.
Select All
Copy Registers
Enable
Disable
View Memory
Format
Option
Cast to Type
Restore Original Type
Find
Change Value
Show Details As
Add Register Group
Add Watchpoint (C/C++)
Watch
Chapter 5 Working with Debugger
Table 5-21. Registers View Context Menu Options
Restore Default Register Groups
Description
Selects the entire contents of the current register.
Copies to the system clipboard the contents of the selected register.
Allows the debugger to access the selected register.
Prevents the debugger from accessing the selected register.
Displays the corresponding memory for the selected register.
Use to specify the displayed data format for the selected register:
• Natural: Default data format
• Decimal: Decimal data format
• Hexadecimal: Hexadecimal data format
• Binary: Binary data format
• Fractional: Fractional data formats, Q0-Q39
Opens a dialog box that you can use to cast the selected register value to a different data type.
Reverts the selected register value to its default data type.
Opens a dialog box that you can use to select a particular register.
Opens a dialog box that you can use to change the current register value.
Allows you to specify how the debugger displays the register's contents. The options are:
•
Default Viewer: The register's contents are displayed as a hexadecimal value.
• Register Details Panel: The register's values are display in a bit format, along with a description of their purpose.
Opens a dialog box that you can use to create a new collection of registers to display in the
Registers view.
Resets the custom groups of registers created using the Add Register Group option, and restores the default groups provided by the debugger as they were when
CodeWarrior was installed. Note that if you select this option, all custom groupings of registers done by you are lost.
Opens the
Add Watchpoint dialog box, proposing to set a watchpoint on an expression representing the register. The debugger sets the watchpoint according to the settings that you specify in the
Add Watchpoint dialog box. The Breakpoints view shows information about the newly set watchpoint. The Problems view shows error messages when the debugger fails to set the watchpoint.
Adds a new watch-expression entry to the Expressions view.
5.6.3 Working with Register Groups
This section describes different operations that can be performed on register groups.
You can perform the following operations on the register groups:
•
•
•
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
179
Working with Registers
5.6.3.1 Adding a Register Group
The default display of the Registers view groups related registers into a tree structure.
You can add a custom group of registers to the default register tree structure.
To add a new register group, perform these steps:
1. Right-click in the Registers view.
A context menu appears.
2. Select Add Register Group from the context menu.
The Register Group dialog box appears, as shown in the figure below.
Figure 5-24. Register Group Dialog Box
3. Enter in the Group Name text box a descriptive name for the new group.
4. Select the checkbox next to each register you want to appear in the new group.
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
180 Freescale Semiconductor, Inc.
Chapter 5 Working with Debugger
Tip
Click Select All to check all of the checkboxes. Click
Deselect All to clear all of the checkboxes.
5. Click OK.
The Register Group dialog box closes. The new group name appears in the
Registers view.
5.6.3.2 Editing a Register Group
In the Registers view, you can edit both the default register groups and the groups that you add.
To do so, use the following steps:
1. In the Registers view, right-click the name of the register group you want to edit.
A context menu appears.
2. Select Edit Register Group from the context menu.
The Register Group dialog box appears.
3. If you wish, enter in the Group Name text box a new name for the group.
4. Check the checkbox next to each register you want to appear in the group.
Tip
Click Select All to check all of the checkboxes. Click
Deselect All to clear all of the checkboxes.
5. Click OK.
The Register Group dialog box closes. The new group name appears in the
Registers view.
5.6.3.3 Removing a Register Group
In the Registers view, you can remove register groups.
To remove a register group, follow these steps:
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
181
Prenesi
Oglas