Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Debugging in Compaq Visual Fortran

asim_sajjan
Beginner
3,805 Views
Hye
When I am going to debug after running few lines it is opened another file
called " chkstk.asm" or "crt0.c" and ultimately I could not able to debug.
Can anybody tell me why does it happen and the sollution?
regards
Asim






0 Kudos
1 Solution
Steven_L_Intel1
Employee
3,805 Views
Asim, are you using "step into" rather than "step over"? If you do, it will step into ALL routines called from the generated code, including library support routines. Try using Step Over instead.

View solution in original post

0 Kudos
13 Replies
Steven_L_Intel1
Employee
3,805 Views
It sounds to me as if your program got a stack overflow. When that happens, the debugger believes you are executing inside the library routine which reported the error and then complains that the source is not available. You can use the call stack pane to set the context back to your program which called the library routine.

You will probably find the error message in a separate window that may be "behind" the debugger window.
0 Kudos
asim_sajjan
Beginner
3,805 Views
It sounds to me as if your program got a stack overflow. When that happens, the debugger believes you are executing inside the library routine which reported the error and then complains that the source is not available. You can use the call stack pane to set the context back to your program which called the library routine.

You will probably find the error message in a separate window that may be "behind" the debugger window.

hye Mr Steve Lionel
Thanks for your repply. It helped me a lot.

But still I could not able to solve the problem. I can run one programme properly and get the result. But I want to run the programme step wise i.e. debug the programme. During debugging I am facing the problem. After running few lines it starts to debug chkstk.asm, memcpy.asm etc..
I will be happy if you kindly inform me how to solve the problem.

Asim
0 Kudos
DavidWhite
Valued Contributor II
3,805 Views
It sounds to me as if your program got a stack overflow. When that happens, the debugger believes you are executing inside the library routine which reported the error and then complains that the source is not available. You can use the call stack pane to set the context back to your program which called the library routine.

You will probably find the error message in a separate window that may be "behind" the debugger window.

Steve,

I frequently get this sort of issue. It's not due to a stack overflow. The kind of situation where is occurs is, e.g.
Call Sub(TRIM(CHARVAR)), etc,

When you step into this statement, it stops within the asm routine, rather on the first line of the subroutine. There are about three different asm routines that popup under different circumstances. I too, would like an option which says "never debug asm code", only my fortran code.

Step out and Step Over can get past this issue, but when you are stepping though line by line, one is not always watching everything on the line of code to anticipate when the break point may be inside the assembler code.

Thanks,

David
0 Kudos
Steven_L_Intel1
Employee
3,805 Views
David, unfortunately this is not under our control. Step Into is handled directly by the debugger's Microsoft code. Setting a breakpoint in Sub and doing a "step over" may be the way you have to handle this.
0 Kudos
Steven_L_Intel1
Employee
3,806 Views
Asim, are you using "step into" rather than "step over"? If you do, it will step into ALL routines called from the generated code, including library support routines. Try using Step Over instead.
0 Kudos
asim_sajjan
Beginner
3,805 Views
Asim, are you using "step into" rather than "step over"? If you do, it will step into ALL routines called from the generated code, including library support routines. Try using Step Over instead.

Steve
Thanks. Yes I triedusing "step over" as well. Can you tell me why does it give me message "There is no source code available for the current location". It also give me message like "Microsoft Visual Studio has encountered an internal error and Microsoft Visual Studio may be unstable now".

Another question: If run the programme I can get the result properly but if I want to debug I can not do it.

Asim
0 Kudos
Steven_L_Intel1
Employee
3,805 Views
I can't explain the "internal error". Have you set a breakpoint at your first executable statement and used the Go button (F5) to start debugging?
0 Kudos
asim_sajjan
Beginner
3,805 Views
I can't explain the "internal error". Have you set a breakpoint at your first executable statement and used the Go button (F5) to start debugging?

Thanks. Yes I have set breakpoint at 1st executable statement and used Go button. On thing I forgot to tell you in my project there are about 10 programmes.

Can you tell me onething--if any programme run properly and give the result with the input data but is it possible to giveerrors while I am going to debug?
Asim
0 Kudos
Steven_L_Intel1
Employee
3,805 Views

If debugging changes the behavior of the program, it is usually because the program is incorrectly accessing memory and the different stack contents while debugging causes the program to run differently.
0 Kudos
asim_sajjan
Beginner
3,805 Views

If debugging changes the behavior of the program, it is usually because the program is incorrectly accessing memory and the different stack contents while debugging causes the program to run differently.

Thanks. Still I could not able to debug the programme.

Ok, If I want to understand the programme developed by other (may be its too big programme ) --which one is the best way to understand, try through debugging or is there any other way in Compaq Visual fortran to runthe step by step of the programme?
Asim
0 Kudos
Steven_L_Intel1
Employee
3,805 Views
I don't know why you can't debug, but there's limited help I can offer for CVF. As for understanding the program, I think debugging would be "too close" in that you would not really see the structure of things. You could build with the source browser enabled and view a call graph, but I'm not sure that would tell you a lot either.

I assume you have some notion of what this program does - select some aspect you don't understand and study the code that performs that function.
0 Kudos
asim_sajjan
Beginner
3,805 Views
I don't know why you can't debug, but there's limited help I can offer for CVF. As for understanding the program, I think debugging would be "too close" in that you would not really see the structure of things. You could build with the source browser enabled and view a call graph, but I'm not sure that would tell you a lot either.

I assume you have some notion of what this program does - select some aspect you don't understand and study the code that performs that function.

Hye Steve
Thanks.
I got the clue.
In my programe there is a statement :

string(j:j) = char(i)

Since char is Elemental Intrinsic Function (Generic): , when i am going to debug the above statement it gave me an error message "There is no source code available for the current location". I can debug by chosing option step out.

Is there any permanent sollutionso that I can debug chosing step into option?

No problem--at least I can now debug. thanks for giving advice to solve the problem.

regards

Asim





0 Kudos
Steven_L_Intel1
Employee
3,805 Views
Not that I know of.
0 Kudos
Reply