Re: Seems to be related to the debugger..
- From: "Fredrik Wahlgren" <fredrik.p.wahlgren@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 12 Feb 2006 01:11:21 +0100
"Igor Tandetnik" <itandetnik@xxxxxxxx> skrev i meddelandet
news:%23NxL$N2LGHA.3180@xxxxxxxxxxxxxxxxxxxxxxx
"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?
It's a standard BSTR.
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.
Ahh, this might be the answer. Thank you Igor
--
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
.
- 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
- Re: Seems to be related to the debugger..
- From: Igor Tandetnik
- Weird string problem. "Marilyn" is OK but not "0,6"
- Prev by Date: Re: Seems to be related to the debugger..
- Next by Date: Re: ATL service not
- Previous by thread: Re: Seems to be related to the debugger..
- Index(es):
Relevant Pages
|