BUG: Break When Expression Has Changed Fails On Struct MembersLast reviewed: July 22, 1997Article ID: Q117147 |
4.00 4.01 4.10 | 4.00 4.01 4.10
MS-DOS | WINDOWSkbtool kbbuglist The information in this article applies to:
SYMPTOMSWhen using "Break when Expression has changed" breakpoints which include structure members in the expression, the breakpoints may fail and/or break many times in the exit and startup code following a program restart. In Codeview for Windows, a General Protection Fault may also occur, followed by a system hang.
RESOLUTIONTo work around this problem, run the program to termination at the end of the first debugging session, clear the offending breakpoints, restart the program, and then reset the breakpoints. If you have Visual C++ and your program is a Windows-based application, you can use the Visual Workbench debugger instead. Note that for some MS-DOS programs you may also be able use the Visual Workbench debugger if the program can be rebuilt as a QuickWin application.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATION The sample program below can be used to demonstrate this problem. Build a debug version of the program, load it into Codeview, and enter these commands in the Codeview command window:
For an MS-DOS target For a Windows target --------------------------------- --------------------------------- p2 // step into code p2 // step into code bp =A.s // BP when A.s changes bp =A.s // BP when A.s changes g // break hit correctly g // break hit correctly g // break in exit code g // break in exit code g // program terminates g // hit 3 more times l // restart g // program terminates g // break in startup code l // restart g // hit 19 times to finish g // breakpoint missed bc* // clear all breakpoints bc* // clear all breakpoints l // restart l // restart p2 p2bp =A.s // break when A.s changes bp =A.s // break when A.s changes g // repeat of above g // repeat of aboveNote that the problem is not as severe for static structures. (substitute bp = B.i in the steps above).
Sample Code
/* Compile options needed: /Zi /Od */#ifdef _WINDOWS #include <windows.h>#endif
void main( void ){ struct tagA { short s; } A; static struct tagB { int i; } B; A.s = 1; B.i = 2;}
|
Additional reference words:
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |