Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Wu Zhou <woodzltc@cn.ibm.com>
To: Parker James E Contr AFRL/HEDR <James.Parker.ctr@brooks.af.mil>
Cc: "'gdb@sources.redhat.com'" <gdb@sources.redhat.com>
Subject: Re: gdb and Fortran90 arrays
Date: Wed, 06 Jul 2005 09:38:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.63.0507061610280.14674@wks190384wss.cn.ibm.com> (raw)
In-Reply-To: <6AC29D5306A1CD4AB6A168570B1176A40797B2E9@casino.brooks.af.mil>

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


  parent reply	other threads:[~2005-07-06  9:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-01 21:09 Parker James E Contr AFRL/HEDR
2005-07-01 21:11 ` Daniel Jacobowitz
2005-07-06  9:38 ` Wu Zhou [this message]
2005-07-01 21:29 Parker James E Contr AFRL/HEDR
2005-07-01 21:39 ` 'Daniel Jacobowitz'
2005-07-01 21:31 Parker James E Contr AFRL/HEDR
2005-07-06 10:00 ` Wu Zhou
2005-07-07  0:04 Parker James E Contr AFRL/HEDR
2005-07-09  3:29 ` Wu Zhou
2005-07-09 18:18   ` Daniel Berlin
2005-07-11  1:24     ` Wu Zhou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.63.0507061610280.14674@wks190384wss.cn.ibm.com \
    --to=woodzltc@cn.ibm.com \
    --cc=James.Parker.ctr@brooks.af.mil \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox