Bug in debug mode

Bug in debug mode

Say I have the following code:

integer :: i, j, m, n, loc1

loc1=65
m=1
n=1
j=1

DO i=1,500
    DO WHILE(j.lt.loc1)
       ...
       j=j+1
       m=m+1
       IF(n.eq.1000)
           m=0
       END IF
       n=n+1
    END DO
    j=0
END DO

The bug I'm encountering is this:

If I put a breakpoint on the line "DO WHILE (j.lt.loc1)" before 'Start Debugging' and I choose a breakpoint condition of m=1 is true, with each execution of the inner loop the debugger does not increment the variable m however the variable n increments by 1 as it should.

Has anyone else encountered this problem??

If I put m=5 before 'Start Debugging' then it will execute the inner loop properly until m=5 and n=5, then thereafter m will remain 5!

This doesn't make any sense to me...

2 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Another thing I've noticed that can happen when debugging DO loops is if
I choose the DO variable counter as the breakpoint condition (e.g.
i=30), then when the breakpoint is reached, the counter variable gets
reset to 1!

Since no one has replied to this thread I guess I am the only person who has this problem???

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi