home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / hp / 8317 < prev    next >
Encoding:
Internet Message Format  |  1992-07-20  |  1.7 KB

  1. From: dong@hpfcso.FC.HP.COM (Don Gourley)
  2. Date: Mon, 20 Jul 1992 20:51:29 GMT
  3. Subject: Re: Passing arrays between C and Fortran
  4. Message-ID: <7371156@hpfcso.FC.HP.COM>
  5. Organization: Hewlett-Packard, Fort Collins, CO, USA
  6. 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
  7. Newsgroups: comp.sys.hp
  8. References: <1992Jul18.005709.3575@elroy.jpl.nasa.gov>
  9. Lines: 23
  10.  
  11. There is a defect in the 8.0x versions of the Fortran compiler on the
  12. Series 700 such that you cannot correctly view elements of adjustable
  13. arrays while in the symbolic debugger.  The compiler has not given
  14. the debugger the correct information it needs to calculate element
  15. offsets when any dimension (other than the last) is of non-constant
  16. size.  This defect is fixed in the next (9.0) release of Fortran.
  17.  
  18. The array should be properly handled by the Fortran subroutine, you
  19. just can't verify it using xdb.  Try using PRINT statements to verify
  20. this.
  21.  
  22. There are a couple of clumsy ways you can work around this problem
  23. while using the debugger.  Since the first element prints ok (e.g.
  24. "p matrix(1,1)", you can do that and then keep hitting return to
  25. view subsequent elements.  Also, you can calculate the correct offset
  26. for an element yourself and ask xdb to print the value at that
  27. location.  For example, if matrix(1,1) is at 0x400010d0, you can view
  28. matrix(3,2) at 0x400010d0 + (lrow*(3-1)+(2-1))*8  (lrow is the length
  29. of rows; 3 is the specified row and 2 is the specified column but we
  30. subtract one from each because Fortran arrays are one-based; and 8 is
  31. the size of an element).  Use \F to specify double format to xdb (e.g.
  32. "p *0x40001180\F" if lrow == 10).
  33.  
  34.