Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: gjj2828 on February 01, 2009, 03:05:55 pm

Title: Does C::B have the function of watchpoint?
Post by: gjj2828 on February 01, 2009, 03:05:55 pm
I've found that C::B can show the value of variables when debugging. But I cannot find how to set watchpoint to variables? Does C::B have the function of watchpoint?

Thx...
Title: Re: Does C::B have the function of watchpoint?
Post by: ollydbg on February 01, 2009, 03:36:41 pm
Open the Watch window when you're debugging.
See attachment picture below.
(http://forums.codeblocks.org/index.php?action=dlattach;topic=10033.0;attach=3094)

[attachment deleted by admin]
Title: Re: Does C::B have the function of watchpoint?
Post by: gjj2828 on February 01, 2009, 05:05:26 pm
Open the Watch window when you're debugging.
See attachment picture below.
(http://forums.codeblocks.org/index.php?action=dlattach;topic=10033.0;attach=3094)

Thank you very much for your reply.

I see that in the watch window, I can find the value of variables. But I want B::C to give me some messages when mine specified variable is changed when the program is running in the debugging mode. That is watchpoint's purpose. I don't konw how to do that. Could you show me the way?

Thx...
Title: Re: Does C::B have the function of watchpoint?
Post by: ollydbg on February 01, 2009, 05:16:43 pm
Sorry, I can't give your the answer.
You can read the GDB's manual to get the answer yourself. It is like a "memory break point".
Or, You can write a small code to check variable changed or not.
Title: Re: Does C::B have the function of watchpoint?
Post by: gjj2828 on February 01, 2009, 07:37:27 pm
Sorry, I can't give your the answer.
You can read the GDB's manual to get the answer yourself. It is like a "memory break point".
Or, You can write a small code to check variable changed or not.

I've read the CodeBlocks Manual but find nothing about watchpoint. But thank you all the same. Maybe C::B cannot do that today. But I think watchpoint is very important when you develope a massive project and facing some bug arising from memory leak.

Since you mentioned GDB's manual, please let me ask some questions, because I'm not familiar with it.

1.Can GDB running at windows platform?
2.I have installed codeblocks-8.02-setup.exe. I think it has contained the GDB Plugins. Am I right? Will I need to find GDB and install it again?
3.I've found a GDB's manual link http://www.gnu.org/software/gdb/documentation/. Is it right?
4.I've checked every corner of CodeBlocks's interface but found noting about watchpoint. If GDB's manual would help me, does it mean I will debug program through commond line with no GUI?

Thx...
Title: Re: Does C::B have the function of watchpoint?
Post by: ollydbg on February 02, 2009, 02:32:56 am
Sorry, I'm not a gdb export, so, I can only give my suggestion.
1, install nightly build version
2, install TDM-MinGW
3, You can debug in GUI.

 :D
Title: Re: Does C::B have the function of watchpoint?
Post by: gjj2828 on February 02, 2009, 03:12:44 am
Sorry, I'm not a gdb export, so, I can only give my suggestion.
1, install nightly build version
2, install TDM-MinGW
3, You can debug in GUI.

 :D

Thank you for your advice. I'll take it.
You are so kind and your advice is so helpful.

Thx... :D
Title: Re: Does C::B have the function of watchpoint?
Post by: ollydbg on February 07, 2009, 08:27:02 am
See here if you want to add "watch point" in GDB
http://sources.redhat.com/gdb/current/onlinedocs/gdb_6.html#SEC35