KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q34922: CodeView Cannot Debug Source Code in Include Files

Article: Q34922
Product(s): See article
Version(s): 1.00 1.10 1.11 2.00 2.02.02 2.10 2.20
Operating System(s): MS-DOS
Keyword(s): ENDUSER | | mspl13_basic
Last Modified: 9-NOV-1988

CodeView cannot debug source code in include files. This information
is documented on Page 7 of the "Microsoft CodeView and Utilities"
manual. The explanation for the restriction on include files says "You
will not be able to use the CodeView debugger to debug source code in
include files."

This information means programs with include files that contain
executable statements cannot be debugged with CodeView.

The usual symptom of this problem is that after tracing or otherwise
trying to execute your program, you will be viewing one of your
include files instead of your normal source code. Repeated attempts
to view the main or other source files will result in viewing the
include file again.

This is program design for the product. Microsoft's compilers do not
generate symbolic information for code in include files. As a result,
CodeView is confused by the discrepancies, and the subsequent behavior
is unpredictable. Include files only can contain prototypes,
declarations, #defines or #includes, etc.

(Note that these items are all "nonexecutable" statements )

Although it is valid C code, include files must not contain
initializations or function definitions or other executable statements
for CodeView to be able to debug your programs properly.

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.