- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, Did anyone experienced problem in icrementing after breal point is set?
While debugging in 64 bit through Visual Studuo, If I use break point around (before and after) line with incrementing the integer: I=I+1, the incrementing procedure is not performed, i.e. i see0=0+1 (or n=n+1). If I remove break point, calculations are fine.
While debugging in 64 bit through Visual Studuo, If I use break point around (before and after) line with incrementing the integer: I=I+1, the incrementing procedure is not performed, i.e. i see0=0+1 (or n=n+1). If I remove break point, calculations are fine.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you using conditional break points?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your responce. I am using regular break points just for debugging. It looks like break points trigger the problems with incrementing. Did you somemething like this before?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are debugging optimized code, then you might not see the variable incrimented. The variable may have been copied into a register, and the register incrimented, or the variable might have been removed should its value be known to the compiler.
SUBROUTINE VECADD(A,B,C)
REAL(4) :: A(3), B(3), C(3)
INTEGER :: I
I = 1
C(I) = A(I) + B(I)
I = I + 1
C(I) = A(I) + B(I)
I = I + 1
C(I) = A(I) + B(I)
END SUBROUTINE VECADD
In release build (optimizations enabled) and assume not inlined the compiler would generate something the equivilentof
SUBROUTINE VECADD(A,B,C)
REAL(4) :: A(3), B(3), C(3)
C(1) = A(1) + B(1)
C(2) = A(2) + B(2)
C(3) = A(3) + B(3)
END SUBROUTINE VECADD
Your source could would still show the I but no variable is used (in optimized code)
You will see similar behavior with loop control variables
DO I=1,N
Depending on optimizations your debug session might not follow changes to I, as it may reside in a register, and vectorization may be advancing the loop in strides of 2, 4, 8, ...
Jim Dempsey
SUBROUTINE VECADD(A,B,C)
REAL(4) :: A(3), B(3), C(3)
INTEGER :: I
I = 1
C(I) = A(I) + B(I)
I = I + 1
C(I) = A(I) + B(I)
I = I + 1
C(I) = A(I) + B(I)
END SUBROUTINE VECADD
In release build (optimizations enabled) and assume not inlined the compiler would generate something the equivilentof
SUBROUTINE VECADD(A,B,C)
REAL(4) :: A(3), B(3), C(3)
C(1) = A(1) + B(1)
C(2) = A(2) + B(2)
C(3) = A(3) + B(3)
END SUBROUTINE VECADD
Your source could would still show the I but no variable is used (in optimized code)
You will see similar behavior with loop control variables
DO I=1,N
Depending on optimizations your debug session might not follow changes to I, as it may reside in a register, and vectorization may be advancing the loop in strides of 2, 4, 8, ...
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've experienced the same problem. Not only does the increment change the value of the variable in the debuggerthe value ofvariable in memoryis not updated either. In other words the debugger is showing, what it thinks is) the actualvalue of the variable. In my application the debug configuration does not have any optimizations set.
Sometimes this problem goes away if you close down visual studio and restart it. I'm not sure of the cause but restarting VS usually fixes it.
I've also had problems with the watch variables crashing VS. I dealt with this by deleting the *.sou file which sometimes gets corrupted. You could try this if all else fails.
Sometimes this problem goes away if you close down visual studio and restart it. I'm not sure of the cause but restarting VS usually fixes it.
I've also had problems with the watch variables crashing VS. I dealt with this by deleting the *.sou file which sometimes gets corrupted. You could try this if all else fails.
![](/skins/images/3344F5B3B76C91485ED0E980FD0CA95E/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page