Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28456 Discussions

the breakpoints disappear when I start to debug the my code

lan0907
Beginner
885 Views
Hi all,

I am using Visual Studio 2005 to compile the fortran code. The problem is that I set some breakpoints in the main program and started to debug the code, however, the breakpoints did not work and the program run as no there were no breakpoints. I have tried to set breakpoints in other lines in the main program but the same result. Then I tried to somewhere else in other subroutines, it worked. I have tried every thing I can thought of, I close the program, restart the PC, and installed service pack, etc. None of them can solve the problem.

Another thing is that I tried another code, and everything worked fine there. Strange. See if any of you have some solutions to this.

Thank you in advance.
0 Kudos
6 Replies
jimdempseyatthecove
Honored Contributor III
885 Views

Are you running in Debug build or Release build?
0 Kudos
lan0907
Beginner
885 Views

Are you running in Debug build or Release build?

I am using debug. thanks for the reply.
0 Kudos
Jeffrey_A_Intel
Employee
885 Views
Quoting - lan0907
Hi all,

I am using Visual Studio 2005 to compile the fortran code. The problem is that I set some breakpoints in the main program and started to debug the code, however, the breakpoints did not work and the program run as no there were no breakpoints. I have tried to set breakpoints in other lines in the main program but the same result. Then I tried to somewhere else in other subroutines, it worked. I have tried every thing I can thought of, I close the program, restart the PC, and installed service pack, etc. None of them can solve the problem.

Another thing is that I tried another code, and everything worked fine there. Strange. See if any of you have some solutions to this.

Thank you in advance.

More details would be helpful:

  • what hardware platform?
  • what operating system?
  • what compiler?
  • what isthe compilation command line?

Can you create a small example which demonstrates the problem?

0 Kudos
lan0907
Beginner
885 Views

More details would be helpful:

  • what hardware platform?
  • what operating system?
  • what compiler?
  • what isthe compilation command line?

Can you create a small example which demonstrates the problem?


Hardware platform: Dell presision T7400, Intel xeon CPU,X5482 @3.2GHz
Operating system: Windows XP, professional x64 Edition
Compiler: visual studio, Intel Fortran

Example:

program main

integer:: a, b

a=1 <---break here
b=2

a=a+b

end

IF i start to debug, then it will automatically run to the end and give me the correct answer.
0 Kudos
fbalderasintel
885 Views
Quoting - lan0907

Hardware platform: Dell presision T7400, Intel xeon CPU,X5482 @3.2GHz
Operating system: Windows XP, professional x64 Edition
Compiler: visual studio, Intel Fortran

Example:

program main

integer:: a, b

a=1 <---break here
b=2

a=a+b

end

IF i start to debug, then it will automatically run to the end and give me the correct answer.
I had the same problem and found it to be, in my case, that I had a labeled line ex "100 Continue" that was never being used, so for some reasonany codepreceding that line and following a previous do/doend was never reached. I'm just guessing, but itsas ifsome optimization was being done and it decided that part of the code wasnt ever going to be needed due to an earlier exit out of the DO loop. Once I added some code to actually jump to that label, the breakpoints were not removed at runtime. Your code doesnt have labels and DO loops but I dont know if thats
your actual code, is why I am responding.
0 Kudos
bendel_boy1
Beginner
885 Views
Quoting - lan0907
Hi all,

I am using Visual Studio 2005 to compile the fortran code. The problem is that I set some breakpoints in the main program and started to debug the code, however, the breakpoints did not work and the program run as no there were no breakpoints. I have tried to set breakpoints in other lines in the main program but the same result. Then I tried to somewhere else in other subroutines, it worked. I have tried every thing I can thought of, I close the program, restart the PC, and installed service pack, etc. None of them can solve the problem.

Another thing is that I tried another code, and everything worked fine there. Strange. See if any of you have some solutions to this.

Thank you in advance.

I've had two reasons for this.

The first is that I am running in Release mode, not Debug, so that the break points are not active. Usually you should get an indication of this - either a message, or the breakpoints change from active (bright colours) to inactive (dull colours).

Second reason, where the colour of the breakpoints does not change, is that I am not running my code. Very common when I build DLLs where the DLL being run is the first one on the path, and if I don't have my link settings to overwrite that one then my breakpoints don't trigger. Also happens with exceutables, but not easily - I can't remember what the conditions were when I had this; probably that I was passing parameters to the executable on the command line (file indirection to redirect standard input & output), with an explicit declaration for the executable location.
0 Kudos
Reply