- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I encountered a strange problem when debuggging some code whereby the value of avarible didn't change even though it should. This only occurs in the 64 bit configuration, as the 32-bit seems fine.
eg
integer :: idx
integer :: i
integer :: n(100)
n = 0
idx = 0
do i = 1 , 100
if(mod(i,10).eq.0) cycle
idx = idx + 1
no(i) = 1
enddo
The above example reconstructs the section of code I am referring to (i.e. it isn't the exact code). When, in my code, I step over the idx = idx + 1 line the value of idx, in theWatch window does not change, and the program terminatesat the next line (out of bounds error).
Has anyone got any ideas what causes this type of behaviour or how to track in down? I have changed the name of idx to something else (just in case it had the same name as a publicmodulevariable but it had no effect.
I tried Cleaning and rebuilding the whole program but this does not solve the problem.
I'm thinking that it must be a memory overwrite somewhereas I believe itis not caused by the optimisation as none is enabled in debug mode.
Thanks
Steve
eg
integer :: idx
integer :: i
integer :: n(100)
n = 0
idx = 0
do i = 1 , 100
if(mod(i,10).eq.0) cycle
idx = idx + 1
no(i) = 1
enddo
The above example reconstructs the section of code I am referring to (i.e. it isn't the exact code). When, in my code, I step over the idx = idx + 1 line the value of idx, in theWatch window does not change, and the program terminatesat the next line (out of bounds error).
Has anyone got any ideas what causes this type of behaviour or how to track in down? I have changed the name of idx to something else (just in case it had the same name as a publicmodulevariable but it had no effect.
I tried Cleaning and rebuilding the whole program but this does not solve the problem.
I'm thinking that it must be a memory overwrite somewhereas I believe itis not caused by the optimisation as none is enabled in debug mode.
Thanks
Steve
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If compiler optimization has not been turned off, the debugger will find it hard to correlate the program counter with the source code line number. It is even possible to see the active line decrease in a segment of code where it should not since there are no branch type statements.
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