Microsoft KB Archive/117311

{|
 * width="100%"|

BUG: Break When Expression Has Changed Fails With Floats

 * }

Q117311

4.10 | 1.00 1.50 1.50.01 4.10 MS-DOS | WINDOWS kbtool kbbuglist -- The information in this article applies to: - The Visual Workbench Integrated Debugger included with: Microsoft Visual C++ for Windows, versions 1.0, 1.5 and 1.5.01 - Microsoft CodeView for MS-DOS, version 4.1 - Microsoft Codeview for Windows, version 4.1 -- SYMPTOMS ======== "Break When Expression Has Changed" breakpoints set on float or pointer to float variables may not function correctly, or the break may occur at the wrong location. This happens in both CodeView and the Visual C++ integrated debugger. STATUS ====== Microsoft has confirmed this to be a problem in the debugging information generated by the compiler. We will post new information here in the Knowledge Base as it becomes available. To work around the problem, use CodeView's memory window to view the contents of your variables. When their contents change, CodeView highlights the changed bytes. MORE INFORMATION ================ The sample program below demonstrates the bug. Build a debug version of a DOS executable using the code below. Debug the application using CodeView for DOS. Step through the application to line 7 in the debugger, set a "Break When Expression Has Changed" breakpoint on pf, and hit F5 to continue the program. The breakpoint will be missed. Sample Code --- /* Compile options needed: /Zi /Od */ void main( void ) { float f, *pf; int i; f = 1.1f; i = 2; pf = &f; i = 3; } To view the contents of pf using the memory window, as the workaround states in the status section of this article, step to the first line of code in main. Open the register window to get both the segment from the SS register, since the variable is local, and the value of BP. To calculate the memory offset of pf look at the locals window to get the offset from BP. In this case it is OxA. Subtract the value of the offset from the value of BP. Then using memory window number 1 change the current address to the SS:BP-offset by typing over the current address. Continue stepping through the code. When the memory location, currently displayed in the memory window, of pf changes it will be highlighted. Additional reference words: 4.10 1.50 1.00 1.50.01 KBCategory: kbtool kbbuglist KBSubcategory: WBDebug

Keywords : kb16bitonly

Issue type :

Technology :