Home Tutorial Win32 API Reference Projects

Stony Brook Modula-2Stony Brook Modula-2 archive

Data/Watch/Locals Window Basics

The Data, Watch and Locals windows all use the same user interface. The differenceb etween them is in what they display and some slight differences in expression evaluation.

  • he Data window displays a single data item. The data window can remain open, and you can have multiple data windows. The expression in the data is only evaluated once and therefore will always access a constant memory location. The contents of the memory location may change and the data window display will reflect this.

  • The Watch window displays a list of data items you want to display. The Watch window has a slightly different context menu. Use the Debug menu to edit the watch window contents. You can delete individual items from the watch window by selecting them and pressing the Delete key or using the context menu. The expressions in the watch window are re-evaluated each time the program is stepped or stopped by a breakpoint or exception. This means that the displaying a variable named "foo" is evaluated in the current execution context, which can change due to language symbol scoping rules.
  • The Locals window displays all of the local variables of the currently executing procedure of the current thread. Use the View menu to open or close the locals window.

The data window display is for the most part quite obvious and simple to understand.Data is displayed in the same format as the Modula-2 and Ada95 languages use, including enumeration types.

Note: Ada95 redefinition of the character literal enumeration types will not display properly in the debugger.

For example:

type MyEnum = (One, Two, 'A', 'B');

Data window context menu

Watch window context menu

Display of Structured types

The data window is able to expand and contract structured types such as arrayand record types. When a variable of one of these types is contracted the data elementwill only show the word ARRAY or RECORD depending on what the variable type is. Whena structure is expanded the entire contents of the type are displayed. As each structuredtype is expanded the data display fields are indented one level. This helps you separateindividual structured types within a complex data structure.

When a line in the data window can be expanded the "++" symbol willbe shown in the left most column of the data window. If the data line can be contractedthe "--" symbol will be shown. Otherwise no symbol is shown in this column.

The following sample data window shows a two dimensional array being displayed.The array bounds for both dimensions range from 0..3. Click on areas of the samplewindow to learn more.

The following example shows a pointer to a record type being displayed. The pointertype is expanded.

Keyboard Shortcuts

Key Function
Enter Expand or contract the structured type
Insert Alter the selected data item
ab Change the secondary numeric display format radix.
Esc Close the Window

Common Keyboard Shortcuts


© Norman Black, Stony Brook Software. Reproduced with permission.