From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4167 invoked by alias); 25 Feb 2004 20:12:55 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 4152 invoked from network); 25 Feb 2004 20:12:53 -0000 Received: from unknown (HELO gabriel.localdomain) (64.142.25.39) by sources.redhat.com with SMTP; 25 Feb 2004 20:12:53 -0000 Received: from p by gabriel.localdomain with local (Exim 3.36 #1 (Debian)) id 1Aw5Iz-0003Ra-00 for ; Wed, 25 Feb 2004 12:06:53 -0800 Date: Wed, 25 Feb 2004 20:12:00 -0000 To: gdb@sources.redhat.com Subject: gdb with intel fortran compiler Message-ID: <20040225200653.GA13223@pete.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i From: Peter Jay Salzman X-SW-Source: 2004-02/txt/msg00372.txt.bz2 I found some curious behavior when using GDB with executables compiled with Intel's fortran 90/95 compiler (ifort). I'm on Debian testing, kernel 2.4.25, gdb 5.3-debian. Here's my little "hello world" type program: PROGRAM hello_world integer, dimension(20) :: array = (/ (0, i=1,20) /) do i=1, 20 if (i == 8) then print *, "hello there, element 8!" end if array(i) = i print *, "element ", i, ": ", array(i) end do END PROGRAM hello_world I can't "list out of the box: p@satan$ gdb a.out (gdb) list 1 ../sysdeps/i386/elf/start.S: No such file or directory. in ../sysdeps/i386/elf/start.S but I can list the program by name: (gdb) list hello_world 1 PROGRAM hello_world 2 3 integer, dimension(20) :: array = (/ (0, i=1,20) /) *snip* What is causing this, and what's start.S? Is there a way to make this behavior "nicer"? The other thing is that the GDB manual says that expressions are evaluated as they normally are in whatever language you're using. I this not to be true. GDB doesn't like this expression in a conditional breakpoint: (gdb) break 11 if i == 12 A parse error in expression, near `= 12'. but it does like this one: (gdb) break 11 if i = 12 Breakpoint 2 at 0x8049da9: file test.f90, line 11. and it even works: (gdb) run Starting program: /home/p/a.out [New Thread 16384 (LWP 19674)] [Switching to Thread 16384 (LWP 19674)] Breakpoint 2, hello_world () at test.f90:11 11 array(i) = i (gdb) print i $1 = 12 as promised, we broke at line 11, when i==12. The conditional operator I used was "=". GDB didn't seem to know "==" which is what the Fortran language uses for testing. GDB seemed to want the "=", which like in C, is assignment in F90. Is this a GDB bug? Is there a way to make expressions work the way they should work when debugging a F90 executable? Thanks, Pete -- Make everything as simple as possible, but no simpler. -- Albert Einstein GPG Instructions: http://www.dirac.org/linux/gpg GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D