Command Table Set or Execute(PLBDBUG)


 

The 'Xn'command directly sets, changes, and executes debugger commands to/from a character 'X' command table. The 'Xn' commands are implemented to allow one or more debugger commands to be stored and executed by the character debugger. The 'Xn' commands can be used either as debugger console commands or by using the PL/B 'DEBUG CMD={cmd}' instruction in a PL/B user program. The 'Xn' commands have syntax formats described as follows:

Formats:

 

(1) Xn

 

(2) Xn {cmddata}

 

(3) Xn! {cmddata}

 

(4) Xn? {cmddata}

Where:

 

Xn
The 'n' can be a numeric digit from '0 to '9'. When the 'Xn' command is executed, the debug retrieves a previously stored command string and executes it.
Xn {cmddata}
When this 'Xn' command is executed, the {cmddata} string is stored into the debugger xcommand table. The {cmddata} string can include one or more of the debugger commands. After the {cmddata} is stored into the debugger xcommand table. Execution using the simple 'Xn' command causes the {cmddata} string to be parsed and executed. The {cmddata} string has a size limitation of 71 characters including the leading 'Xn '.

{cmddata} Syntax

 

<cmd>[; <cmd>[...]]

Where:

 

<cmd>
Single character debugger command.

Example of 'Xn' entered a the debugger console:

 

X0 DV S$CMDLIN

This 'X0' command stores the 'DV S$CMDLIN' string into the xcommand table position 0.

 

X1 DV S$ERROR$; BP ProgLabel

This 'X1' command stores the 'DV S$ERROR$; BP Proglabel' string into the xcommand table position 1.

 

X9 X0; X1

This xcommand stores the 'X0; X1' string into the xcommand table position 9. When the simple 'X9' command is executed, then the simple 'X0' is executed followed by the execution of the simple 'X1' command.

 

Xn! {cmddata}

When this 'Xn!' command is executed, the {cmddata} string is stored into the debugger xcommand table the same as described for the 'Xn {cmddata}' xcommand. The '!' appended to form the 'Xn!' causes the {cmddata} string to be parsed and executed immediately by the character debugger. The debugger command behavior depends on the commands used in the {cmddata} string.

Example of 'Xn!' entered a the debugger console:

 

X0! DV S$CMDLIN

This 'X0!' command stores the 'DV S$CMDLIN' string into the xcommand table position 0. Then the {cmddata} table position 0 is executed by the character debugger. In this case, the 'DV S$CMDLIN' is shown in the character debugger window and the debugger breaks waiting for the next end-user comamnd.

 

X1! BP ProgLabel; G

This 'X1!' command stores the 'DV S$CMDLIN' string into the xcommand table position 1. Then the {cmddata} table position 1 is executed by the character debugger. In this case, the 'BP ProgLabel' command is executed by the character debugger which is followed by the execution of the 'G' command.

 

Xn? {cmddata}

When this 'Xn?' command is executed, the {cmddata} string is stored into the debugger xcommand table the same as described for the 'Xn {cmddata}' xcommand. The '?' appended to form the 'Xn?' xcommand causes the character debugger to continue the PL/B program execution immediately after the {cmddata} is stored. In this case, the {cmddata} is not executed as the program execution continues.

Example of 'Xn?' entered a the debugger console:

 

X0? BP ProgLabel

This 'X0?' command stores the 'BP ProgLabel' string into the xcommand table position 0. Then the PL/B program continues to execute without executing the 'BP ProgLabel' command. After this 'X0' xcommand string is store, the execution of the simple 'X0' command can be used to execute the 'BP ProgLabel' command.

Note:

 

  1. The 'Xn' commands can be executed directly at the character debugger input window. However, the xcommands can be executed in the PL/B 'DEBUG CMD={cmd}' instruction when a PL/B program is executing in the debug mode, the character debugger retrieves the {cmd} information and processes the commands. This allows PL/B programs to be progammed to selectively execute and/or build DEBUG commands dynamically.

Example of static CMD commands:

.

. This instruction uses the 'X0!' command as follows:

.1. The command string 'BC *; BP ABC; G' is stored into the xcommand table position 0.

.2. The '!' causes the character debugger to execute the newly stored 'X0' command.

.3. The character debugger executes the debug commands as follows:

.

execute> BC * //Clears all break points

execute> BP ABC //Set Break Point for ABC

execute> G //Continue Program Execution

.

DEBUG CMD="X0! BC *; BP ABC; G"

Example of dynamic CMD commands:

 

. This instruction uses the 'X0?' and 'X1?' xcommands to store break points for program use.

.

     DEBUG CMD="X0? BP ABC; BL"

     DEBUG CMD="X1? BP XYZ; BL"

.

doCmd DIM 71

....

.

     IF       ( CONDITION1 )

     MOVE      "X9! BC *; X0; G", doCmd //Use ABC break point!

     ELSE      IF ( CONDITION2 )

     MOVE      "X9! BC *; X1; G", doCmd //Use XYZ break point!

     ELSE

     MOVE      "X9! X0; X1; G", doCmd //Use both break points!

     ENDIF

 

     DEBUG      CMD=doCmd

 

 

See Also: PLBDBUG Commands, PLBDBUG

 



System Utilities Window Size Command (SUNDBUG)