|Powered by QM on a Rpi server|
KnowledgeBase 00033: Debugging Phantom Processes
This article was originally published as a Tip of the Week.
On some systems, debugging phantom processes can be awkward. The QMBasic phantom debugger makes this easy.
The PDEBUG Command
Developers use the PDEBUG command to activate the phantom debugger.
PDEBUGThis form of the command causes the process to pause until a phantom running under the same user name in the same account executes a QMBasic DEBUG statement.
PDEBUG commandThis form of the command is a shortcut for executing a PHANTOM command and then waiting for the phantom to execute a QMBasic DEBUG statement.
Using the Debugger
When the phantom process to be debugged executes a QMBasic DEBUG statement, the process executing the PDEBUG statement enters the debugger. This operates exactly as for debugging of a foreground process except that it is not possible to view the application output screen as the process is not associated with a terminal device.
For example, if the phantom process would normally be started by typing something like
PHANTOM RUN MYPOGat the command prompt, simply do
PDEBUG RUN MYPROGinstead.
If, on the other hand, the phantom is started as part of, for example, an incoming web transaction, type
PDEBUGfrom a process running in the same account as the phantom and as the same username. Then do whatever is needed to cause the web transaction to run.
In both cases, the debugger will wake up when the phantom process executes a DEBUG statement.
Although mainly of use to debug phantom processes, the phantom debugger can also be used to debug QMClient sessions.