在Visual Studio中调试英特尔Fortran时出现`No Source available` [英] `No Source available` when debugging Intel Fortran in Visual Studio

查看:568
本文介绍了在Visual Studio中调试英特尔Fortran时出现`No Source available`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Microsoft Visual Studio 2012 + Intel Visual Fortran上调试以下Fortran代码:

 程序customarray 

implicit none
real,allocatable,dimension(:) :: vector
integer :: nelements,i
real :: sum

print *, '输入多少个值'
read *,nelements
allocate(vector(nelements))
print *,'输入值'
sum = 0.0

do i = 1,nelements
read *,vector(i)
sum = sum + vector(i)
end do

end program customarray

当我使用调试器step into工具遍历代码时。一切按预期运行。然而,只要我到达最后一行

 结束程序customarray 

我得到一个如下的对话框:



使用 Step Over Step Out 你应该可以跳过这个完成的内部代码,但是使用 Step Into ,你要求调试器把你带到那里。



当然,该地区没有可用的源代码,因为那里执行的代码不是您的用户代码。它可能是也可能不是编译的C代码,甚至是编译器直接插入的机器代码的一部分。

类似的行为可能发生在程序。在准备好能够执行代码的环境时,您还可以输入程序执行的程序。如果您只是想调试您的代码,请在与您的可执行语句相对应的行开始调试。


I am debugging the following Fortran code on Microsoft Visual Studio 2012+Intel Visual Fortran:

program customarray

implicit none
real, allocatable, dimension(:):: vector
integer :: nelements, i
real :: sum

print *, 'enter how many values you have'
read *, nelements
allocate(vector(nelements))
print *, 'enter the values'
sum = 0.0

do i=1,nelements
    read *, vector(i)
    sum = sum+vector(i)
end do

end program customarray

As I step through the code using the debugger "step into" tool. Everything runs as expected. However as soon as I reach the very last line

end program customarray

I get a the following dialog box:

I don't understand why I am getting this error. I am frustrated because it runs smoothly when I "Run without debugging" and does not display the same error.

解决方案

After the end program with Step Into you are entering the code generated by the compiler to finish the program run and return to Windows.

Step Into will enter any function executed by the program, even internal libraries (might be set-up slightly differently for Fortran). See "Step Over" and "Step Into" in Visual Studio

With Step Over or Step Out you should be able to skip this finishing internal code, but with Step Into you are asking the debugger to take you there.

And, of course, no source is available in that region, because that code executed there is not your user code. It may or may not be compiled C code or even parts of machine code directly inserted there by the compiler.

Similar behaviour can happen at the start of the program. You can also enter the procedures executed by the program when preparing the environment to be able to execute your code. If you just want to debug your code, start debugging at a line corresponding to your executable statement.

这篇关于在Visual Studio中调试英特尔Fortran时出现`No Source available`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