|
From: K�r�at on 8 May 2008 09:04 Hi, While I debug an application in VS 6.0, I noticed a strange behavior : Value of a local variable (an int) increases by one for every single step. Even when the line in which the variable initialized to zero is stepped out, the variable is still getting increased : void func () { int i, j; i = 0; j = 0; // At this point j becomes 1 if I execute above line as single step and it keeps increasing for every single stepped lines... i = 1; // Now j = 2 !!! j = 2; // H�mm j = 3 } Is this a known bug? If no, then what is wrong? Thanks in advance...
From: David Lowndes on 8 May 2008 18:15 >While I debug an application in VS 6.0, I noticed a strange behavior : >... Are you perhaps debugging an optimised build? Things can appear very strange then! Dave
From: Tim Roberts on 10 May 2008 00:02 "K�r�at" <xx(a)yy.com> wrote: > >While I debug an application in VS 6.0, I noticed a strange behavior : > >Value of a local variable (an int) increases by one for every single step. >Even when the line in which the variable initialized to zero is stepped out, >the variable is still getting increased : > >void func () >{ > int i, j; > > i = 0; > j = 0; > // At this point j becomes 1 if I execute above line as single step >and it keeps increasing for every single stepped lines... > i = 1; > // Now j = 2 !!! > j = 2; > // H�mm j = 3 >} > >Is this a known bug? If no, then what is wrong? If that's truly the code, then the problem is that i and j were not really assigned any memory. In that case, the debugger doesn't really know where the values of i and j are stored, so it has to guess. Visual Studio 98 is ten years old. Unlike wine and cheese, software does not age well. You need to get something newer. -- Tim Roberts, timr(a)probo.com Providenza & Boekelheide, Inc.
|
Pages: 1 Prev: Access Violation? Next: emulation of gethostbyaddr to resolve to NetBIOS name |