Re: Seems to be related to the debugger..
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Sat, 11 Feb 2006 18:26:48 -0500
"Fredrik Wahlgren" <fredrik.p.wahlgren@xxxxxxxxxxxxxxxxxx> wrote in
message news:OBQ4G91LGHA.2300@xxxxxxxxxxxxxxxxxxxx
I now found that if I use "Start Without Debugging", everything works
OK. I only get garbage when I use "Start Debugging". I use VS2005
version 8.0.50727.42 I guess it's a MS bug. Weird!
Is sSum declared as wstring, by any chance? Are you seeing "garbage"
when watching it in debugger, but it's fine when you, say, print it or
otherwise manipulate programmatically?
If both are true, this is a known problem. std::string and wstring
implement small string optimization, where short strings are stored
directly within the instance of the class but longer strings are
allocated on the heap and a pointer is stored in the instance. This
greatly confuses the debugger - it shows the longer strings correctly,
but when the short string is stored internally, deugger basically
interpets first four bytes of the string as though they formed a pointer
and shows you the random garbage this "pointer" is pointing to. The
string is still fine, you just can't see its contents while debugging.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- Re: Seems to be related to the debugger..
- From: Fredrik Wahlgren
- Re: Seems to be related to the debugger..
- References:
- Weird string problem. "Marilyn" is OK but not "0,6"
- From: Fredrik Wahlgren
- Re: Weird string problem. "Marilyn" is OK but not "0,6"
- From: Igor Tandetnik
- Seems to be related to the debugger..
- From: Fredrik Wahlgren
- Weird string problem. "Marilyn" is OK but not "0,6"
- Prev by Date: Re: Weird string problem. "Marilyn" is OK but not "0,6"
- Next by Date: Re: Seems to be related to the debugger..
- Previous by thread: Seems to be related to the debugger..
- Next by thread: Re: Seems to be related to the debugger..
- Index(es):
Relevant Pages
|