kdevelop, debugging - how to set a valid condition for a watchpoint?
Hello,
I have a problem with debugging in kdevelop. I'm unable to set valid condition in the watchpoints condition field (the bottom breakpoint section). I tried everything that seemed sane to me: a > 10. (a > 10.) if(a > 10.) if a > 10. 'a' is the variable I have watchpoint for. And as result I got all possible stops for any change of the variable in question. I would be grateful for any help. Onufry |
ok - got sth working "around".
I put some code like: Code:
if(a>10.){ maybe this "watch for change" idea is completly wrong for floats. I tried in gdb (in the corect scoope): Code:
awatch a Best regards, Onufry |
It looks like gdb ignores conditions on watchpoints. I think this could be a bug given the following paragraph from the gdb manual:
Quote:
Code:
commands <watchpoint number> |
The solution with "commands" did not do anything at all (it only switched off printing "sth changed to a" in gdb) . I think there may be two problems:
1. sth is wrong with gdb (I am using gdb-6.8-r1) or 2. I do sth horribly wrong somewhere else while debugging - for example: while setting a breakpoint ;] the crude solution i used in the first place (by putting additional code inside the program) somehow worked - i have done what i had to do. But thanks anyway. :) Best regards, onufry |
Quote:
Code:
$ gdb --version Anyways I thought of another workaround: you can do Code:
watch (a > 10)? a : 0 |
All times are GMT -5. The time now is 05:49 PM. |