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

Intel Visual Fortran for Debug.EvaluateStatement


I have the following program in debug mode @ line 21

program hello
    implicit none
    integer, dimension(2,2) :: Array
    type Test
        integer :: a
        integer :: b
        integer :: c
    end type Test

    type (Test) :: TestVariable
    Array(1,1) = 22
    Array(1,2) = 2
    Array(2,1) = 22
    Array(2,2) = 25
    TestVariable%a = 1
    TestVariable%b = 2
    TestVariable%c = 3
    print *, Array(1,1)
    print *, Array(2,2)
    print *, TestVariable%b
    print *, ubound(Array)
end program Hello

I am trying to evaluate a statement using the Command Window.

Debug.EvaluateStatement 1+1
Debug.EvaluateStatement i+1

The first line outputs a result of 2 while the second throws an error "Undefined address". The variable does however appear in the Locals window. Why will the statement not evaluate correctly?

0 Kudos
4 Replies

I do not have experience/knowledge of using this command window but trying what you showed it is working for me. Perhaps we're not aligned in terms of the PSXE release we are using, but those commands and other commands evaluate ok. I'm debugging an x86 Debug build under VS2015 + PSXE 2017 Update 1.

While stopped at line 21:

>Debug.EvaluateStatement 1+1

>Debug.EvaluateStatement i+1

>debug.print array
    array(1,1): 22
    array(2,1): 22
    array(1,2): 2
    array(2,2): 25
>Debug.print testvariable
    testvariable%A: 1
    testvariable%B: 2
    testvariable%C: 3


0 Kudos

I have Visual Studio 2012 with Intel Visual composer XE 2013. This is very strange. Short of buying a new version of VS and Intel Fortran just to 1+1 = 2.... how can I fix this problem?

Also, I will quote your response here:

but those commands and other commands evaluate ok.

What other commands are you referring to for Debug.EvaluateStatement? I mean what other commands are possible?

0 Kudos

I do not have that old of a combination available to try reproducing the issue so I can't determine what's contributing to that, either VS, our Fortran integrations, or the compiler's debug emissions. I have VS2012 with newer Intel Visual Fortran versions (16.0 and newer) and I do not see the issue. If your IVF support is current then you are entitled to free upgrades to newer versions.

The other command I was referring to was only Debug.print as I showed. I'm not sure what other commands are possible. I don't have experience with this command window and the other commands that I see are available. I've inquired w/others to see what's possible and will share any info I receive.

0 Kudos
Honored Contributor III

Until I read this thread, the only Command Window that I knew about was the ubiquitous window that one gets by launching the Windows CLI, CMD.EXE, sometimes named colloquially as the "DOS Box". In fact, it took me some time to search through the hundreds of VS menu items to find the one that Amine is using.

To open this VS command window, click View-Other Windows- Command Window or type Ctrl+Alt+A.

As far as I can see, this facility gives a set of keyboard alternatives to selecting menu items in Visual Studio, and in addition allows expressions to be typed in next to commands. Here is a link to the documentation of the Visual Studio 2015 Command Window: .Perhaps some of the "other commands" that Kevin referred to are to be found there.

0 Kudos