INFO: Tips for Remote Debugging with Visual C++ 2.x, 4.0, 5.0

Last reviewed: October 7, 1997
Article ID: Q131058
The information in this article applies to:
  • The development environment included with: - Microsoft Visual C++, 32-bit Edition, versions 2.0, 2.1, 4.0, 4.2, 5.0

SUMMARY

Chapter 14 of the Visual C++ User's Guide for Visual C++ version 2.x and chapter 17 of the Visual C++ User's Guide for Visual C++ version 4.0 describe how to install the Remote Debug Monitor (MSVCMON.EXE) and how to configure the remote connection. Query on "Remote Debug" if you are using Visual C++ version 5.0. This article provides further details and gives two methods to help you get started. Note that Visual C++ versions 4.2 and 5.0 do not support WIN32S and Macintosh platforms. Version 5.0 does not support Serial connection.

MORE INFORMATION

The remote debug monitor is a small program on the target computer that communicates with the debugger and controls the execution of the program you are debugging.

To install the remote debug monitor:

  • On a Windows 95 or NT computer, the remote debug monitor consists of the following files: MSVCMON.EXE, MSVCRT40.DLL, TLN0COM.DLL, TLN0T.DLL, and DMN0.DLL. Copy these files to the remote computer. If you are using Visual C++ version 5.0, then copy MSVCMON.EXE, MSVCRT.DLL, TLN0T.DLL, DM.DLL, MSVCP5O.DLL and MSDIS100.DLL to the remote computer. If remote computer is NT 4.0, then copy PSAPI.DLL also.
  • On a Win32s computer, the remote debug monitor consists of MSVCMON.EXE, TLW3COM.DLL, and DMW3.DLL. These files are installed automatically during setup.
  • On a Macintosh, the remote monitor is a control panel, called VC++ Debug Monitor, installed automatically by the Visual C++ for Macintosh setup program.
  • On a Power Macintosh, the remote debugger is an application, called VC++ PowerMac Remote Monitor, installed automatically by the Visual C++ for Macintosh setup program. Setup also installs the following files: VC++ Power Macintosh File Utility, VC++ Power Macintosh ADSP Transport, VC++ Power Macintosh TCP/IP Transport, and VC++ Power Macintosh Serial Transport.

Method One - Windows NT host, Win32s remote.

If you are using Visual C++ versions 4.2 and 5.0, the host and remote machines can be either a Windows NT machine or a Windows 95 machine, as can the local machine. Therefore, the project can reside in the local machine of your choice.

  1. Setup a shared directory that both the local Windows NT machine and the remote machine can view. The shared directory can be on either machine or a network drive. The easiest option is to share the directory on the local Windows NT machine which contains the project's executable.

  2. Load the project into the Visual C++ development environment running on Windows NT.

  3. Open the Project Setting dialog box. (In Visual C++ 2.x, choose Settings from the Project menu; in Visual C++ 4.0, choose Settings from the Build menu; in Visual C++ 5.0, choose Settings from the Project menu.) Select the Debug tab. Set the following sections:

        - Executable for Debug Session: Enter the name and path of the
          executable as the local Windows NT computer sees it.
    

        - Additional DLLs: Enter the name and path of any DLLs as the local
          Windows NT computer sees them.
    

        - Remote Executable Path: Enter the name and path of the executable as
          the remote computer sees it.
    

        - Working Directory: Should be blank.
    

  4. Start the remote debugger on the remote computer by starting MSVCMON.EXE. For the Win32s platform, find the Visual C++ Win32s program group, and select the Visual C++ Debug Monitor icon. Choose the connect button to start the connection.

  5. On the Windows NT host computer, check the connection information. In the Visual C++ 2.x, choose Options from the Tools menu. Then select the Debug tab. Make sure Remote Debugging is selected. Choose the Connections button, and confirm the type of connection. Also, select Settings and confirm the settings. In Visual C++ 4.0, choose Remote Connection from the Tools menu. Confirm the choices for Platform and Connection. Select Settings to configure the specified connection.

    In Visual C++ 5.0, choose "Debugger Remote connection" from the Build menu. Choose Network (TCP/IP ) then Settings. Enter remote machine name or IP address, no password needed. You can ignore the symbolic information not found messages for the system DLLs when the debugger is started in Step 6 below.

    NOTE: For Intel (x86) machines, Visual C++ 2.x only supports remote debugging via serial connections. In Visual C++ 4.0, it is possible to debug using a network connection with TCP/IP except on Win32s, which requires a serial connection.

  6. Start Debugging.

Method Two

If you can't make a shareable directory, copy the executable and any needed DLLs to the remote computer. With this method you need to be sure that the executables and DLLs are re-copied whenever changes are made. All the other steps remain the same.

Troubleshooting

If the development environment can't find the executable, make sure the correct directories for the correct computers are given in step 3.

Since Visual C++ version 5.0 supports only TCP/IP connection, check for correct machine name and proper network connection with TCP/IP protocol available. The following troubleshooting does not apply to version 5.0.

If the connection fails:

  • Test the COM port by running Terminal (a Windows version 3.x and Windows NT applet) on both your Windows NT computer and your Win32s computer. (For information on how to use Terminal, please see your Windows manual.) Anything typed into Terminal on one computer should show up in Terminal on the other.
  • Check the COM port settings. The most reliable setting is 9600 baud with XON/XOFF.
  • Try a different cable (a null modem cable).
  • Try a different COM port.
  • If you are using the Windows debug kernel, use the normal kernel.
  • On Win32s, complete a Windows clean boot, and do not start any applications other than the remote monitor. For information about how to perform a clean boot, please see the following articles in the Microsoft Knowledge Base:

    ARTICLE-ID: Q87290

       TITLE     : What Is a Clean Boot for Windows 3.1?
    
       ARTICLE-ID: Q90511
       TITLE     : What Is a Clean Boot for Windows for Workgroups?
    


Additional query words: 9.00 9.10
Keywords : WBDebug kbtshoot
Version : WINNT:2.0,2.1,4.0,4.2,5.0;
Platform : NT WINDOWS
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 7, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.