Debugging Taskman Tasks
From VistApedia
Background
The reason you would want to do this is that Taskman tasks are usually done in the background; so debugging them is difficult. In particular, you cannot use the debugger with them as they are not running in the foreground. This is a guide to help you run a task in the Foreground. Many thanks to the main Taskman programmer, Rick Marshall, for the directions. Questions? Hardhats google group.
Steps
- Place Taskman in Wait State (XUP -> XUTM WAIT)
- Invoke the code that schedules the task. The task will show up in ^%ZTSK
- Find your task in ^%ZTSK just to confirm its existence. It may be usually the last one; unless you are on a busy system.
- Put a breakpoint using ZBREAK on the code you want to debug
- Kill ^%ZTSCH("WAIT","MGR"). This allows the Manager to move the task to the job list.
- Set ^%ZTSCH("WAIT","MGR")=$H. This stops the Manager again.
- Kill ^%ZTSCH("STOP"). This lifts the ban on sub-managers.
- Run ^%ZTMS. It will break at the breakpoint. You put on. Now you are debugging the task in the foreground.
A tiny warning: Taskman frequently opens a device prior to running a task. If that's so, make sure your $ZSTEP is appropriate so that it switches between the current $IO and $P. GT.M will warn you if your output is going elsewhere.