fortran/2174: PATCH: Support DW_TAG_entry_point

hjl@lucon.org hjl@lucon.org
Thu Sep 21 16:58:00 GMT 2006


>Number:         2174
>Category:       fortran
>Synopsis:       PATCH: Support DW_TAG_entry_point
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          patch
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 21 16:58:01 UTC 2006
>Closed-Date:
>Last-Modified:
>Originator:     hjl@lucon.org
>Release:        6.5.50.20060920-cvs
>Organization:
>Environment:
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
>Description:
Some Fortran compilers use DW_TAG_entry_point for entry
point. This patch adds support for DW_TAG_entry_point.
>How-To-Repeat:
[hjl@gnu-26 bug84]$ cat test.f
      implicit none
      call wkinit(10)
      call wkprnt(5)
      end

      subroutine wkinit(wksize)
      implicit none
      integer wksize, nsize
      integer jpr
      integer jprint
      save jpr

      jpr = wksize

      print *, 'On entry, wksize = ',wksize

      nsize  = wksize
      return

      entry wkprnt(jprint)
      print *, 'On entry, jpr = ',jpr
      print *, 'On entry, jprint = ',jprint
      if (jprint.eq.2) then
        jpr = 1-jpr
      else
        jpr = jprint
      endif
      print *, 'jpr = ',jpr
      return

      end

[hjl@gnu-26 bug84]$

Use a Fortran compiler with DW_TAG_entry_point support,
like ifor 9.1, and set breakpoint at entry point.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-patch; name="gdb-6.4-entry-1.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gdb-6.4-entry-1.patch"

LS0tIGdkYi9kd2FyZjJyZWFkLmMuZW50cnkJMjAwNi0wNC0wNiAwNjo1OToxMi4wMDAwMDAwMDAg
LTA3MDAKKysrIGdkYi9kd2FyZjJyZWFkLmMJMjAwNi0wNC0wNiAwNzowMDozNS4wMDAwMDAwMDAg
LTA3MDAKQEAgLTE3MDIsNiArMTcwMiw3IEBAIHNjYW5fcGFydGlhbF9ze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