|
||||||
|
Q. How do I debug a module in the user process on the PC?A. Debugging the user process on the PC is similar to debugging under UNIX in that, in both cases, you must attach to a running process. You attach to the process using its process ID or PID. Once the user process is running, you can determine its PID under NT V4 or V5, by doing the following:
BE CAREFUL because there is a windows NT process which is also called USER.EXE. Make sure you select the correct user.exe. Under Windows '95, you can use Spy++ to find the PID:
Invoke the Visual C++ debugger, MSDEV, and specify the PID determined above as an option. Run: MSDEV -p <PID> This command can be run from either a command shell, or from the Desktop: Start->Run. The "msdev -p PID" feature has been available from MSDEV v4.0. This means that users can do this with AVS/Express. On older systems (prior to NT 4.0), you can user other methods to determine a process's PID, such as PSTAT (ships on NT 3.51 as well). The PID is the number just preceeeding the process name. For example, E:\avs\express> msdev\bin\winnt\pstat.exe | grep "user.exe" 0:00:00.420 0:00:00.550 2624 753 1032 8 47 2 248 user.exe pid: f8 pri: 8 Hnd: 47 Pf: 753 Ws: 2624K user.exe In this case, 248 is the process id for user.exe. You use this as the value following the "-p" switch on the msdev commandline.
| |||||