- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I want to monitor one particular location in an array to see where in the code it is being "clobbered."
I tried many various IF statements, but so far nothing has isolated the problem.
wasn't there something called a WATCH command in the debugger?
Haven't used it in a long time, so not sure - is there an example somewhere ?
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
You can set a data breakpoint, that can trigger when an operation occurs on data at a certain address in memory. To add a data breakpoint the program already needs to have started running - ideally it would be paused at a normal breakpoint ahead of where you expect the clobbering, but after the point where the storage for the relevant array has been created. At this point you can use Debug > New Breakpoint > Data breakpoint, For the address you may use a fortran-like expression, such as `LOC(array(5))` - i.e. the memory location of the fifth element of the variable named array.
(Details may vary slightly depending on Visual Studio version.)