Discussion:
VC8.0: function call in breakpoint condition
(too old to reply)
f***@logis.cz
2007-05-30 10:13:09 UTC
Permalink
Hi,

I try to create a breakpoint condition for my wstring value, something
like mystr==L"xyz". Of course, typing this in the watch window yields
a "CXX0058: overloaded operator not found", so I introduced a simple
comparison function:

bool cmpstr(wstring& str1, wchar_t const* str2) { return str1==str2; }

which can be used in the watch window (wcscmp can not, as I have not
found the proper incantation...perhaps I'm missing some {...} and @/_
stuff). The bad thing is that the cmpstr function can not be used as a
breakpoint condition - but I don't get *any* error/warning message
about the breakpoint either - it just silently skips the breakpoint.
It turns out that any function, even the most simple one

bool testvalue() { return true; }

does not get called/evaluated.

Is this a bug?

I think that it's just about time that the native c++ debuggers
support string comparison, BTW... :-)

Thanks,
Filip
Oleg Starodumov
2007-05-30 14:31:59 UTC
Permalink
Yes, AFAIK functions cannot be called when evaluating breakpoint conditions.
We still have to do something like this:
(mystr[0] == 'x') && (mystr[1] == 'y') etc.
(for STL strings it is more complicated, mystr._Bx._Buf or mystr._Bx._Ptr
should be used)
--
Oleg
[VC++ MVP http://www.debuginfo.com/]
f***@logis.cz
2007-05-30 15:34:37 UTC
Permalink
Post by Oleg Starodumov
Yes, AFAIK functions cannot be called when evaluating breakpoint conditions.
(mystr[0] == 'x') && (mystr[1] == 'y') etc.
(for STL strings it is more complicated, mystr._Bx._Buf or mystr._Bx._Ptr
should be used)
--
Oleg
[VC++ MVP http://www.debuginfo.com/]
Sigh. And this is the best IDE around, isn't it... well, I don't
understand why it works in Watch and not as a breakpoint condition.
And why it does silently ignore the breakpoint, without giving any
warning/error.

Could anyone try this in Orcas?

Thanks,
Filip

Loading...