Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Wu Zhou <woodzltc@cn.ibm.com>
To: David Lecomber <david@lecomber.net>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC]: Testcase for gdb's handling of Fortran's column-first array
Date: Thu, 03 Nov 2005 16:28:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.63.0511031448140.7578@linux.site> (raw)
In-Reply-To: <1130918595.9928.22.camel@cpc2-oxfd8-3-0-cust199.oxfd.cable.ntl.com>

Hi David,

On Wed, 2 Nov 2005, David Lecomber wrote:

> 
> > OK.  With all these said, here is the patch.  I had tested it on FC4, it 
> > reported no failure.  But however I _did_ found a old gdb (6.1 maybe) 
> > handle this incorrectly.  So this testcase still make senses.  OK to 
> > commit?
> 
> 
> Hi Wu
> 
> That's what I'd expect, as my patch to fix things went in to GDB 6.2.1
> (iirc).

Yes. I see you committed a patch for this in 2004-08-29.  So your patch is 
far far before this testcase.  :-)
  
> 
> One thing to note is that g77 puts things the wrong way round in the
> symbol table (but not in the real data).  In the dwarf2 reader we have
> an explicit fix for this incorrect GNU behaviour, but you will not find
> the same fix in stabs or dwarf1 -- so on legacy platforms (AIX, Solaris)
> with g77 you should expect failure with GNU, pass with IBM's XLF and
> Sun's Forte.  
> 
> It's also going to fail on Linux with -gstabs as a parameter for g77.  

I am not familar with stabs format and also don't have AIX or Solaris at 
hand to try any test.  But I found it is okay with "-gstabs" option.  
Don't know why, maybe someone's patch fixed this quietly at some time we 
don't know.  Here is the session snapshot:

woodzltc@linux:~/DE/gdb_cvs/src/gdb/testsuite/gdb.fortran> g77 -gstabs -o dim-order-stabs dim-order.f
woodzltc@linux:~/DE/gdb_cvs/src/gdb/testsuite/gdb.fortran> ~/DE/gdb_cvs/build/gdb/gdb -q ./dim-order-stabs
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) b dim-order.f :36
Breakpoint 1 at 0x804878b: file dim-order.f, line 36.
(gdb) r
Starting program: 
/home/woodzltc/DE/gdb_cvs/src/gdb/testsuite/gdb.fortran/dim-order-stabs

Breakpoint 1, MAIN__ () at dim-order.f:36
36            call sub(aa)
Current language:  auto; currently fortran
(gdb) p aa
$1 = (( 1, 2, 3) ( 2, 4, 6) ( 3, 6, 9) ( 4, 8, 12) )
(gdb) p aa(3,2)
$2 = 6 


> I've not checked gfortran behaviour -- if it works, it's either because
> gfortran haven't fixed the original issue, or they changed the
> expression that we check the 'producer' against before making the swap
> round (you'll find that in dwarf2readc).

gfortran has some other problem with the multi-dimension array in dwarf 
output.  One of it is that it flatten multi-dimension arrays int one 
dimension ones.  So this testcase doesn't work for gfortran at this time.

P.S: I opened a PR for this behaviour, here is the link: 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244

One of gfortran maintainner also open a meta-bug for all debugging related 
problems for gfortran, it is http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24546


Regards
- Wu Zhou


  parent reply	other threads:[~2005-11-03  6:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-02  7:42 Wu Zhou
2005-11-02  8:58 ` David Lecomber
     [not found]   ` <vt2br12syc9.fsf@theseus.home.>
2005-11-03 16:09     ` Wu Zhou
2005-11-03 16:28   ` Wu Zhou [this message]
2005-11-14 10:08     ` [Patch ping]: " 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.0511031448140.7578@linux.site \
    --to=woodzltc@cn.ibm.com \
    --cc=david@lecomber.net \
    --cc=gdb-patches@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