Silverfrost Forums

Welcome to our forums

Problem with sdbg

27 May 2011 11:06 #8313

Does sdbg support fortran77 code without restrictions?

My test programs work with fortran77 and with fortran95 without sdbg correctly but when I try to debug the code/program the debugger behaves strange.

I have problems always when I use more then one subroutine in my library file...

My Errors in sdbg:

Call Stack/Status - Access violation Unknown

or

Call Stack/Status Privileged instruction scc_lib_version WSF2__ *UnknownÜ

or

FortranStartup without any source code

My Code ist very simple:

Main:

      PROGRAM TEST
C
      INTEGER*2
     *IDUM
C     
      WRITE(*,*)'Start: Program'
      CALL MYSUB2()
      CALL MYSUB3()
      
      IDUM=32
      CALL MYTRV(IDUM)
C            
      WRITE(*,*)'End: Program'
      END

LIB

      SUBROUTINE MYSUB2()
C
      INTEGER*4
     *I,J
C
      WRITE(*,*)'Start: MYSUB2'
      J=4
      I=J*J
C
      WRITE(*,*)'End: MYSUB2'
      RETURN
      END     
C
C
      SUBROUTINE MYSUB3()
C
      INTEGER*4
     *I,J
C
      WRITE(*,*)'Start: MYSUB3'
      J=4
      I=J*J
C
      WRITE(*,*)'End: MYSUB3'
      RETURN
      END 
C
C      
      SUBROUTINE MYTRV (IDUM)
C      
      INTEGER*2 IDUM
C      
C      CHARACTER CTRRV*1
C      
C      COMMON /COMIRV/ CTRRV
C      
C      CTRRV=CHAR(IDUM)
C
      WRITE(*,*)'Start: MYTRV'      
      IDUM=2
      WRITE(*,*)'End: MYTRV'      
      RETURN
      END                     

Linkfile

lo test3.obj
lo sub3.lib
file test3.exe

Batch

@echo off

ftn95 test3.for /debug/windows
ftn95 sub3.for /debug /MKLIB
slink test3.lnk

sdbg test3.exe

http://www.pictureupload.de/originals/pictures/270511125739_fortran.JPG

27 May 2011 12:24 #8315

I think the /MKLIB option created the problem.

My library used and linked as obj-file works in sdbg fine.

Im using slink with -archive and -addobj to create my librarys and it works better now.

27 May 2011 12:55 #8316

If you look up /MKLIB in the help it says : /MKLIB causes FTN95 to call the Salford library manager called SLIM. Objects in the resulting static library may work correctly with the debugger SDBG. The use of SLIM objects with SDBG is not supported.

I'm not sure what that all means ?? It appears that 'may' could also imply 'may not' I've never used SLIM

You appear to be better off to use SLINK using the commands : archive xxx.lib addobj xxx.obj addobj yyy.obj file

I tend not to put routines into a library that I am debugging

27 May 2011 1:30 #8317

Yes, you are right, thanks a lot 😃

Please login to reply.