News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

can coldblocks break program automaticly in debug when variable is changed

Started by fei123, July 05, 2010, 08:53:12 AM

Previous topic - Next topic

fei123

using gdb ,we can break program when variable is changed .
we just use the cmd "watch  a" .
a =0 firstly,then when a is changed into 1,the program will be break running   automaticly.

how can i do this in codeblocks??
codeblocks can watch the change of  variable .the colour will be changed when the variable is changed . but the programme will not be break automaticly !!

thank u for your help .

ollydbg

Quote from: fei123 on July 05, 2010, 08:53:12 AM
using gdb ,we can break program when variable is changed .
we just use the cmd "watch  a" .

Have you see the "command input control" at the bottom of the  debug panel. You can enter (do) anything as you did in GDB.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

mandrav

Memory may be failing me but isn't there a "Debug->Debugging windows->Watches" window for this kind of thing?
Be patient!
This bug will be fixed soon...

oBFusCATed

There is something called Data breakpoints.
I think, that in order to use them you need to stop on a breakpoint first.
Then right click your variable in the editor and "Add data breakpoint for 'myvar'" or something like that.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

fei123



Have you see the "command input control" at the bottom of the  debug panel. You can enter (do) anything as you did in GDB.
[/quote]

yes。it is right。
in my example just input  "watch a "  in the debug---send user command to debug ,and  select view--Logs .
i can see the informations like "info breakpoint " in gdb