This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Auto-display of array elements in Fortran


Debugging the simple Fortran program below, I can't auto-display ARRAY(1). I
guess that GDB might confuse this for a C procedure but "p ARRAY(1)" works
fine. Is it necessary for the GDB "display" command to try to parse its
argument in a different manner to the "print" command?

Nick

      DIMENSION ARRAY(100)
      ARRAY(1) = 1.0
      ARRAY(1) = 2.0
      ARRAY(1) = 3.0
      STOP
      END

nick:{nick}26: ~/gdb/gdb/gdb tempf
GNU gdb 2004-02-01-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) b temp.f:3
Breakpoint 1 at 0x80485ff: file temp.f, line 3.
(gdb) run
Starting program: /home/nick/tmp/tempf 

Breakpoint 1, MAIN__ () at temp.f:3
3             ARRAY(1) = 2.0
Current language:  auto; currently fortran
(gdb) p ARRAY(1)
$1 = 1
(gdb) disp ARRAY(1)
1: Invalid expression
Disabling display 1 to avoid infinite recursion.
(gdb) 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]