Debugging Tools for Windows
Debugging through a Terminal Server Session
In Windows XP and later operating systems, debugging through a terminal server session is just like debugging any other way. However, the Windows 2000 and Windows NT 4.0 operating systems will not allow debugging across session boundaries. This article discusses two possible ways to get around this restriction.
Using DbgSrv
- Set up a process server on the computer running the target service using DbgSrv.
- Once a protocol is chosen, start the process server.
- Start the debugger as a smart client on terminal server, attaching it to the target service. This is done by using the debugger's –premote option.
- Begin debugging.
For more information on using DbgSrv and other process servers, see the Process Servers (User Mode) topic.
Using Scheduled Tasks
Scheduled tasks are instantiated in Session 0, and anything may be run using command line parameters within a scheduled task. The steps to debug a service running in Session 0 while connected to a computer through a terminal server session are as follows:
On the Server: - Create a Task Item which attaches the debugger to the service with appropriate server options. For example, the Task Item might run one of the following commands:
- Set this task to run according to any schedule. For example, set it for one time only.
- Specify an account with administrative privileges for the debugger process to run under.
- Check the "Open the Advanced Tab upon Finishing" box.
- Uncheck the "Delete this task if it is not scheduled to run again" box under the SETTINGS tab.
- Save the Task Item, entering password information when prompted.
- Run the Task Item in Session 0 by right clicking the Task Item and selecting RUN under the context menu.
In the Terminal Services Emulation Window on your Workstation: - Run WinDbg.
- From the file menu, go to the "Connect to Remote Session" dialog box.
- Click the "Browse" button.
- Type in the machine name of the server running the target process and click "Refresh."
- In the "List of Remote Sessions" that appears, select the one you want to use (typically, only one session will appear), and click "OK."
- In the "Connect to Remote Session" dialog box, a connection string should appear. Click "OK."
The debugger should now be attached to the service specified in the Task Item.
Note: This method will only work on Windows NT 4.0 Terminal Server Edition and on Windows 2000 Serer with Terminal Services installed. This method will fail on Workstation Operating Systems.
Build machine: CAPEBUILD