链接已复制
See this other thread for some added discussion on breakpoints:
https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/508526
There is hardware support (using the debug registers of the CPU) for watching the contents of four addresses and trapping accesses to those addresses. Watching all variables in the program without localization to a specific line of code (and, even worse, watching arbitrary expressions) would be prohibitively expensive -- after every CPU/FPU instruction, the specified expression would have to be evaluated.
If you want to enable a program-wide watch on an expression, assign a variable to the expression at the beginning of a block of code that you suspect to contain a bug, be sure to update the new variable whenever any of the variables in the expression changes. You have only four arrows (DR0 to DR3) in your quiver to slay the beast.
I wish I could tell you how to do this, but the VS debugger has broken data breakpoints for Fortran and I am not sure how to work around it. I need to ask our debugger developers if they know how to resolve it.
