Code::Blocks Forums

User forums => Help => Topic started by: fei123 on July 05, 2010, 08:53:12 am

Title: can coldblocks break program automaticly in debug when variable is changed
Post by: 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” .
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 .
Title: Re: can coldblocks break program automaticly in debug when variable is changed
Post by: ollydbg on July 05, 2010, 09:38:54 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.
Title: Re: can coldblocks break program automaticly in debug when variable is changed
Post by: mandrav on July 05, 2010, 10:15:13 am
Memory may be failing me but isn't there a "Debug->Debugging windows->Watches" window for this kind of thing?
Title: Re: can coldblocks break program automaticly in debug when variable is changed
Post by: oBFusCATed on July 05, 2010, 10:23:22 am
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.
Title: Re: can coldblocks break program automaticly in debug when variable is changed
Post by: fei123 on July 05, 2010, 06:50:14 pm


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