Visual C++ debug limitations

ngwin.gif (1069 bytes)Restriction: This section applies only to programs being debugged on Windows 95 or Windows.

You can debug C and C++ programs compiled with the Microsoft Visual C++ compiler, provided you have compiled and linked your program with the appropriate options. The following limitations apply when debugging such programs:

Enumerated types:

ngclang.gif (151 bytes) Enumeration member name information for enumerated types in C programs compiled with Visual C++ is not shown in monitors that display variable contents, such as the Local Variables monitor.

ngcpp.gif (202 bytes) This information is available for C++ programs, however.

The following shows a code fragment with enumerated types, and the values displayed in the Local Variables monitor of the debugger:

typedef enum { One=1, Two, Three} TypeX;
TypeX a=One;
TypeX b=Two;
TypeX c=Three;

ngclang.gif (151 bytes) If the program is compiled as a C program with Visual C++:

a: 1
b: 2
c: 3

ngclang.gif (151 bytes)ngcpp.gif (202 bytes) If the program is compiled as a C or C++ program with VisualAge C++, or a C++ program with Visual C++

a: 1 /* One */
b: 2 /* Two */
c: 3 /* Three */

Constants: A statement such as const int i = 42; in a Visual C++ program cannot generate any debug information for the variable i. Therefore the debugger does not display any value for it. The VisualAge C++ compiler does generate information for this symbol.

Namespaces: You cannot debug Visual C++ namespaces because the Visual C++ compiler does not generate the necessary debug information for namespaces in the executable.