home *** CD-ROM | disk | FTP | other *** search
- From: dong@hpfcso.FC.HP.COM (Don Gourley)
- Date: Mon, 20 Jul 1992 20:51:29 GMT
- Subject: Re: Passing arrays between C and Fortran
- Message-ID: <7371156@hpfcso.FC.HP.COM>
- Organization: Hewlett-Packard, Fort Collins, CO, USA
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!mips!sdd.hp.com!hpscdc!cupnews0.cup.hp.com!hppad.waterloo.hp.com!hppad!hpfcso!dong
- Newsgroups: comp.sys.hp
- References: <1992Jul18.005709.3575@elroy.jpl.nasa.gov>
- Lines: 23
-
- There is a defect in the 8.0x versions of the Fortran compiler on the
- Series 700 such that you cannot correctly view elements of adjustable
- arrays while in the symbolic debugger. The compiler has not given
- the debugger the correct information it needs to calculate element
- offsets when any dimension (other than the last) is of non-constant
- size. This defect is fixed in the next (9.0) release of Fortran.
-
- The array should be properly handled by the Fortran subroutine, you
- just can't verify it using xdb. Try using PRINT statements to verify
- this.
-
- There are a couple of clumsy ways you can work around this problem
- while using the debugger. Since the first element prints ok (e.g.
- "p matrix(1,1)", you can do that and then keep hitting return to
- view subsequent elements. Also, you can calculate the correct offset
- for an element yourself and ask xdb to print the value at that
- location. For example, if matrix(1,1) is at 0x400010d0, you can view
- matrix(3,2) at 0x400010d0 + (lrow*(3-1)+(2-1))*8 (lrow is the length
- of rows; 3 is the specified row and 2 is the specified column but we
- subtract one from each because Fortran arrays are one-based; and 8 is
- the size of an element). Use \F to specify double format to xdb (e.g.
- "p *0x40001180\F" if lrow == 10).
-
-