Q127802: PRB: Debugger Loses Source/Disassembly File Mapping
Article: Q127802
Product(s): Microsoft C Compiler
Version(s): 2.0,2.1,4.0,5.0
Operating System(s):
Keyword(s): kbDebug kbide kbVC200 kbVC210 kbVC400 kbVC500 kbVC600
Last Modified: 11-JUN-2002
-------------------------------------------------------------------------------
The information in this article applies to:
- The Integrated Debugger, used with:
- Microsoft Visual C++, 32-bit Editions, versions 2.0, 2.1, 4.0
- Microsoft Visual C++, 32-bit Enterprise Edition, version 5.0
- Microsoft Visual C++, 32-bit Professional Edition, version 5.0
- Microsoft Visual C++.NET (2002)
-------------------------------------------------------------------------------
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.
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.
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.
STATUS
======
This behavior is by design.
Additional query words: IDE
======================================================================
Keywords : kbDebug kbide kbVC200 kbVC210 kbVC400 kbVC500 kbVC600
Technology : kbVCsearch kbAudDeveloper kbIntegratedDebugger
Version : :2.0,2.1,4.0,5.0
Issue type : kbprb
=============================================================================
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.
Copyright Microsoft Corporation 1986-2002.