I really need to figure out when my Fortran project is reading an element of a vector. I use data breakpoint on a daily basis but I could not find a way to set a data breakpoint when my code access (i.e. read) a memory address, while I always set it for breaking when the address is modified. Is there a way to do this on Visual Studio 2010? (I use intel visual fortran compose XE 2011 as compiler). Or maybe updating to a more recent visual studio? Just as a note, I saw here that gdb does that Can I set a breakpoint on 'memory access' in GDB? thanks A.
Ps: I emaild the guys from GDB and they said its not possible to do it with it.See their answer below:
Hello, Currently the type of created watchpoint is hardcoded to "write". This is because Visual Studio has no support for other types of watchpoints (in GUI and infrastructure). Perhaps it would be possible to enable read watchpoints in the GDB console, however it also would require a hack, as the console actually works "through" Visual Studio (it does not pass commands directly to GDB). I am also not sure whether this feature really works in GDB. GDB has a lot of commands which have very limited target scope, e.g. they only work for single threaded programs, or just for Linux and not when using gdbserver, etc. A read watchpoint looks like a mechanism that is very platform dependent. Please check if GDB your platform supports read watchpoints. Also let us know if this feature is critical for you.
Best regards