• Aucun résultat trouvé

Data Window

Dans le document TOOLKIT LOGITECH™ MODULA-2 (Page 123-130)

3.8 Windows and Commands

3.8.3 Data Window

The Data window displays the variables and/or parameters of the selected procedure or module.

Local Commands in the Data Window Son and Father: command displays the values of the elements of the a...rray. If the selected variable is a record, the Son command displays used to follow linked lists when you select a variable which is a pointer or is of type "ADDRESS". The double click applies these functions. The command Son is applied when an element is "double clicked". The command Father is applied when the path on the top of the window is "double-clicked".

The command Son can be used on a variable of type PROCESS only if the file RTSMAIN.REF is available.

Lets you switch from procedure local data to module global data and vice versa.

These commands are only applicable when the selected data item is an element of an array, or part of an element of an array. The Right and Left commands select the element with the next higher or lower index in the array. The current level is not changed by these commands. If the array elements are records, the record field selected is not affected.

Lets you select randomly an element of an array by giving the value of its index.

Type transfer:

Variable:

Examine PROCESS:

Address:

Lets you change the type of a displayed variable. You can use a predefined or user-defined type. If no type is given, the variable is displayed with its original type. The Type transfer is allowed only if the type of the variable and the new type are of the same size. If you use a type of your own, the debugger prompts you for the module defining it. A type-changed variable is marked by a "T".

Returns to the first level of the selected procedure or module.

The first level shows the variables of the procedure or module.

The Variables command can be used after you have repeatedly entered the Son command and wish to return to the first level directly, without repeatedly entering the Father command.

This command can be used when you select a variable of type PROCESS. Otherwise, the RTD prompts you to introduce the address of the process descriptor - the content of a variable of type PROCESS. The Examine command displays the call chain of the process to be examined. Enter the call window command Examine break process to show the Call window of the process that was running when the program stopped.

Checks to see if the process is initialized (a word with a special pattern is in all process descriptor).

Displays the address of the selected data item and updates the Raw window.

Modify

Modifies the contents of the selected variable or parameter. The debugger prompts you to enter the new value according to the type of the data item:

CARDINAL, INTEGER

You enter the new value which must be of the same type.

BYTE, WORD

You enter the new value as a hexadecimal number.

ADDRESS, POINTER, PROCESS, PROCEDURE VARIABLE

You enter the new value in the form <segment>: <offset>. Both parts are four digit, hexadecimal numbers. If you want to modify a process variable, you must enter the address of the new process descriptor. To modify a procedure variable, enter the address of the entry point (BEGIN).

~---~ARNING---~

The modification of a PROCESS variable and a PROCEDURE' variable could be very hazardous. Use these modifications very carefully! binary number consists of up to 16 digits of "one" or "zero", indicating that the corresponding bit should or should not be set. If you do not wish to modify a certain bit, you can enter an" x II at this position and the debugger will retain the original value for this bit.

SET

You modify items of type SET by invoking the Son command to list the contents of the set. The RTD then lists the possible elements in the set and indicates whether each element is in the set or not. To change the elements included in the set, you must select a particular element and activate the Modify command. By responding with T for TRUE or an F for FALSE to the prompt "In set?" you can then include or exclude that element into or from the set.

The modifications of a set element clears the unused bits of the set.

This can be used to correct an invalid set.

ENUMERATION

You modify the value by entering the name of the element to which you want to set the value. The element name must be given as defined by the declaration of the enumeration type.

~---NOTE---~

Modify is not allowed on LONGINT and REAL.

The following sample screens show the path you follow to modify the content of an array element with a record structure. First, you invoke the Son command to view the elements of the variable "node" of the module "Demo" (Sample Screens 3-2 & 3-3).

Next, you again invoke the Son command to display the fields of the record "node[1]", and the value and type of each field (Sample Screen 3-4). Finally, you modify the value of the first field which is of type CARDINAL. You invoke the Modify command (Sample Screen 3-5) and enter a 6 to change the value from 1 to 6. Sample Screen 3-6 shows the modified data.

Text line. 32 Demo.MOD

PROCEDURE Recursiveone (x: CARDINAL; y:REAL; z: INTEGER BEGIN

Text line. 32 Demo. MOD

PROCEDURE RecursiveOne (x: CARDINAL; y:REAL; z: INTEGER BEGIN

PROCEDURE RecursiveOne (x: CARDINAL; y:REAL; z: INTEGER BEGIN

Text linet 32 Demo . MOD

PROCEDURE RecursiveOne (x: CARDINAL; y:REAL; Z: INTEGER BEGIN

PROCEDURE Recursiveone (x: CARDINAL; y:REAL; z: INTEGER BEGIN

Dans le document TOOLKIT LOGITECH™ MODULA-2 (Page 123-130)