Jump to content
  • Advertisement
Sign in to follow this  
Mizipzor

Conditional breakpoints with std::string

This topic is 3572 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im trying to see why a file cant be loaded, but the others can so now Im trying to setup a conditional breakpoint. This is with Visual Studio 2005, Ive set a breakpoint and in breakpoints window (alt+f9) I rightclick and set condition to: path=="levels/test.xml" But when starting the program I get this message:
Quote:
The following breakpoint cannot be set: At file.cc, line 71 ('File( std::string path )', line 4), when 'path=="levels/test.xml"' is true Unable to evaluate the breakpoint condition: CXX0058: Error: overloaded operator not found
Which seems strange, std::string has that operator. What am I doing wrong?

Share this post


Link to post
Share on other sites
Advertisement
The simplest solution is to modify the code. If you want to break every time use:

if (path=="levels/test.xml")
DebugBreak();

If not replace the call with some other statement you can put a breakpoint on.

I've found that the debugger isn't always very good at evaluating operators, or reporting useful errors when you get the syntax slightly wrong.

Share this post


Link to post
Share on other sites
You can do this,

bool b = path=="levels/test.xml";

then set the conditional break point when b is true (you might just need to enter b, if there's a radio button that selected "Is true" already there).

Share this post


Link to post
Share on other sites
Yes, adding some code to do the same thing is of course the easiest way to go. I was just wondering if this could be done without a recompile. :)

Quote:
Original post by Scourage
please post your code. It's difficult to troubleshoot what is going on with just that.


Actually, this hasnt anything to do with my code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!