forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fortran Error

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Plato
View previous topic :: View next topic  
Author Message
stfark1



Joined: 02 Sep 2008
Posts: 109

PostPosted: Sat Oct 14, 2017 4:07 pm    Post subject: Fortran Error Reply with quote

Hi Paul: Had a quite trivial error that I made, expressed a condition and if it was true, branched to another label, in this case 100. As it turned out, the label 100 was on a format statement by mistake, caused the compiler to execute without error but did strange things, did not branch to the label but skipped lines of code, tried to execute comment statements, etc. In my estimation, should have caused a compile time error but didn't. Anyway, FYI only. Sid Kraft
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 739

PostPosted: Sun Oct 15, 2017 12:30 am    Post subject: Reply with quote

Here is a test program:
Code:
      program xyz
          integer i,j
          i=10
          do
             i=i+1
                 j=i*i
                 if(j > 150)goto 10
                 print 10,i,j
          end do
   10 format(2I10)
      end program

Compiling this with FTN95 8.10, I see the following code for the IF statement:
Code:
  0000003E: 81 F8 96 00 00 00  cmp         eax,96h
  00000044: 0F 8E 05 00 00 00  jle         0000004F
  0000004A: E9 FF FF FF FF     jmp         0000004E
  0000004F: 68 13 00 00 00     push        13h


The address 4E in the JMP instruction is the third byte of the current instruction, in the middle!

A similar bug occurs with /64:
Code:
 000000000040143E: 81 FB 96 00 00 00  cmp         ebx,96h
  0000000000401444: 0F 8E 05 00 00 00  jle         000000000040144F
  000000000040144A: E9 00 00 00 00     jmp         000000000040144F
  000000000040144F: 90                 nop

Note that now the JMP instruction has a zero offset relative to %RIP, so the JMP works as a NOP!

The compiler does issue a warning:
Code:
0008)                  print 10,i,j
WARNING - Label 10 has previously been used as a branch target
0010)    10 format(2I10)
WARNING - This FORMAT statement has been used as a branch target which is a non-standard extension
Back to top
View user's profile Send private message
stfark1



Joined: 02 Sep 2008
Posts: 109

PostPosted: Sun Oct 15, 2017 1:02 am    Post subject: Debug Error Reply with quote

Hi Mecej4: Maybe you can provide an answer to this, I have been using Plato with Win 10, normally when I use the debugger and do a "step into", it will show an icon that allows me to do the "step into" and advance line by line. However, lately, when I try to do the "step into" to advance line by line, it forces me to "step into" on every line without advancing line by line automatically, all I get is a yellow arrow on each line advanced to and I have to enter the "step into" command each time before the system will advance. I thought maybe there was an option that caused this and I had accidentally activated it. Please let me know, Sid Kraft
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 739

PostPosted: Sun Oct 15, 2017 2:25 am    Post subject: Reply with quote

Sid, I do not understand at all what you expect the debugger to do. When you press "Step-Into", the debugger should execute one line, update the variables display, advance the current line indicator (yellow arrow, etc.) to the next line to be executed, and wait for the next input from you.

When the current line is a Fortran statement that does not call a subroutine or evaluate a user-defined function, there is no difference between "Step-Into" and "Step-Over".

When the current line does call a subroutine or evaluate a user-defined function, "Step-Into" advances the current line to the first executable statement of the subroutine or function. In the same situation, "Step-Over" advances the current line indicator to the next logical executable statement in the same programming unit, after silently executing all the statements in the subroutine or function that was invoked from the current line.

Can you give a detailed description, with a couple of screen-shots? Please state the compiler version and options used, as well.
Back to top
View user's profile Send private message
stfark1



Joined: 02 Sep 2008
Posts: 109

PostPosted: Sun Oct 15, 2017 4:18 am    Post subject: Debug Reply with quote

mecej4
Back to top
View user's profile Send private message
stfark1



Joined: 02 Sep 2008
Posts: 109

PostPosted: Sun Oct 15, 2017 4:21 am    Post subject: Debug Reply with quote

mecej4: Be glad to provide screen shots that I took using snipping tool and paint, however, how does one include them in this reply, no option to include screenshots, sorry, not an expert in using this system, Sid kraft
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 739

PostPosted: Sun Oct 15, 2017 8:26 am    Post subject: Reply with quote

There are a number of image hosting sites such as imgbb.com whose main purpose is to hold images for the purpose of inclusion in forum posts. You sign up for an account by giving them an e-mail address, etc., after which you can upload your image file and obtain the BBCode for including that image from the hosting site. You then paste the BBCode in one of your posts, as appropriate.

You can also upload your images to general file repositories such as Google Drive, Dropbox, Onedrive, etc., make the uploaded file public access enabled, obtain a link to the file from the cloud service, and include the link in your post.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Plato All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group