debugger position does not correspond source code
-
My Visual studio debug sessions are suddenly behaving erratically. The debugger position does not correspond with the c++ source code line, it's sometimes one line off. This used to work fine. I'm VS 2005 SP1. Any ideas what might be wrong?
The standard solution to this problem is to select "Rebuild Solution" in Visual Studio. Sometimes the source gets out of sync with the stored debugging information, and Rebuild Solution brings it up to date.
-
Have you removed all temporary files, including the Debug folder, and rebuilt the project?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
This may be too simple a solution but what you describe usually occurs when you start debugging a release version. Is your active configuration 'Debug' ? Souldrift
modified on Monday, August 24, 2009 9:53 AM
-
The standard solution to this problem is to select "Rebuild Solution" in Visual Studio. Sometimes the source gets out of sync with the stored debugging information, and Rebuild Solution brings it up to date.
-
My Visual studio debug sessions are suddenly behaving erratically. The debugger position does not correspond with the c++ source code line, it's sometimes one line off. This used to work fine. I'm VS 2005 SP1. Any ideas what might be wrong?
hi, it may be cause of fault in encoding of lines endings in Your source file, ie. from any reason at end of line instead of standard windows CRLF code ('\x0D','\x0A') appear the CR code ('\x0D'). Debugger counts line endings and if any encoding of line end differs from the other it may results in wrong line highlighting. To eliminate this problem You can use any text tool that can re-encode the line endings in Your source file to standard windows encoding or You can use Visual Studio editor feature "Save With Encoding" into "Save File As..." dialog. I would try first in VS do "Save File As..." -> Unix/Macintosh and next "Save File As..." -> Windows.
modified on Tuesday, August 25, 2009 9:28 AM
-
hi, it may be cause of fault in encoding of lines endings in Your source file, ie. from any reason at end of line instead of standard windows CRLF code ('\x0D','\x0A') appear the CR code ('\x0D'). Debugger counts line endings and if any encoding of line end differs from the other it may results in wrong line highlighting. To eliminate this problem You can use any text tool that can re-encode the line endings in Your source file to standard windows encoding or You can use Visual Studio editor feature "Save With Encoding" into "Save File As..." dialog. I would try first in VS do "Save File As..." -> Unix/Macintosh and next "Save File As..." -> Windows.
modified on Tuesday, August 25, 2009 9:28 AM
-
You know I have a switch statement like this: switch (keyCode) { case 0x10: maybe it's somehow recognising the 0x10 as a new line return. That makes sense becuase it's only after this switch statement that the error occurs
ed welch wrote:
You know I have a switch statement like this: switch (keyCode) { case 0x10: maybe it's somehow recognising the 0x10 as a new line return.
No, not possible.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
What about optimizations?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
ed welch wrote:
You know I have a switch statement like this: switch (keyCode) { case 0x10: maybe it's somehow recognising the 0x10 as a new line return.
No, not possible.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
You know I have a switch statement like this: switch (keyCode) { case 0x10: maybe it's somehow recognising the 0x10 as a new line return. That makes sense becuase it's only after this switch statement that the error occurs
Sorry for my mistake, proper hex values of CRLF are: '\x0D' for CR and '\x0A' for LF. Values which I wrote earlier are related decimal values 13 and 10 respectively. I was thinking about hex values but wrote decimal :) it happens. In Your switch condition there is actually decimal value of 16 but not 10 as You expected. So, it not may be the cause of problem.