Bug in Single Stepping over WHILE(TRUE) in VS2003

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Saint Stephen (saint_at_stephen.com)
Date: 01/26/05


Date: Tue, 25 Jan 2005 22:41:20 -0500

Has anybody seen this? VS skips the first statement in a block while
single-stepping if the loop is WHILE(TRUE). (The code is executed, the
debugger just doesn't stop.)

Repro: Create a new Smart Device Windows Forms app in C#.
1) Add the following code:
  int t = 1;
  while(true) {
    int i = t;
    t++;
  }
2) Set a breakpoint on the while(true) line.
3) Hit the breakpoint, and press F10.
4) The debugger highlights t++; (The value of i is 1.)
5) Change the while(true) to while(t<10) and keep the breakpoint there.
6) Repeat Step 3.
7) The debugger highlights int i = t;
8) Repeat the entire thing using an ordinary Windows Forms app (not a PPC
app).
9) The debugger correctly stops on the first line regardless of the
loop type.

System: Windows Server 2003 with all patches as of this date.
(System is running inside VMWare).
Visual Studio 2003 with no patches or service packs.
PPC device HARD RESET.
.NET CF installed by VS2003 deployment process.

Maybe it's because I'm running in VMWare? Can anybody else repro this?



Relevant Pages

  • Re: loop debugging Compag Visual Fortran Compiler
    ... | facility in Compaq Visual Fortran 6.6.0. ... Suppose I have a simple loop ... | there a way in Compaq Visual Fortran (in the debugger) to watch the ... Select the newly created breakpoint, and in the "expression" edit box ...
    (comp.lang.fortran)
  • Re: loop debugging Compag Visual Fortran Compiler
    ... | facility in Compaq Visual Fortran 6.6.0. ... Suppose I have a simple loop ... | there a way in Compaq Visual Fortran (in the debugger) to watch the ... Select the newly created breakpoint, and in the "expression" edit box ...
    (comp.lang.fortran)
  • Re: When is "volatile" used instead of "lock" ?
    ... This is because you run this code in a "managed debugger", the JIT produces different code from what is produced when no managed bedugger is attached! ... This sequence is repeated until the loop counter reaches the count value. ... I was expecting the JIT to do much better optimizations (looping x times ... with local variables. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Sorry if it is not for this forum
    ... >> loop uses that variable as an array index. ... A code generator / debugger message something like ... Verify reported buggy behavior. ... with the same level of optimization as the shipped code. ...
    (comp.lang.c)
  • 68k chip, Diab Compiler and odd behavior
    ... The first 16 times through the loop ... the debugger, line 12 is executed and the debugger skips 13 and 14, ... ulword tmpfaultvalue; ... ulword shift; ...
    (comp.arch.embedded)