From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22374 invoked by alias); 27 Aug 2004 00:00:17 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22300 invoked from network); 27 Aug 2004 00:00:14 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 27 Aug 2004 00:00:14 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i7R009S0019145 for ; Thu, 26 Aug 2004 20:00:14 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i7R006330637; Thu, 26 Aug 2004 20:00:07 -0400 To: David Lecomber Cc: patches Subject: Re: [PATCH/RFA] PR gdb/648 (eval.c approval reqd) References: <1091830216.4188.23.camel@localhost> <1092659964.5816.5.camel@localhost> <1093009988.5529.40.camel@cpc4-oxfd5-5-0-cust12.oxfd.cable.ntl.com> From: Jim Blandy Date: Fri, 27 Aug 2004 00:00:00 -0000 In-Reply-To: <1093009988.5529.40.camel@cpc4-oxfd5-5-0-cust12.oxfd.cable.ntl.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-08/txt/msg00718.txt.bz2 In your original post, you said, "G77 puts things in row-major order". It looks to me as if G77 puts the *types* in row-major order (contrary to the Dwarf spec, which wants them in the order they appear in source code), but it locates the actual arrays in memory in column-major order: (gdb) b arrays.f:45 Breakpoint 1 at 0x8048769: file arrays.f, line 45. (gdb) r Starting program: /rigel/jimb/gdb/bugs/648/arrays Breakpoint 1, MAIN__ () at arrays.f:46 46 call oneif(onedi) Current language: auto; currently fortran (gdb) x/40wd &twodi 0xbfffe600: 1 2 3 4 0xbfffe610: 5 6 7 8 0xbfffe620: 9 10 11 12 0xbfffe630: 13 14 15 16 0xbfffe640: 17 18 19 20 0xbfffe650: 2 4 6 8 0xbfffe660: 10 12 14 16 0xbfffe670: 18 20 22 24 0xbfffe680: 26 28 30 32 0xbfffe690: 34 36 38 40 (gdb) ptype twodi type = integer (20,10) (gdb) This shows that varying the leftmost index yields the smallest change in element address, which is column-major. So the arrays are actually laid out correctly; it's just the types in the Dwarf 2 info that are wrong. If that's all correct, then this patch is approved. It seems to me that there's a separate bug in f-valprint.c. The output below is incorrect, right? It's printed as a series of columns, not a series of rows. Or is that what users of a Fortran debugger would expect? (gdb) p twodi $1 = (( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) ( 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40) ( 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60) ( 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80) ( 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100) ( 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, 84, 90, 96, 102, 108, 114, 120) ( 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 98, 105, 112, 119, 126, 133, 140) ( 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160) ( 9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99, 108, 117, 126, 135, 144, 153, 162, 171, 180) ( 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200) ) (gdb)