Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Conditional breakpoints
Conditional breakpoints [message #30119] |
Thu, 09 December 2010 20:42 |
|
Hi everyone,
Today, I finally got angry enough to start implementing one of the features I seriously miss in theide: conditional breakpoints. I guess most of you knows the frustration when you know that the bug is probably in the last iteration of 1000 cycles loop and you just can't tell the debugger to stop when i=999
So I started digging into the code and to my great surprise, I found out that the code is already there, just commented out! Mirek, why are you hiding such a powerful feature from us?!
Then I tried to uncomment it (ide/idebar.cpp:480) to see if it really works... well it didn't but the fix is actually trivial, just change Gdb::SetBreakpoint() in Gdb.cpp to:bool Gdb::SetBreakpoint(const String& filename, int line, const String& bp)
{
String bi = Bpoint(*host, filename, line);
if(bp.IsEmpty())
FastCmd("clear " + bi);
else if(bp[0]==0xe)
FastCmd("b " + bi);
else
FastCmd("b " + bi + " if " + bp);
return true;
}
Now the conditional breakpoints work perfectly (with gdb). I am not sure what will happen with MSVC installs (I don't have any to test - help wanted ), but I believe it will just ignore the condition, so it should not cause any trouble. If anyone decides to fix this for windows users too I can just point you to this page where you can find some possibly usefull info about msdev syntax.
Is it OK to commit this in current state? Or should I wait till someone writes the M$ part?
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Sun Apr 28 19:05:09 CEST 2024
Total time taken to generate the page: 0.06323 seconds
|