Microsoft KB Archive/127802

= PRB: Debugger Loses Source/Disassembly File Mapping =

Article ID: 127802

Article Last Modified on 9/16/2003

-

APPLIES TO

 The Integrated Debugger, when used with:  Microsoft Visual C++ 2.0 Professional Edition

 Microsoft Visual C++ 2.1

 Microsoft Visual C++ 4.0 Standard Edition

 Microsoft Visual C++ 5.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 5.0 Professional Edition</li></ul>

 Microsoft Visual C++ .NET 2002 Standard Edition</li></ul>

 Microsoft Visual C++ .NET 2003 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q127802

<div class="symptoms_section">

SYMPTOMS
If you choose Cancel when asked for the location of a source file while debugging, you will not get another chance to map the disassembly code to its corresponding source file.

For example, suppose that you have moved a source file belonging to the debug version of a program to some other directory. When you step into that code in the debugger, you will get a dialog box asking where the source file is located. If you then choose to Cancel that dialog box, a Disassembly window will be opened for the source. If you continue debugging and later step through the code that causes the same source file to be opened again, Visual C++ will automatically open up the Disassembly window and will not ask again for the source location.

<div class="cause_section">

CAUSE
In trying to prevent asking the user for a file's location over and over again, Visual C++ does not display the dialog box again if you chose Cancel the first time. If you subsequently decide that you really do want to see the source for a file, you must follow the steps listed below in the Resolution section.

<div class="resolution_section">

RESOLUTION
Use the following steps to work around this behavior:
 * 1) Close the Disassembly window.
 * 2) Open the source file in an editor window.
 * 3) Step into the code generated by that source, or double-click the current frame (the top) of the call stack. In Visual C++ 2.x, the Call Stack window can be opened by selecting Debug | Call Stack from the Visual Workbench main menu. In Visual C++ 4.0, the Call Stack window can be opened by choosing Call Stack from the View menu. This step reestablishes the source link.

Thereafter, the debugger will not open the Disassembly window for code generated from that source, but will open the source file itself. You may reopen the Disassembly window if you wish, and it will be properly mapped to the open copy of the source file. If that source file is later closed and then needs to be reopened in the editor, you will once again be asked for the location of the file.

<div class="status_section">

STATUS
This behavior is by design.

Additional query words: IDE

Keywords: kbide kbdebug kbprb KB127802

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.