From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15378 invoked by alias); 16 May 2003 11:24:39 -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 12161 invoked from network); 16 May 2003 11:22:16 -0000 Received: from unknown (HELO black-watch.firstnet.net.uk) (212.103.224.245) by sources.redhat.com with SMTP; 16 May 2003 11:22:16 -0000 Received: (qmail 6744 invoked from network); 16 May 2003 11:22:34 -0000 Received: from unknown (HELO scgj.streamline) (212.103.239.121) by black-watch.first with SMTP; 16 May 2003 11:22:34 -0000 Received: from streamline-computing.com (elmo [192.168.1.66]) by scgj.streamline (8.9.3/8.6.9) with ESMTP id MAA23622 for ; Fri, 16 May 2003 12:25:11 +0100 Received: (from david@localhost) by streamline-computing.com (8.11.6/8.11.6) id h4GBL3X32040 for gdb-patches@sources.redhat.com; Fri, 16 May 2003 12:21:03 +0100 Date: Fri, 16 May 2003 11:24:00 -0000 From: David Lecomber To: gdb-patches@sources.redhat.com Subject: [PATCH] Improvements to Fortran support Message-ID: <20030516122103.A31934@streamline-computing.com> References: <20030115213240.A17967@streamline-computing.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030115213240.A17967@streamline-computing.com>; from david@streamline-computing.com on Wed, Jan 15, 2003 at 09:32:40PM +0000 X-SW-Source: 2003-05/txt/msg00275.txt.bz2 Reposting as I now have the copyright assignment in place.. Fortran arrays are presently allocated in their entirety and then the correct element is pulled out. This (a) doesn't scale, (b) doesn't work if the array is a parameter to a subroutine and supplied with a (*) in the dimensions (GDB runs out of memory doing malloc( -1 )..) The fix here makes the behaviour the same as the code for doing C arrays.. *** eval.c Sun Dec 15 22:29:59 2002 --- eval.c Sun Dec 15 22:28:41 2002 *************** evaluate_subexp_standard (struct type *e *** 1383,1392 **** offset_item = array_size_array[i] * offset_item + subscript_array[i]; - /* Construct a value node with the value of the offset */ - - arg2 = value_from_longest (builtin_type_f_integer, offset_item); - /* Let us now play a dirty trick: we will take arg1 which is a value node pointing to the topmost level of the multidimensional array-set and pretend --- 1383,1388 ---- *************** evaluate_subexp_standard (struct type *e *** 1395,1401 **** returns the correct type value */ VALUE_TYPE (arg1) = tmp_type; ! return value_ind (value_add (value_coerce_array (arg1), arg2)); } case BINOP_LOGICAL_AND: --- 1391,1405 ---- returns the correct type value */ VALUE_TYPE (arg1) = tmp_type; ! ! f77_get_dynamic_lowerbound (tmp_type, &lower); ! ! /* Construct a value node with the value of the offset */ ! /* lower will get subtracted off in value_subscript, hence add it here */ ! ! arg2 = value_from_longest (builtin_type_f_integer, offset_item + lower); ! ! return value_subscript(arg1, arg2); } case BINOP_LOGICAL_AND: David