News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Does C::B have the function of watchpoint?

Started by gjj2828, February 01, 2009, 03:05:55 PM

Previous topic - Next topic

gjj2828

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...

ollydbg

#1
Open the Watch window when you're debugging.
See attachment picture below.


[attachment deleted by admin]
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.

gjj2828

Quote from: ollydbg on February 01, 2009, 03:36:41 PM
Open the Watch window when you're debugging.
See attachment picture below.


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...

ollydbg

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.
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.

gjj2828

Quote from: 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.

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...

ollydbg

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
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.

gjj2828

Quote from: 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

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

Thx... :D

ollydbg

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.