BUG: Can Not Attach Process to Debugger from NT Task Manager

Last reviewed: May 1, 1997
Article ID: Q167798
The information in this article applies to:
  • Microsoft Visual C++, 32-bit Editions, version 5.0

SYMPTOMS

After installing Visual C++ version 5.0, you may not be able to attach an active process from Windows NT Task Manager. A message box titled "Unable to Attach Debugger" with the following error message appears:

   The operation could not be completed. The system cannot find the file
   specified.

CAUSE

This happens because the registry entry in HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Windows NT\CurrentVersion\AeDebug has a space in the path to MSDEV.EXE. By default, the installed path to MSDEV.EXE is C:\Program Files\DevStudio\SharedIDE\BIN\.

RESOLUTION

The resolution is to change the entry in the AeDebug registry key to:

 "<install drive>\Program Files\DevStudio\SharedIDE\BIN\msdev.exe" -p %id -
 e %id

The quotes around the executable path and name are necessary in order to correct this problem.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\ CurrentVersion\AeDebug is used to attach the Visual C++ debugger to an active process by launching MSDEV.EXE. It is also used by Just-In-Time (JIT) debugging for the same purpose.

After you install Visual C++, the above registry key will have the following value:

   <drive>\Program Files\DevStudio\SharedIDE\BIN\msdev.exe -p %id -e %id

where <drive> is the drive letter where Visual C++ is installed.

JIT debugging works fine with the value above.

There are two ways you can attach an active process to the Visual C++ debugger. They are:

  1. In Developer Studio, in the Build menu, Start Debug allows you to Attach to Process where you select an active process from the list provided.

  2. In Windows NT, open the Task Manager, right-click an active process, and select Debug in the pop up window. This attaches the Visual C++ debugger to the selected active process. This method is similar to the method described in Q120707 "How to Debug an Active Process in 32-bit Visual C++."

The first method works without having to incorporate the fix described in this article because Visual C++ is already running.

Steps to Reproduce Behavior

  1. Start Windows NT Task Manager by pressing Ctrl-Alt-Delete, and then select Task Manager from the system dialog box.

  2. Select the Processes tab, then right-click the process you wish to attach to the debugger, and select Debug. If the fix described above is not in place, you will not be able to debug the process and you will receive the error message described in the SYMPTOMS section.

As mentioned earlier, Just-in-time debugging and attaching to a process from Developer Studio works without using the fix described in this article.

WARNING: Toggling the Just-in-time debugging check box in the Developer Studio Options--Debug menu tab rewrites the AeDebug registry key back to its original value.


Keywords : kbtool vcbuglist500 WBDebug kbbuglist
Version : 5.0
Platform : NT WINDOWS
Issue type : kbbug


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: May 1, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.