Debugging requests that spawn daemons: 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 2: Line 2:
<span class="f_Para">If the application you are debugging spawns a daemon in either of the following cases, the daemon code is displayed in a dynamically created </span><span class="f_GUIlabel">Daemon</span><span class="f_Para"> tab:</span>
<span class="f_Para">If the application you are debugging spawns a daemon in either of the following cases, the daemon code is displayed in a dynamically created </span><span class="f_GUIlabel">Daemon</span><span class="f_Para"> tab:</span>


*A SOUL Daemon object </span><span class="f_Monospace">Run</span><span class="f_ListBul1"> method for a daemon or transactional daemon.</span>
*A SOUL Daemon object </span><span class="term">Run</span><span class="f_ListBul1"> method for a daemon or transactional daemon.</span>
 
*A synchronous $COMMBG request (an output $list parameter is specified for the function)</span>
*A synchronous $COMMBG request (an output $list parameter is specified for the function)</span>


[[File:daemon1f2_zoom65.gif|632x474px|daemon1f2]]<span class="f_Para"> </span>
[[File:daemon1f2_zoom65.gif|632x474px|daemon1f2]]


<span class="f_Para">While the code in the </span><span class="f_GUIlabel">Daemon (1)</span><span class="f_Para"> tab has focus, the current program in the </span><span class="f_GUIlabel">Source Code</span><span class="f_Para"> tab waits for the daemon code to execute. The code line that spawned the daemon is highlighted, while the remaining </span><span class="f_GUIlabel">Source Code</span><span class="f_Para"> lines are dimmed as a reminder that this code is not executable (the </span><span class="f_GUIlabel">Run, Step, </span><span class="f_Para">and </span><span class="f_GUIlabel">Step Over</span><span class="f_Para"> buttons apply to the active code in the </span><span class="f_GUIlabel">Daemon (1)</span><span class="f_Para"> tab). The </span><span class="f_GUIlabel">Source Code</span><span class="f_Para"> lines are scrollable, however. </span>
<span class="f_Para">While the code in the </span><var>Daemon (1)</var><span class="f_Para"> tab has focus, the current program in the </span><var>Source Code</var><span class="f_Para"> tab waits for the daemon code to execute. The code line that spawned the daemon is highlighted, while the remaining </span><var>Source Code</var><span class="f_Para"> lines are dimmed as a reminder that this code is not executable (the </span><var>Run, Step, </var><span class="f_Para">and </span><var>Step Over</var><span class="f_Para"> buttons apply to the active code in the </span><var>Daemon (1)</var><span class="f_Para"> tab). The </span><var>Source Code</var><span class="f_Para"> lines are scrollable, however. </span>


[[File:daemon2c1_zoom65.gif|637x329px|daemon2c1]]<span class="f_Para"> </span>
[[File:daemon2c1_zoom65.gif|637x329px|daemon2c1]]


<span class="f_Para">Commands you invoke, like </span><span class="f_GUIlabel">Step</span><span class="f_Para"> or </span><span class="f_GUIlabel">Run,</span><span class="f_Para"> execute for the code on the </span><span class="f_GUIlabel">Daemon (1)</span><span class="f_Para"> tab. When daemon execution is complete, the spawning program regains focus and the </span><span class="f_GUIlabel">Daemon (1)</span><span class="f_Para"> tab is removed. </span>
<span class="f_Para">Commands you invoke, like </span><var>Step</var><span class="f_Para"> or </span><var>Run,</var><span class="f_Para"> execute for the code on the </span><var>Daemon (1)</var><span class="f_Para"> tab. When daemon execution is complete, the spawning program regains focus and the </span><var>Daemon (1)</var><span class="f_Para"> tab is removed. </span>


==== Multiple daemons  ====
==== Multiple daemons  ====
<span class="f_Para">If your program has daemons that call additional daemons, the Debugger will display their code on a separate tab, dynamically spawning more Daemon tabs (</span><span class="f_GUIlabel">Daemon (2)</span><span class="f_Para">, </span><span class="f_GUIlabel">Daemon (3)</span><span class="f_Para">, and so on up to 5). Each new Daemon page will get focus and respond to the code execution buttons, while the </span><span class="f_GUIlabel">Source Code</span><span class="f_Para"> page and preceding Daemon pages will wait for the current daemon execution to complete. After the current daemon code runs to completion, its tab will be removed, </span><span class="f_Monospace">Daemon thread completed</span><span class="f_Para"> will be displayed in the Status bar, and the preceding Daemon page will regain focus.</span>
<span class="f_Para">If your program has daemons that call additional daemons, the Debugger will display their code on a separate tab, dynamically spawning more Daemon tabs (</span><var>Daemon (2)</var><span class="f_Para">, </span><var>Daemon (3)</var><span class="f_Para">, and so on up to 5). Each new Daemon page will get focus and respond to the code execution buttons, while the </span><var>Source Code</var><span class="f_Para"> page and preceding Daemon pages will wait for the current daemon execution to complete. After the current daemon code runs to completion, its tab will be removed, </span><span class="term">Daemon thread completed</span><span class="f_Para"> will be displayed in the Status bar, and the preceding Daemon page will regain focus.</span>


