Debugging requests that spawn daemons: Difference between revisions
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
*A SOUL Daemon object </span><span class="term">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"> </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> | <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"> </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> | <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> |
Revision as of 03:08, 4 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)
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.
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:
- 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.
- 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