Microsoft KB Archive/241848

= How to set up remote debugging quickly by using Visual C++ 5.0 or Visual C++ 6.0 =

Article ID: 241848

Article Last Modified on 9/29/2005

-

APPLIES TO


 * Microsoft Visual C++ 6.0 Standard Edition
 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 5.0 Professional Edition
 * Microsoft Visual C++ 6.0 Professional Edition

-



This article was previously published under Q241848



SUMMARY
This article describes how to set up remote debugging quickly when you use Microsoft Visual C++ 5.0 or Microsoft Visual C++ 6.0 to debug applications on non-development computers.



MORE INFORMATION
Note In these steps, the target computer is the computer that does not have Visual C++ installed on it, and it is the computer that is usually called the "clean" computer. The host computer is the computer on which Visual C++ is installed where the debugging with the integrated development environment (IDE) occurs.  Make sure that both computers can see each other on the network. This makes it easier than setting up a serial connection between the two and makes the remote debugging much faster. On the target computer, create a share so that the host computer can access it. For example, it debug on the host like such as \\server\share\ . Copy the following files to the target computer share created or the system folder. On a computer that is running Microsoft Windows 95, Microsoft Windows 98, Microsoft Windows NT 4.0, or Microsoft Windows 2000, the remote debug monitor consists of the following files:  Msvcmon.exe Msvcrt.dll Tln0t.dll Dm.dll</li> Msvcp6o.dll</li> Msdis110.dll</li></ul>

Note In Windows NT, the remote debugger also requires the Psapi.dll file. The files are located in the following folders:

Note If the Msvcrt.dll file is on the host computer and is an earlier version than the version of the Msvcrt.dll file that is on the target computer, do not copy the Msvcrt.dll file to the target. If the Msvcrt.dll file is copied to the target, restart the target computer because the Msvcrt.dll file is a known DLL.</li> Copy your DLLs and .exe files to the share. Be sure to copy any third-party information that you may need. Also copy any dependent DLLs such as Mfc42d.dll and Msvcrtd.dll to the share. Also, make sure all that all COM DLL and .exe files being used by your program are registered on the target.</li> Copy the .pdb files to the share. This includes all of the .pdb files in the debug or release folders for the project on the host computer. If you do not have any .pdb files because you are doing release builds, you can add debug info to the release project. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> On the Project menu, click Settings.</li> Click the C/C++ tab.</li> Click Category, and then click General.</li> Change Debug info from None to Program Database.</li> Click the Link tab.</li> Click Category, and then click General.</li> Click to select the Generate Debug Info check box.</li> Rebuild and run.</li></ol> </li> On the host computer, the one with the source code, change the debug target in the Remote executable path and file name box in the Project Settings Debug tab to reflect the DLL/EXE that is to be debugged.

For example: \\server\share\ </li> In the Visual C++ IDE, click Debugger Remote Connection on the Build menu select. Change it from Local to Remote. Click Settings, and then change the Target machine name or address. You can also give an IP address instead.</li> Set breakpoints in the source code that you want to debug. Do this before you start the remote monitor.</li> <li>On the target computer, run Msvcmon.exe. This has to be running before you try to connect. Click Settings, and then change the Target machine name or address to the host computer name. You can also give an IP address instead. Always be sure that the target has this running before wondering why the debugger is not working.</li></ol>

You are ready to debug now. On the host computer, click Start Debug on the Build menu, and then click Go.

<div class="references_section">