Saving and restoring Watch Window contents

From m204wiki
Revision as of 22:47, 21 April 2023 by Ekern (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

If you anticipate watching the same or many of the same items in subsequent debugging sessions, you can save to a local file the entire list of items displayed in the Watch Window, then restore those items to the Watch Window whenever you want. This may significantly minimize the effort of repopulating the Watch Window.

For example, say you are watching the function specifications $LISTCNT(%G), $LISTINF(%G, 1), $LISTINF(%G, 2), and $LISTINF(%G, 3). To save them for later use:

  1. Select Save Watch from the Debugger Client File menu.
  2. Specify a workstation folder location and a name for the storage file.
The list of watched items (only) is stored in a text file with a .watch file name extension:
watchSaved1

Alternatively, you can run the saveWatch command from a mapped Client button, key, or macro that has the same effect as the above two steps.

Restoring 

To restore (at any time) to the Watch Window these or other items from any .watch file (including any you create independently):

  1. Select Load Watch from the File menu.
  2. Locate and select the .watch file in the Windows Select Watch File dialog box.
By default, the search for the .watch file begins with the folder specified in the stateFileFolder element in the debuggerConfig.xml file.
The file's contents are added to the Watch Window display with whatever current value they may have in the current source code.

Again, as an alternative, you can run the loadWatch command from a mapped Client button, key, or macro that has the same effect as the above two steps.

You can save as many watched lists as you like.