From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7313 invoked by alias); 16 Nov 2007 03:20:18 -0000 Received: (qmail 7297 invoked by uid 22791); 16 Nov 2007 03:20:17 -0000 X-Spam-Check-By: sourceware.org Received: from pauline.vellum.cz (HELO pauline.vellum.cz) (89.250.243.234) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 16 Nov 2007 03:20:09 +0000 Received: from host0.dyn.jankratochvil.net (localhost.localdomain [127.0.0.1]) by pauline.vellum.cz (8.12.11.20060308/8.12.11) with ESMTP id lAG3K5dr003146 for ; Fri, 16 Nov 2007 04:20:05 +0100 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.1/8.14.1) with ESMTP id lAG3K374010127; Fri, 16 Nov 2007 04:20:03 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.1/8.14.1/Submit) id lAG3K2mc010126; Fri, 16 Nov 2007 04:20:02 +0100 Date: Fri, 16 Nov 2007 03:20:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Jakub Jelinek Subject: [00/11] Fortran dynamic arrays support Message-ID: <20071116032002.GA9885@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.16 (2007-06-09) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00317.txt.bz2 Hi, currently GDB cannot display allocated or associated (dynamic) Fortran arrays. Support for the DWARF annotation of these is still not commited in GCC SVN. GCC Bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244 Latest GCC 4.3 patch: http://people.redhat.com/jkratoch/rh364001/gcc22244-Z40d-jakub.patch Prebuilt Fortran testcase: http://people.redhat.com/jkratoch/rh364001/testcase-a5-jakub.tar.gz Jakub's mail (old): http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00612.html This patchset should also enable proper handling of C VLAs (Variable Length Arrays) but GCC-4.x does not emit any DWARF and the GCC-3.4 DWARF was IMO wrong for them. These GDB features are missing and get implemented by the patchset: * Dynamic array bounds. * DW_AT_*stride. * DW_AT_data_location. * DW_FORM_block* for DW_AT_lower_bound, DW_AT_upper_bound, DW_AT_*stride. Most of the support was intentionally limited only for the Fortran arrays where it is currently only produced by GCC. Patchset has incremental dependencies. All stages are buildable but only the full patchset has been regression tested by the testsuite. Current output is: (gdb) ptype varx type = real*4 (0:-1,0:-1,0:-1) (gdb) p varx $1 = () Patched output is: (gdb) ptype varx type = real*4 (6,5:15,17:28) (gdb) p varx $1 = (( ( 7, 6, 6, 6, 6, 6) ( 6, 6, 6, 6, 6, 6) ( 6, [cut ...] There is a design problem that GDB deals with the TYPE already without any relation to the original variable. I tried to patch there a general TYPE->VARIABLE binding first but it is too intrusive for GDB as it makes the same abstract TYPE and VARIABLE-bound TYPE two different objects. Current patchset provides another function parameter in the codepaths requiring it. Another design problem is that TYPE_LENGTH (and other macros) defined as `type->length' need to behave dynamically now (calculate DWARF expressions) but the same macro is currently used everywhere both as the setter (lval) and the getter. Currently the getter call is replaced on (few) places where it was required for the Fortran arrays. I can expand there some of the compatibility wrapping functions if it gets otherwise accepted. This GCC Fortran <-> GDB patches were not tested against any 3rd part DWARF producers/consumers (which exist?). Regards, Jan