Article ID: 143109 - Last Review: July 5, 2005 - Revision: 2.1 BUG: Debugger Shows Incorrect "this" PointerThis article was previously published under Q143109 On This PageSYMPTOMS In Visual C++ 4.0, when you debug a class that uses
multiple inheritance, the "this" pointer for any of the base classes that
reside at an offset in the class are displayed incorrectly. Data for derived
classes is not displayed correctly either because the debugger attempts to
reference the data by using the invalid "this" pointer. In Visual C++ 4.1 or 4.2, only the value of "this" pointer is not shown correctly. All the members are displayed correctly. CAUSE The compiler produces incorrect debugging information
causing a display error in the debugger only. The vtable entries themselves are
correct, and programmatic access to the data produces the proper values.
RESOLUTION The only way to work around this problem is to output the
addresses to an output device. You may use a TRACE statement or cout() as shown
in the sample code below. STATUS Microsoft has confirmed this to be a bug in the Microsoft
products listed at the beginning of this article.
MORE INFORMATIONSample Code to Demonstrate ProblemAPPLIES TO
| Article Translations
|
Back to the top
