Is it possible to set a watch on a variable to see when and where in the program a variable is changed?
Best regards
Reidar
Link Copied
The question then becomes - What sort of variable are you trying to set your watchpoint on and how is it declared? (E.g. in a module, in a common block, locally, ...). Depending on circumstances, you may need to specify the module name, e.g.
(idb) watch module_name%%variable_name
Thanks, Rob
- yes, I want the program to breakwhen a specific varaiable has beenchanged.
(sometimes a variable is changed unexpected - the the debug/watchis helpful)
Best regards
Reidar
Rob,
I am not familiar with C/C++,nor the IDB command line....
The background for my question is of course that it happened again: Somewhere
in my program a variable has been changed, and I do not undrestand why.
When we used the VAX/VMS system (1983..)you could just write "WATCH
and then the program stopped and displayed the code segment where the variable was changed.
But I have never managed to do this in CVF or VS2005
The variable can be of any type, of course the most troublesome might be the global
variables, and I use modules rather than common blocks.
From what I understand from you I may achieve what I want by using the command line?
Best regards
Reidar
For more complete information about compiler optimizations, see our Optimization Notice.