Running to a specific procedure: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 10: Line 10:
: 2. <span class="f_ListNum1">In the text area below the </span><var>Run Until Procedure</var><span class="f_ListNum1"> button in the </span><var>Skip Whole Programs</var><span class="f_ListNum1"> area, specify the name of the procedure at which to begin debugging (this input is </span><span class="term">not</span><span class="f_ListNum1"> case sensitive). </span>
: 2. <span class="f_ListNum1">In the text area below the </span><var>Run Until Procedure</var><span class="f_ListNum1"> button in the </span><var>Skip Whole Programs</var><span class="f_ListNum1"> area, specify the name of the procedure at which to begin debugging (this input is </span><span class="term">not</span><span class="f_ListNum1"> case sensitive). </span>


<span class="f_Para"> </span>[[File:runproc5b2_zoom45.gif|368x252px|runproc5b2]]<span class="f_ListContinue">  </span>
: [[File:runproc5b2_zoom45.gif|368x252px|runproc5b2]]


: 3. <span class="f_ListNum1">Click </span><var>Run Until Procedure. </var><span class="f_ListNum1"> </span>
: 3. <span class="f_ListNum1">Click </span><var>Run Until Procedure. </var><span class="f_ListNum1"> </span>
Line 28: Line 28:
* <span class="f_ListBul1">You can also use leading, trailing, or intermediate wildcards to form a name pattern to stop</span><span class="f_ListContinue"> the Debugger on the first procedure that matches the pattern</span><span class="f_ListBul1">: </span>
* <span class="f_ListBul1">You can also use leading, trailing, or intermediate wildcards to form a name pattern to stop</span><span class="f_ListContinue"> the Debugger on the first procedure that matches the pattern</span><span class="f_ListBul1">: </span>
* <span class="f_ListBul2">An asterisk </span><span class="f_ListBul4">(*) </span><span class="f_ListBul2">represents any string of characters. </span>
* <span class="f_ListBul2">An asterisk </span><span class="f_ListBul4">(*) </span><span class="f_ListBul2">represents any string of characters. </span>
 
: <span class="term">*.M*</span><span class="f_ListContinue2"> would stop the code execution at procedure </span><span class="f_Monospace">ACC.MOE</span><span class="f_ListContinue2">, or </span><span class="f_Monospace">HOME.MARY</span><span class="f_ListContinue2">, or </span><span class="f_Monospace">P.MOO</span><span class="f_ListContinue2">., and so on</span><span class="f_ListBul2">.  </span>
<span class="term">*.M*</span><span class="f_ListContinue2"> would stop the code execution at procedure </span><span class="f_Monospace">ACC.MOE</span><span class="f_ListContinue2">, or </span><span class="f_Monospace">HOME.MARY</span><span class="f_ListContinue2">, or </span><span class="f_Monospace">P.MOO</span><span class="f_ListContinue2">., and so on</span><span class="f_ListBul2">.  </span>
 
* <span class="f_ListBul2">A question mark </span><span class="f_ListBul4">(?) </span><span class="f_ListBul2">represents any single character. </span>
* <span class="f_ListBul2">A question mark </span><span class="f_ListBul4">(?) </span><span class="f_ListBul2">represents any single character. </span>
 
: <span class="term">?.*</span><span class="f_ListContinue2"> matches </span><span class="f_Monospace">P.MOO</span><span class="f_ListContinue2">, but not </span><span class="f_Monospace">ACC.MOE</span><span class="f_ListContinue2">. </span>
<span class="term">?.*</span><span class="f_ListContinue2"> matches </span><span class="f_Monospace">P.MOO</span><span class="f_ListContinue2">, but not </span><span class="f_Monospace">ACC.MOE</span><span class="f_ListContinue2">. </span>
 
* <span class="f_ListBul2">A double quote </span><span class="f_ListBul4">(&quot;) </span><span class="f_ListBul2">escapes wildcard translation of the asterisk or question mark that follows it. </span>
* <span class="f_ListBul2">A double quote </span><span class="f_ListBul4">(&quot;) </span><span class="f_ListBul2">escapes wildcard translation of the asterisk or question mark that follows it. </span>
: <span class="term">?.&quot;*</span><span class="f_ListContinue2"> matches </span><span class="f_Monospace">P.*</span><span class="f_ListContinue2">, but not </span><span class="f_Monospace">P.MOO</span><span class="f_ListContinue2">. </span>


