Running to a specific procedure: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "__TOC__ <span class="f_Para">You can direct the Debugger to run an application's code without interruption until it reaches a specific outer, command level, procedure, and the...")
 
No edit summary
Line 6: Line 6:
<span class="f_Para">To run the application normally, executing the preceding procedures, but stopping at P.MOE to begin debugging: </span>
<span class="f_Para">To run the application normally, executing the preceding procedures, but stopping at P.MOE to begin debugging: </span>


: 1. <span class="f_ListNum1">Beginning with your application program displayed in the </span><span class="f_GUIlabel">Source Code</span><span class="f_ListNum1"> page, select the </span><span class="f_GUIlabel">Proc Selection</span><span class="f_ListNum1"> tab.</span>
: 1. <span class="f_ListNum1">Beginning with your application program displayed in the </span><var>Source Code</var><span class="f_ListNum1"> page, select the </span><var>Proc Selection</var><span class="f_ListNum1"> tab.</span>


: 2. <span class="f_ListNum1">In the text area below the </span><span class="f_GUIlabel">Run Until Procedure</span><span class="f_ListNum1"> button in the </span><span class="f_GUIlabel">Skip Whole Programs</span><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>
<span class="f_Para"> </span>[[File:runproc5b2_zoom45.gif|368x252px|runproc5b2]]<span class="f_ListContinue">  </span>


: 3. <span class="f_ListNum1">Click </span><span class="f_GUIlabel">Run Until Procedure. </span><span class="f_ListNum1"> </span>
: 3. <span class="f_ListNum1">Click </span><var>Run Until Procedure. </var><span class="f_ListNum1"> </span>
: The application executes until it reaches the specified procedure, then the <span class="f_GUIlabel">Source Code</span><span class="f_ListContinue"> page highlights the first executable User Language statement in that procedure. You are ready to debug. </span>
: The application executes until it reaches the specified procedure, then the <var>Source Code</var><span class="f_ListContinue"> page highlights the first executable User Language statement in that procedure. You are ready to debug. </span>


<span class="f_Para">You can also execute Run Until processing by using: </span>
<span class="f_Para">You can also execute Run Until processing by using: </span>


* <span class="f_ListContinue">The </span><span class="f_GUIlabel">Execution</span><span class="f_ListContinue"> menu </span><span class="f_GUIlabel">Run Until Proc</span><span class="f_ListContinue"> option, which will run immediately, using the procedure name currently specified on the </span><span class="f_GUIlabel">Proc Selection</span><span class="f_ListBul1"> tab</span>
* <span class="f_ListContinue">The </span><var>Execution</var><span class="f_ListContinue"> menu </span><var>Run Until Proc</var><span class="f_ListContinue"> option, which will run immediately, using the procedure name currently specified on the </span><var>Proc Selection</var><span class="f_ListBul1"> tab</span>
* <span class="f_ListBul1">The [[Introducing the configurable components#Commands|mappable]] Client command </span><span class="f_Monospace">[[runUntil command|runUntil]]</span>
* <span class="f_ListBul1">The [[Introducing the configurable components#Commands|mappable]] Client command </span><span class="f_Monospace">[[runUntil command|runUntil]]</span>
* <span class="f_ListBul1">A white list, as described in [[run_only_to_listed_procs.html|Running only to listed procedures.]] Run Until for a specific procedure is the same as a white list that contains a single procedure.</span>
* <span class="f_ListBul1">A white list, as described in [[Running only to listed procedures|Running only to listed procedures.]] Run Until for a specific procedure is the same as a white list that contains a single procedure.</span>


=== Shortcuts for specifying procedure names  ===
=== Shortcuts for specifying procedure names  ===
<span class="f_Para">Instead of specifying the whole procedure name in the </span><span class="f_GUIlabel">Run Until Procedure</span><span class="f_Para"> text box: </span>
<span class="f_Para">Instead of specifying the whole procedure name in the </span><var>Run Until Procedure</var><span class="f_Para"> text box: </span>


* <span class="f_ListBul1">You may be able to find </span><span class="f_Para">the name you want by clicking the arrow to the right of the </span><span class="f_GUIlabel">Run Until Procedure</span><span class="f_ListContinue"> </span><span class="f_Para">text box. </span>
* <span class="f_ListBul1">You may be able to find </span><span class="f_Para">the name you want by clicking the arrow to the right of the </span><var>Run Until Procedure</var><span class="f_ListContinue"> </span><span class="f_Para">text box. </span>
: 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 </span><span class="f_Monospace">until.txt</span><span class="f_ListContinue"> file.
: 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 </span><span class="f_Monospace">until.txt</span><span class="f_ListContinue"> file.
* <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>
Line 57: Line 57:


<span class="f_Para">To change the span of Run Until: </span>
<span class="f_Para">To change the span of Run Until: </span>
# In the Client, select <span class="f_GUIlabel">Preferences</span><span class="f_ListNum1"> from the </span><span class="f_GUIlabel">File</span><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 <span class="f_GUIlabel">Preferences</span><span class="f_ListNum1"> dialog box, select the </span><span class="f_GUIlabel">Run Until spans debug sessions</span><span class="f_ListNum1"> checkbox (which is clear by default), then click </span><span class="f_GUIlabel">Done</span><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>
Line 80: Line 80:


<span class="f_SeeAlso">See Also</span>
<span class="f_SeeAlso">See Also</span>
: [[selectively_excluding_source.html|Selectively excluding source code blocks]]
: [[Selectively excluding source code blocks|Selectively excluding source code blocks]]
: [[locating_editing_procedures.html|Locating and editing procedure source files]]
: [[
Displaying line information and editing procedures|Locating and editing procedure source files]]


[[Category:Debugger Home]]
[[Category:Debugger Home]]

Revision as of 03:11, 29 November 2022

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
[[

Displaying line information and editing procedures|Locating and editing procedure source files]]