[Dwarf-discuss] RE: Dwarf-discuss Digest, Vol 17, Issue 2 [bname of the main routine]

Bishop, John E john.e.bishop
Fri Feb 24 08:21:54 GMT 2006


> If we need a new flag anyway, then why shouldn't it be a flag on
> the DW_TAG_subprogram for main?

I agree.

Entry points are used for Fortran alternate entry points (a terrible
language feature, perhaps, but it's part of the language).  The body
of a subroutine is shared by different signatures, so you can call
it in different ways.

Here's an example: "bar" is the main subroutine, "foo" is an alternate
entry point:

      subroutine bar(I,J,K,I1)
      INTEGER*4 I,J,K,L,I1
      integer*4 A /0 0/
      real*4    C /0.0/


      write (6,*) 'Entered via bar: ', i, j, k
      write (6,*) '*****************************'
      goto 1000

      entry foo(J,K,L,I1)

      write (6,*) 'Entered via foo: ', j, k, l, I1
      write (6,*) '*****************************'
 200  a = j
      goto 1000

1000 write (6,*) 'Exiting bar & all its entry points'
      write (6,*) 'A=', a
      write (6,*) 'C=', c

      write (6,*) 'Bye!'
      return
      end

	-John Bishop (intel debugger project)



More information about the Dwarf-discuss mailing list