Specifications
Using the Watch Window with Structures
Developing a Simple Program
2-11
2.7 Using the Watch Window with Structures
In addition to watching the value of a simple variable, you can watch the
values of the elements of a structure.
1) Right-click on the Watch Window area and choose Insert New
Expression from the pop-up list.
2) Type
str
as the Expression and click OK. A line that says
+str = {...}
appears in the Watch Window. The + sign indicates that this is a structure.
Recall from section 2.3, page 2-4 that a structure of type PARMS was
declared globally and initialized in hello.c. The structure type is defined in
hello.h.
3) Click once on the + sign. Code Composer Studio expands this line to list
all the elements of the structure and their values. (The address shown for
Link may vary.)
4) Double-click on any element in the structure to open the Edit Variable
window for that element.
5) Change the value of the variable and click OK. Notice that the value
changes in the Watch Window. The value also changes color to indicate
that you have changed it manually.
6) Select the str variable in the Watch Window. Right-click in the Watch
Window and choose Remove Current Expression from the pop-up list.
Repeat this step for all expressions in the Watch Window.
7) Right-click on the Watch Window and choose Hide from the pop-up menu
to hide the window.
8) Choose Debug
→
Breakpoints. In the Breakpoints tab, click Delete All and
then click OK.