<span class="term">?.&quot;*</span><span class="f_ListContinue2"> matches </span><span class="f_Monospace">P.*</span><span class="f_ListContinue2">, but not </span><span class="f_Monospace">P.MOO</span><span class="f_ListContinue2">. </span>
'''Note:'''<span class="f_ListNote"> The </span><var>Model 204</var><span class="f_ListNote"> LAUDPROC (Length of Audit Procedure Names) User 0 parameter (default: 21) must be set to the size of the largest procedure name that will be filtered. Otherwise, name matching is done against truncated procedure names.</span>
 
'''Note:'''<span class="f_ListNote"> The </span><span class="f_Product">Model 204</span><span class="f_ListNote"> LAUDPROC (Length of Audit Procedure Names) User 0 parameter (default: 21) must be set to the size of the largest procedure name that will be filtered. Otherwise, name matching is done against truncated procedure names.</span>


=== Precedence and scope for Run Until ===
=== Precedence and scope for Run Until ===
Line 51: Line 46:
* <span class="f_ListBul1">The end of the debugging session </span>
* <span class="f_ListBul1">The end of the debugging session </span>
: Once a session ends, either normally or through a lost connection, and Run Until searching is interrupted before it finds a specified procedure, a restarted Client does not automatically resume its search.
: Once a session ends, either normally or through a lost connection, and Run Until searching is interrupted before it finds a specified procedure, a restarted Client does not automatically resume its search.
* <span class="f_ListBul1">The end of an HTTP request (</span><span class="f_Product">Janus Debugger</span><span class="f_ListBul1">) </span>
* <span class="f_ListBul1">The end of an HTTP request (</span><var>Janus Debugger</var><span class="f_ListBul1">) </span>
: If the current HTTP transaction completes and the Debugger does not encounter the target procedure, it does not continue its search for the target into subsequent HTTP requests. This is ordinarily not an issue.  
: If the current HTTP transaction completes and the Debugger does not encounter the target procedure, it does not continue its search for the target into subsequent HTTP requests. This is ordinarily not an issue.  


Line 59: Line 54:
# In the Client, select <var>Preferences</var><span class="f_ListNum1"> from the </span><var>File</var><span class="f_ListNum1"> menu (or use the CTRL-P keyboard shortcut). </span>
# In the Client, select <var>Preferences</var><span class="f_ListNum1"> from the </span><var>File</var><span class="f_ListNum1"> menu (or use the CTRL-P keyboard shortcut). </span>
# n the <var>Preferences</var><span class="f_ListNum1"> dialog box, select the </span><var>Run Until spans debug sessions</var><span class="f_ListNum1"> checkbox (which is clear by default), then click </span><var>Done</var><span class="f_ListNum1">. </span>
# n the <var>Preferences</var><span class="f_ListNum1"> dialog box, select the </span><var>Run Until spans debug sessions</var><span class="f_ListNum1"> checkbox (which is clear by default), then click </span><var>Done</var><span class="f_ListNum1">. </span>
: [[File:preferences22dfrag_zoom50.gif|282x118px|preferences22dFrag]]<span class="f_ListContinue"> </span>


[[File:preferences22dfrag_zoom50.gif|282x118px|preferences22dFrag]]<span class="f_ListContinue"> </span>
<span class="f_Para">Now, with a single invocation of Run Until, you can be sure to display the procedure you want. If, for example, the </span><var>TN3270 Debugger</var><span class="f_Para"> was turned off and then on again, the Client will resume an incompleted Run Until search. Or in the case where you are debugging a request that satisfies an individual frame or frameset, the Client will continue (with no other execution breaks) through the code for subsequent frames until it finds the specified </span><span class="f_ListContinue">procedure. </span>
 
<span class="f_Para">Now, with a single invocation of Run Until, you can be sure to display the procedure you want. If, for example, the </span><span class="f_Product">TN3270 Debugger</span><span class="f_Para"> was turned off and then on again, the Client will resume an incompleted Run Until search. Or in the case where you are debugging a request that satisfies an individual frame or frameset, the Client will continue (with no other execution breaks) through the code for subsequent frames until it finds the specified </span><span class="f_ListContinue">procedure. </span>


<span class="f_ListContinue">This setting takes effect immediately, and it persists over multiple runs of the Client. </span>
<span class="f_ListContinue">This setting takes effect immediately, and it persists over multiple runs of the Client. </span>

Latest revision as of 22:46, 21 April 2023

You can direct the Debugger to run an application's code without interruption until it reaches a specific outer, command level, procedure, and then to display that procedure for debugging.  The Debugger also stops at procedures that are included from a daemon thread.

