From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28887 invoked by alias); 6 Jul 2005 09:38:33 -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 28844 invoked by uid 22791); 6 Jul 2005 09:38:27 -0000 Received: from ausmtp01.au.ibm.com (HELO ausmtp01.au.ibm.com) (202.81.18.186) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 06 Jul 2005 09:38:27 +0000 Received: from sd0112e0.au.ibm.com (d23rh903.au.ibm.com [202.81.18.201]) by ausmtp01.au.ibm.com (8.12.10/8.12.10) with ESMTP id j669emil411586 for ; Wed, 6 Jul 2005 19:40:49 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.250.243]) by sd0112e0.au.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j669f3U9102102 for ; Wed, 6 Jul 2005 19:41:04 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.12.11/8.13.3) with ESMTP id j669c76Q002703 for ; Wed, 6 Jul 2005 19:38:08 +1000 Received: from [9.181.134.93] ([9.181.134.93]) by d23av02.au.ibm.com (8.12.11/8.12.11) with ESMTP id j669c4RD002640; Wed, 6 Jul 2005 19:38:05 +1000 Date: Wed, 06 Jul 2005 09:38:00 -0000 From: Wu Zhou To: Parker James E Contr AFRL/HEDR cc: "'gdb@sources.redhat.com'" Subject: Re: gdb and Fortran90 arrays In-Reply-To: <6AC29D5306A1CD4AB6A168570B1176A40797B2E9@casino.brooks.af.mil> Message-ID: References: <6AC29D5306A1CD4AB6A168570B1176A40797B2E9@casino.brooks.af.mil> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2005-07/txt/msg00034.txt.bz2 On Fri, 1 Jul 2005, Parker James E Contr AFRL/HEDR wrote: > Hello, > I was wondering if anyone could help me decipher the output from gdb when > debugging Fortran90 code. Since gdb doesn't currently support Fortran90, it > defaults to a language format called "minimal", which is fine for most uses, > but for arrays the output is cryptic for me. Hi Parker, I guess that you are not using g77, because g77 don't recognize this kind of array definition. I also assume that you are not using gfortran. Because gdb works ok with gfortran on this kind of array definition on my Fedora Core 4. So would you please tell me what your compiler is, ifc, g95 or any others? If you could give me the output of "readelf -wi yourcase", that would be of great help. Maybe I could code a patch to make gdb recognize your compiler. > > Example > define an array > > real(KIND(1.0D0)), dimension(6)::x > > If I wanted to examine x(2), I normally (fortran 77) would use > (gdb) p x(2) > > But under the minimal language setting, gdb interprets parenthesis as a > function call--that of course doesn't exist--and therefore gdb complains > with an error. I tried using [ ] to replace the parentheses, but gdb > correctly replies that operator [] is undefined. > > The best result I have is at a gdb prompt type > (gdb) p x > > And you get a list that contains an offset, ecode, base and info. Can > anyone tell me what these things are? Ecode seems to represent the size of > each element in the array, but that's just a guess. The rest is some sort > of memory pointer, but I can't decipher it. I am more convinced that you are using a different compiler than g77 and gfortran. It seems to me that your compiler outputs some weird information gdb can't interpret. Maybe it is your compiler that need to be changed. Just my guess anyway. The debuginfo is very helpful to confirm or deny this. - Wu Zhou