View previous topic :: View next topic |
Author |
Message |
AKS
Joined: 19 Mar 2008 Posts: 29
|
Posted: Mon Jun 08, 2020 7:40 pm Post subject: Back checking in Plato |
|
|
When using Plato in debug mode, my program fails after 8400 iterations due to a variable suddenly becoming UNDEFined. It gives me the subroutine and line number of the failure. Is there any way to back track through the code in debug mode to find where this variable is being "UNDEFINED?" Thanks. E.J. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Tue Jun 09, 2020 3:48 am Post subject: |
|
|
It depends. There is no provision in the debugger for running a program in reverse, and an apparently "undefined" variable need not even be truly undefined. Here is a short program to illustrate:
Code: | program undef
implicit none
integer i, j, k
j = Z'80608080'
k = Z'00100000'
do i=1, 5
j = j + k
print '(1x,I2,2x,Z8)',i,j
end do
end program |
If you compile with just /debug and run the program from the command line, it will run normally. Inside the debugger, however, if you place a breakpoint on the line with "print", during the second execution of the loop body you will see j as "undefined" in the variables panel.
In your program, is the variable in question a local variable, a dummy argument or a module member? What is its type? Can you share the code with us? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Tue Jun 09, 2020 8:01 am Post subject: |
|
|
AKS
Can you confirm that you are using an FTN95 command line option such as /UNDEF or /CHECKMATE. |
|
Back to top |
|
|
AKS
Joined: 19 Mar 2008 Posts: 29
|
Posted: Tue Jun 09, 2020 8:37 pm Post subject: UNDEF in Debug with Plato |
|
|
When running Plato there is a Pulldown Window on the toolbar at the top which has Checkmate Win32 displayed in it. I don't know if that answers your question. Since yesterday I've removed some UNDEF errors by giving certain variables initial values. I'm at a point of failure where the UNDEF variable really is undefined. I will try to fix this and write again when I get another UNDEF error. I don't think that I can supply much of the source code. I cannot run from the Command window because the failures stop an executable from being made. Thank you for your kind help. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Wed Jun 10, 2020 1:33 am Post subject: Re: UNDEF in Debug with Plato |
|
|
AKS wrote: | I cannot run from the Command window because the failures stop an executable from being made. |
The presence of undefined variables may be detected at
1. compile time, in which case (depending on the compiler options in use) no OBJ and EXE may be produced, or
2. run time, which can occur only if no compile-time undefined variables are present.
As long as the same compiler options are used, there is no difference between EXEs produced from an IDE or the command line. If "no executable can be made" is true, there can be no running of the non-existent EXE in Plato or the debugger. |
|
Back to top |
|
|
|