For example, you are having a problem with the procedure P.MOE, but the normal flow of the application moves through procedures LARRY, SHEMP, and CURLY prior to P.MOE. The three preceding procedures are known to work fine, and you don't want to interactively debug them.

To run the application normally, executing the preceding procedures, but stopping at P.MOE to begin debugging:

1. Beginning with your application program displayed in the Source Code page, select the Proc Selection tab.
2. In the text area below the Run Until Procedure button in the Skip Whole Programs area, specify the name of the procedure at which to begin debugging (this input is not case sensitive).
runproc5b2
3. Click Run Until Procedure.
The application executes until it reaches the specified procedure, then the Source Code page highlights the first executable User Language statement in that procedure. You are ready to debug.

You can also execute Run Until processing by using:

  • The Execution menu Run Until Proc option, which will run immediately, using the procedure name currently specified on the Proc Selection tab
  • The mappable Client command runUntil
  • A white list, as described in Running only to listed procedures. Run Until for a specific procedure is the same as a white list that contains a single procedure.

Shortcuts for specifying procedure names 

Instead of specifying the whole procedure name in the Run Until Procedure text box:

  • You may be able to find the name you want by clicking the arrow to the right of the Run Until Procedure text box.
This reveals a list of the names of as many as the last twenty procedures you entered (for this and from previous sessions). These names are also saved in the until.txt file.
  • You can also use leading, trailing, or intermediate wildcards to form a name pattern to stop the Debugger on the first procedure that matches the pattern:
  • An asterisk (*) represents any string of characters.
*.M* would stop the code execution at procedure ACC.MOE, or HOME.MARY, or P.MOO., and so on.  
  • A question mark (?) represents any single character.
?.* matches P.MOO, but not ACC.MOE.
  • A double quote (") escapes wildcard translation of the asterisk or question mark that follows it.
?."* matches P.*, but not P.MOO.

Note: The Model 204 LAUDPROC (Length of Audit Procedure Names) User 0 parameter (default: 21) must be set to the size of the largest procedure name that will be filtered. Otherwise, name matching is done against truncated procedure names.

Precedence and scope for Run Until

As described for the Break method, the "run until" processing takes precedence over any Break method calls that may be present in your procedures. Run Until ignores such calls.

Run Until also continues without interruption past any persistent session suspend/resume sequences.

The default boundaries beyond which Run Until does not continue processing are these:

  • The end of the debugging session
Once a session ends, either normally or through a lost connection, and Run Until searching is interrupted before it finds a specified procedure, a restarted Client does not automatically resume its search.
  • The end of an HTTP request (Janus Debugger)
If the current HTTP transaction completes and the Debugger does not encounter the target procedure, it does not continue its search for the target into subsequent HTTP requests. This is ordinarily not an issue.

It may be the case, however, that you want the Debugger not to respect these boundaries. You do not want to have to repeatedly invoke Run Until for the same procedure. For example, you are working with HTML frames, where each frame and frameset is a separate HTTP transmission to the browser, and you want Run Until to span all these HTTP requests rather than stopping for each frame that involves User Language.

To change the span of Run Until:

  1. In the Client, select Preferences from the File menu (or use the CTRL-P keyboard shortcut).
  2. n the Preferences dialog box, select the Run Until spans debug sessions checkbox (which is clear by default), then click Done.
preferences22dFrag

Now, with a single invocation of Run Until, you can be sure to display the procedure you want. If, for example, the TN3270 Debugger was turned off and then on again, the Client will resume an incompleted Run Until search. Or in the case where you are debugging a request that satisfies an individual frame or frameset, the Client will continue (with no other execution breaks) through the code for subsequent frames until it finds the specified procedure.

This setting takes effect immediately, and it persists over multiple runs of the Client.

Interrupting Run Until processing

Run Until processing is interruptible: the command breakOnNextProc lets you override a Run Until to interactively debug the next included procedure.

To use a manual interrupt for Run Until processing:

  1. Map the breakOnNextProc command to a Client button or hot key (as described in Setting up the ui.xml file) or in a macro (as described in Using Debugger macros).
  2. While debugging an application where Run Until processing is active, invoke the button or hot key or macro.

"Break on next proc set" displays in the Status bar to indicate the command has been successfully issued, and the next procedure included at command level (or from APSY) will be debugged, even if the Run Until would normally ignore it.

In the same way you interrupt Run Until processing, you can also interrupt White List procedure processing.

See Also

Selectively excluding source code blocks
Locating and editing procedure source files