1 |
578 |
markom |
<HTML>
|
2 |
|
|
<HEAD>
|
3 |
|
|
<TITLE>Watch Window Help</TITLE>
|
4 |
|
|
</HEAD>
|
5 |
|
|
<BODY>
|
6 |
|
|
<H1>The Watch Window</H1>
|
7 |
|
|
<H3>Overview</H3>
|
8 |
|
|
<P>The Watch Window may be used to inspect and edit any expression, including
|
9 |
|
|
global variables, static variables, local variables, function arguments,
|
10 |
|
|
and registers.</P>
|
11 |
|
|
|
12 |
|
|
<P>Watch Window topics:
|
13 |
|
|
<UL>
|
14 |
|
|
<LI><UL><A HREF="#menus">Watch Menu</A>
|
15 |
|
|
<LI><A HREF="#menus_edit">Edit</A>
|
16 |
|
|
<LI><A HREF="#menus_fmt">Format</A>
|
17 |
|
|
<LI><A HREF="#menus_remove">Remove</A>
|
18 |
|
|
</UL>
|
19 |
|
|
<LI><UL><A HREF="#new">Adding Watch Expressions</A>
|
20 |
|
|
<LI><A HREF="#new_ent">In the Watch Window</A>
|
21 |
|
|
<LI><A HREF="#new_src">In the Source Window</A>
|
22 |
|
|
<LI><A HREF="#new_cast">Casting Pointers</A>
|
23 |
|
|
</UL>
|
24 |
|
|
<LI><UL><A HREF="#display">Watch Display</A>
|
25 |
|
|
<LI><A HREF="#display_deref">Dereferencing Pointers</A>
|
26 |
|
|
<LI><A HREF="#display_struct">Viewing a Structure or Class</A>
|
27 |
|
|
<LI><A HREF="#display_edit">Editing an Expression</A>
|
28 |
|
|
<LI><A HREF="#display_popup">Watch Pop-up Menu</A>
|
29 |
|
|
</UL>
|
30 |
|
|
</UL></P>
|
31 |
|
|
|
32 |
|
|
<H3><A NAME="menus">Watch Menu</A></H3>
|
33 |
|
|
The Watch Menu gives on-screen access to the funtions of the Watch Window.
|
34 |
|
|
To use any of these functions, first use the left mouse button to select an
|
35 |
|
|
expression from the display. Then select:
|
36 |
|
|
|
37 |
|
|
<DL>
|
38 |
|
|
<DT><A NAME="menus_edit">Edit</A>
|
39 |
|
|
<DD>Edit the value of the expression
|
40 |
|
|
<DT><A NAME="menus_fmt">Format</A>
|
41 |
|
|
<DD>Change the display format of the expression
|
42 |
|
|
<DT><A NAME="menus_remove">Remove</A>
|
43 |
|
|
<DD>Remove the expression from the Watch Window
|
44 |
|
|
</DL>
|
45 |
|
|
|
46 |
|
|
<H3><A NAME="new">Adding Watch Expressions</A></H3>
|
47 |
|
|
<A NAME="new_ent">To add an expression to the Watch Window</A>, simply enter
|
48 |
|
|
the expression into the entry at the bottom of the window and press return
|
49 |
|
|
or click the "Add Watch" button. The expression is validated and added to the
|
50 |
|
|
Watch Window Display.
|
51 |
|
|
|
52 |
|
|
<P><A NAME="new_src">To add an expression to the Watch Window from the
|
53 |
|
|
<A HREF="source.html">Source Window</A></A>, use the
|
54 |
|
|
"<A HREF="source.html#add_to_watch">Add to Watch</A>" option of the
|
55 |
|
|
<A HREF="source.html#display_popup">Source Window Pop-up Menu</A>.</P>
|
56 |
|
|
|
57 |
|
|
<P>Any legal expression may be added to the Watch Window, which will
|
58 |
|
|
evaluate each of its expressions everytime the program runs. Be cautious
|
59 |
|
|
adding expressions which cause assignments, such as "<CODE>i++</CODE>".</P>
|
60 |
|
|
|
61 |
|
|
<P>Adding a register to the Watch Window can be advantages when debugging
|
62 |
|
|
via a slow serial line. In this case, keeping the entire Register Window open
|
63 |
|
|
may be inefficient. Consider adding the register to the Watch Window. Simply
|
64 |
|
|
enter the name of the register preceded with a dollar sign ($) into the
|
65 |
|
|
Entry. For example, to watch the PC register, enter "<CODE>$pc</CODE>" into
|
66 |
|
|
the Watch Window Entry. The program counter is added to the Display.</P>
|
67 |
|
|
|
68 |
|
|
<P><A NAME="new_cast">To cast pointers</A>, simply enter the cast into the
|
69 |
|
|
Watch Window Entry at the bottom of the window. Use the same syntax for the
|
70 |
|
|
cast that the source file uses. If the source file uses C, the a simple
|
71 |
|
|
cast of "<CODE>ptr</CODE>" of type "<CODE>void *</CODE>" can be cast to type
|
72 |
|
|
"<CODE>my_struct</CODE>" by entering "<CODE>(my_struct *) ptr</CODE>" into
|
73 |
|
|
the Entry.</P>
|
74 |
|
|
|
75 |
|
|
<H3><A NAME="display">Watch Display</A></H3>
|
76 |
|
|
The Watch Window Display consists of a scrolled listbox which contains all
|
77 |
|
|
watch expressions, one per line. To use any of the functions of the Watch
|
78 |
|
|
Window, use the left mouse button to select any element from the Display.
|
79 |
|
|
|
80 |
|
|
<P>Pointers, structures, and classes appear in the display with a small
|
81 |
|
|
exapansion box before their names. To <A NAME="display_deref">dereference
|
82 |
|
|
pointers</A> or <A NAME="display_struct">view the members of classes or
|
83 |
|
|
structures</A>, click the closed expansion box (which appears as a small
|
84 |
|
|
plus sign, "+") to "expand" the listing. The expansion box changes to a
|
85 |
|
|
minus sign, "-", indicating that the display is now open. Pointers,
|
86 |
|
|
structures and classes may be expanded recursively to allow multiple pointer
|
87 |
|
|
derefernces and embedded structure viewing.
|
88 |
|
|
|
89 |
|
|
<P>The Watch Display updates after every execution of the program and
|
90 |
|
|
highlights in blue those expressions whose values have changed.</P>
|
91 |
|
|
|
92 |
|
|
<P>The Watch Window will, by default, display all pointers and registers in
|
93 |
|
|
hexadecimal and all other expressions in decimal. To change the display
|
94 |
|
|
format for an expression, select the Format option from either the Watch Menu
|
95 |
|
|
or the <A HREF="#display_popup">Watch Pop-up Menu</A>.
|
96 |
|
|
<BR>
|
97 |
|
|
|
98 |
|
|
<H4><A NAME="display_edit">Editing an Expression</A></H4>
|
99 |
|
|
To edit an expression, either double-click the left mouse button on the expression
|
100 |
|
|
in the Display or select the Edit option from either the Watch Menu or
|
101 |
|
|
the Watch Pop-up Menu. To abort editing an expression's value, simply press
|
102 |
|
|
the escape key on the keybaord. The expression's original value is restored.
|
103 |
|
|
<BR>
|
104 |
|
|
|
105 |
|
|
<H4><A NAME="display_popup">Watch Pop-up Menu</A></H4>
|
106 |
|
|
The Watch Pop-up Menu provides quick access to the functions of the Watch Window.
|
107 |
|
|
To use the Locals Pop-up Menu, first select an expression from the Display (by
|
108 |
|
|
clicking the left mouse button on it) and click the right mouse button, choosing
|
109 |
|
|
from the pop-up:
|
110 |
|
|
<DL>
|
111 |
|
|
<DT>Edit
|
112 |
|
|
<DD>Edit the expression's value. See <A HREF="#display_edit">
|
113 |
|
|
Editing an Expression</A>
|
114 |
|
|
<DT>Format
|
115 |
|
|
<DD>Change the display format of the expression. The expression may be
|
116 |
|
|
displayed as:
|
117 |
|
|
<DL>
|
118 |
|
|
<DT>Hex
|
119 |
|
|
<DD>hexadecimal (base 16)
|
120 |
|
|
<DT>Decimal
|
121 |
|
|
<DD>decimal (base 10)
|
122 |
|
|
<DT>Binary
|
123 |
|
|
<DD>binary (base 2)
|
124 |
|
|
<DT>Octal
|
125 |
|
|
<DD>octal (base 8)
|
126 |
|
|
</DL>
|
127 |
|
|
</DL>
|
128 |
|
|
</BODY>
|
129 |
|
|
</HTML>
|