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

Mysterious DEBUG issue

WSinc
New Contributor I
2,744 Views

My understanding is that when I get an out-of-range subscript it is supposed to put me in the routine

where that occurred so I can look at variables in the same routine.

What is actually does: is put the little blue arrow in a place that has NOTHING to do with the routine,

so I cannot look at any variable in the routine. The call stack is completely wrong as well, so I cant use that either.

so - - I have to go back and insert a breakpoint(F9) near where the problem occurred, and/or stick in print statements, etc.

and run it again.

The text in the output is correct, BTW, it does tell you what line number, etc.

Ths problem seems to come up when the breakpoint is within an internal routine, i.e. one that comes after a CONTAINS statement.

 

Its a minor annoyance, but still I cant help but wonder why they did not test this ?? VS has been around for a long time, right ?

0 Kudos
26 Replies
WSinc
New Contributor I
2,086 Views

Here is a test program that shows the problem.

It tells me where the breakpoint occurred in the TEXT OUTPUT but there is no green arrow, or any way to look at the variables.

You dont see this in a simple program -

apparently you have to have several routines to generate this problem.

0 Kudos
Steven_L_Intel1
Employee
2,086 Views

It generally does work. If you can provide us an example showing otherwise, we'd like to see it. A zip of a project folder is best.

0 Kudos
WSinc
New Contributor I
2,086 Views

Well, this example has several routines in it, but only one source file.

Is this sufficient ?

0 Kudos
WSinc
New Contributor I
2,086 Views

It would help if the assembly code has the source code interspersed - it does not.

but still, I cant look at the variables either.

0 Kudos
Steven_L_Intel1
Employee
2,086 Views

Are you building without debug information, or optimized? I built and ran your program and it stopped in the right place, showing the variables. You have to use the Stack Frame pulldown (to the right of Thread, not visible here but it would be if the window were a normal size) to see the uplevel variables.

Capture_0.PNG

0 Kudos
WSinc
New Contributor I
2,086 Views

I dont get that "locals" or "call stack" window.

Is there something special I have to do?

 

Maybe I am using a VS that does not have those features ?

0 Kudos
WSinc
New Contributor I
2,086 Views

What is strange is -

I can see all the variables when I use F9 to put a breakpoint in,

but as soon as it actually hits the out of range, the variable access disappears

I am using something called "VS shell?

Is that what I am supposed to have?

 

It looks like you have something developed later on.

0 Kudos
WSinc
New Contributor I
2,086 Views

Is there an easy way to give you a screen shot of what I see ?

 

BTW, my stack frame does not show any of the routines in it.

so, somehow the debug info is getting lost when when it hits the subscript problem.

 

If there was any remote access, I could show someone very easily what is going on - - 

0 Kudos
WSinc
New Contributor I
2,086 Views

The stach frame shows the routine if I put the F9 breakpoint in -

but then when I continue execution, the routines no longer appear there.

0 Kudos
WSinc
New Contributor I
2,086 Views

What version of VS do you have?

It looks really snazzy - maybe I have an ancient one that has problems.

Should I be using something more up to date?

Is there a reason why I cannot ?

0 Kudos
Steven_L_Intel1
Employee
2,086 Views

Here I used VS2015, but it shouldn't be different in the VS2010 (or 2013) Shell you have.

You may have deleted the various Debug windows. In the debugger, click on Debug > Windows and select Locals. If there are other windows you are missing, click on them too.

What version of Intel Fortran (Intel Parallel Studio XE) are you using?

0 Kudos
WSinc
New Contributor I
2,086 Views

Under debug > Windows I only have:

1. Breakpoint

2. output

3. immediate

as choices.

I am using the most recent Fortran, I think 16.0, as per my subscription.

 

What is the easiest way I can you a screenshot ?

0 Kudos
andrew_4619
Honored Contributor III
2,086 Views

windows "snipping tool" works well bill to grab parts of the screen.

0 Kudos
mecej4
Honored Contributor III
2,086 Views

What you see when you click Debug-Windows depends on whether you have started debugging already. Set a breakpoint at the first executable source statement in the main program, and run until that breakpoint is reached. Then, click Debug-Windows, and you will see many more choices than before.

More generally, in VS many menus change view in a context-sensitive way. For many users (especially casual users of VS such as me) this makes it difficult to answer "how do I get back to this menu that I saw one hour ago?". Even more difficult is to answer "how does this menu look on Billsincl's Visual Studio?" On the other hand, without this feature there would be a prohibitive amount of clutter. Many submenus and submenu items are often found in places that seem, to me, to be illogical. Likewise, screenshots may show the results of the train-wreck, but rarely give indications of what causes produced the train-wreck.

It is for these reasons and, perhaps, my general outlook, that I use the command line, a syntax highlighting editor with RE support and GNU make as my preferred development environment.

0 Kudos
WSinc
New Contributor I
2,086 Views

I can get those windows, right up until the bad subscript -

but as soon as it  hits the bad subscript, all the useful information disappears.

I dont get any variable contents, no green arrow, and no call stack,

the call stack is THERE, but does not contain any of the relavant routines

any longer.

 

so, maybe there is someone there that can answer this question?

 

Or do I need to get a later version of VS that has been debugged?

0 Kudos
WSinc
New Contributor I
2,086 Views

I should get a remote assist, so someone can actually SEE what is going on.

0 Kudos
WSinc
New Contributor I
2,086 Views

I did a little experiment,

removed the routines so they are not contained within another routine.

 

Now it works like it supposed to.

so apparently the problem is triggered by using internal subroutines,

i.e with the CONTAINS statment.   I wonder if this issue was addressed in a later version of VS ?

 

Well, when Steve ran his, we didnt see that any more, right ?

0 Kudos
Steven_L_Intel1
Employee
2,086 Views

I tried your program in VS2010 and got the same (good) results. When the array bounds error was reported, the debugger broke into the program at the right line and I could see the local variable IX.

Would you please attach a ZIP of the buildlog.htm from your project build? Maybe there's something else you're doing that isn't shown here yet.

0 Kudos
WSinc
New Contributor I
2,086 Views

Well, I dont see any way to make a ZIP file.

 

How do I do that ? I guess its not included in Windows 10.

Apparently I cannot just send you the HTM file from the buildlog ?

0 Kudos
WSinc
New Contributor I
1,987 Views

Well, now the darn thing works like it is supposed to -

What is really puzzling, is that I did not change anything regarding the way I did the build.

So now I have to figure out how to get the mistake back again.

Is this ZIP thing something I have to buy somewhere?

 

Why cant I send an HTM file directly?

0 Kudos
Reply