==== Discontinue Daemon debugging ====
==== Discontinue Daemon debugging ====
<span class="f_Para">You can optionally have the Debugger run in a mode that does not display daemon code in the Debugger Client. In this mode, the Debugger runs all other code [[step_next_over_run.html#run|as usual]] but suspends the display (but not the execution) of daemon code. </span>
<span class="f_Para">You can optionally have the Debugger run in a mode that does not display daemon code in the Debugger Client. In this mode, the Debugger runs all other code [[Step, Step Over, and Run#Run|as usual]] but suspends the display (but not the execution) of daemon code. </span>


<span class="f_Para">To enter this mode, from the </span><span class="f_GUIlabel">Source Code</span><span class="f_Para"> page at any point during program execution, you simply press the Alt key and click the </span><span class="f_GUIlabel">Run</span><span class="f_Para"> button (the ALT-F5 key combination is also equivalent, by [[default_buttons_keys.html|default]]). Equivalent alternatives are the </span><span class="f_Monospace">[[runWithoutDaemons command|runWithoutDaemons]]</span><span class="f_Para"> command and the </span><span class="f_GUIlabel">Run Without Daemons</span><span class="f_Para"> option of the </span><span class="f_GUIlabel">Execution</span><span class="f_Para"> menu. </span>
<span class="f_Para">To enter this mode, from the </span><var>Source Code</var><span class="f_Para"> page at any point during program execution, you simply press the Alt key and click the </span><var>Run</var><span class="f_Para"> button (the ALT-F5 key combination is also equivalent, by [[Default settings of buttons and hot keys|default]]). Equivalent alternatives are the </span><span class="term">[[runWithoutDaemons command|runWithoutDaemons]]</span><span class="f_Para"> command and the </span><span class="term">Run Without Daemons</span><span class="f_Para"> option of the </span><span class="term">Execution</span><span class="f_Para"> menu. </span>


<span class="f_Para">Once this mode is entered, all debugging of Daemons is suspended:</span>
<span class="f_Para">Once this mode is entered, all debugging of Daemons is suspended:</span>


*Subsequent daemon code executes normally but is not displayed </span>
*Subsequent daemon code executes normally but is not displayed </span>
*No </span><span class="f_GUIlabel">Daemon (1)</span><span class="f_ListBul1"> tab is shown in the GUI </span>
*No </span><var>Daemon (1)</var><span class="f_ListBul1"> tab is shown in the GUI </span>
*No daemon source code is sent from the mainframe to the PC </span>
*No daemon source code is sent from the mainframe to the PC </span>


==== Debugging an interactive daemon   ====
==== Debugging an interactive daemon   ====


<span class="f_Para">A daemon you have spawned with a SOUL Daemon class </span><span class="f_Monospace">Run</span><span class="f_Para"> method (or </span><span class="f_Monospace">RunAsynchronously</span><span class="f_Para"> or </span><span class="f_Monospace">RunIndependently</span><span class="f_Para">) might temporarily return control to its master thread by issuing a </span><span class="f_Monospace">ReturnToMaster</span><span class="f_Para"> method. The master thread may do further processing and then return control to the daemon by issuing a </span><span class="f_Monospace">Continue</span><span class="f_Para"> method (or </span><span class="f_Monospace">ContinueAsync</span><span class="f_Para"> or </span><span class="f_Monospace">ContinueIndependently</span><span class="f_Para">). There may be multiple such exchanges of control.</span>
<span class="f_Para">A daemon you have spawned with a SOUL Daemon class </span><span class="term">Run</span><span class="f_Para"> method (or </span><span class="term">RunAsynchronously</span><span class="f_Para"> or </span><span class="term">RunIndependently</span><span class="f_Para">) might temporarily return control to its master thread by issuing a </span><span class="term">ReturnToMaster</span><span class="f_Para"> method. The master thread may do further processing and then return control to the daemon by issuing a </span><span class="term">Continue</span><span class="f_Para"> method (or </span><span class="term">ContinueAsync</span><span class="f_Para"> or </span><span class="term">ContinueIndependently</span><span class="f_Para">). There may be multiple such exchanges of control.</span>


<span class="f_Para">This interactive processing is captured in the Debugger by: </span>
<span class="f_Para">This interactive processing is captured in the Debugger by: </span>
Line 36: Line 35:
# Keeping a tab (Source Code) open for the code of the master thread and a tab (Daemon) open for the daemon, as usual.  
# Keeping a tab (Source Code) open for the code of the master thread and a tab (Daemon) open for the daemon, as usual.  
# Giving focus to the tab whose code is executing, and dimming the code in the other tab.  
# Giving focus to the tab whose code is executing, and dimming the code in the other tab.  
 
:: If a master thread issues a <span class="term">ContinueAsync</span><span class="f_ListContinue"> or </span><span class="term">ContinueIndependently</span><span class="f_ListContinue"> call, however, the focus does not shift to the </span><var>Daemon</var><span class="f_ListContinue"> tab (though its code remains available for inspection). </span>
<span class="f_ListContinue">If a master thread issues a </span><span class="f_Monospace">ContinueAsync</span><span class="f_ListContinue"> or </span><span class="f_Monospace">ContinueIndependently</span><span class="f_ListContinue"> call, however, the focus does not shift to the </span><span class="f_GUIlabel">Daemon</span><span class="f_ListContinue"> tab (though its code remains available for inspection). </span>


'''See Also'''
'''See Also'''
 
: [[Controlling the execution of program code|Controlling the execution of program code]]
<span class="f_SimpleList">[[controlling_execution.html|Controlling the execution of program code]] </span>
: [[The tabbed pages#Source Code tab|Source Code tab]]
 
<span class="f_SimpleList">[[tour_tabbed_pages.html#source_code_tab|Source Code tab]]</span>


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

Latest revision as of 20:41, 7 April 2023

If the application you are debugging spawns a daemon in either of the following cases, the daemon code is displayed in a dynamically created Daemon tab:

  • A SOUL Daemon object Run method for a daemon or transactional daemon.
  • A synchronous $COMMBG request (an output $list parameter is specified for the function)

daemon1f2

While the code in the Daemon (1) tab has focus, the current program in the Source Code tab waits for the daemon code to execute. The code line that spawned the daemon is highlighted, while the remaining Source Code lines are dimmed as a reminder that this code is not executable (the Run, Step, and Step Over buttons apply to the active code in the Daemon (1) tab). The Source Code lines are scrollable, however.

daemon2c1

Commands you invoke, like Step or Run, execute for the code on the Daemon (1) tab. When daemon execution is complete, the spawning program regains focus and the Daemon (1) tab is removed.

Multiple daemons 

If your program has daemons that call additional daemons, the Debugger will display their code on a separate tab, dynamically spawning more Daemon tabs (Daemon (2), Daemon (3), and so on up to 5). Each new Daemon page will get focus and respond to the code execution buttons, while the Source Code page and preceding Daemon pages will wait for the current daemon execution to complete. After the current daemon code runs to completion, its tab will be removed, Daemon thread completed will be displayed in the Status bar, and the preceding Daemon page will regain focus.

Discontinue Daemon debugging

You can optionally have the Debugger run in a mode that does not display daemon code in the Debugger Client. In this mode, the Debugger runs all other code as usual but suspends the display (but not the execution) of daemon code.

To enter this mode, from the Source Code page at any point during program execution, you simply press the Alt key and click the Run button (the ALT-F5 key combination is also equivalent, by default). Equivalent alternatives are the runWithoutDaemons command and the Run Without Daemons option of the Execution menu.

Once this mode is entered, all debugging of Daemons is suspended:

  • Subsequent daemon code executes normally but is not displayed
  • No Daemon (1) tab is shown in the GUI
  • No daemon source code is sent from the mainframe to the PC

Debugging an interactive daemon  

A daemon you have spawned with a SOUL Daemon class Run method (or RunAsynchronously or RunIndependently) might temporarily return control to its master thread by issuing a ReturnToMaster method. The master thread may do further processing and then return control to the daemon by issuing a Continue method (or ContinueAsync or ContinueIndependently). There may be multiple such exchanges of control.

This interactive processing is captured in the Debugger by:

  1. Keeping a tab (Source Code) open for the code of the master thread and a tab (Daemon) open for the daemon, as usual.
  2. Giving focus to the tab whose code is executing, and dimming the code in the other tab.
If a master thread issues a ContinueAsync or ContinueIndependently call, however, the focus does not shift to the Daemon tab (though its code remains available for inspection).

See Also

Controlling the execution of program code
Source Code tab