ceh
2008-05-16 14:36:44 UTC
My vs 2005 c++ debugger is screwy in release mode, debug mode is fine.
This just started yesterday out of no where.
Does anyone know of this? Is there a setting I toggled by accident
somewhere?
Memory is fine, but debugger shows wrong data in both watch and memory
windows
UNICODE is not defined.
If it is, then the correct data starts at sBuf[2], rather than 4
For some buffer, eg TCHAR sBuf[16]
_tcscpy( sBuf, _T("foobar") );
would show this in debug
sBuf[0] = junk
sBuf[1] = junk
sBuf[2] = junk
sBuf[3] = junk
sBuf[4] = 'f'
sBuf[5] = 'o'
but if you iterate over the buffer and print it, it's correct
sBuf[0] = 'f'
sBuf[1] = 'o'
sBuf[2] = 'o'
sBuf[3] = 'b'
sBuf[4] = 'a'
sBuf[5] = 'r'
// code start
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR sBuf[16];
_tcscpy( sBuf, _T("foobar") );
for( int i=0; i<16; i++ )
{
_tprintf( _T("sBuf[%d] = %c\n"), i, sBuf[i] );
}
_tprintf( sBuf );
return 0;
}
// code end
Thanks for any insight
This just started yesterday out of no where.
Does anyone know of this? Is there a setting I toggled by accident
somewhere?
Memory is fine, but debugger shows wrong data in both watch and memory
windows
UNICODE is not defined.
If it is, then the correct data starts at sBuf[2], rather than 4
For some buffer, eg TCHAR sBuf[16]
_tcscpy( sBuf, _T("foobar") );
would show this in debug
sBuf[0] = junk
sBuf[1] = junk
sBuf[2] = junk
sBuf[3] = junk
sBuf[4] = 'f'
sBuf[5] = 'o'
but if you iterate over the buffer and print it, it's correct
sBuf[0] = 'f'
sBuf[1] = 'o'
sBuf[2] = 'o'
sBuf[3] = 'b'
sBuf[4] = 'a'
sBuf[5] = 'r'
// code start
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR sBuf[16];
_tcscpy( sBuf, _T("foobar") );
for( int i=0; i<16; i++ )
{
_tprintf( _T("sBuf[%d] = %c\n"), i, sBuf[i] );
}
_tprintf( sBuf );
return 0;
}
// code end
Thanks for any insight