From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31779 invoked by alias); 12 Mar 2010 13:06:35 -0000 Received: (qmail 31767 invoked by uid 22791); 12 Mar 2010 13:06:34 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from e23smtp02.au.ibm.com (HELO e23smtp02.au.ibm.com) (202.81.31.144) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Mar 2010 13:06:29 +0000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp02.au.ibm.com (8.14.3/8.13.1) with ESMTP id o2CD3CF9002247 for ; Sat, 13 Mar 2010 00:03:12 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o2CD0f081744992 for ; Sat, 13 Mar 2010 00:00:41 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o2CD6Qo1013511 for ; Sat, 13 Mar 2010 00:06:26 +1100 Received: from guara.in.ibm.com (guara.in.ibm.com [9.124.35.96]) by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o2CD6Pf6013501 for ; Sat, 13 Mar 2010 00:06:26 +1100 From: Chandru To: gdb-patches@sourceware.org Subject: gdb can't print array element for fortran Date: Fri, 12 Mar 2010 13:06:00 -0000 User-Agent: KMail/1.11.2 (Linux/2.6.30.9-90.fc11.x86_64; KDE/4.2.2; x86_64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201003121836.24712.chandru@in.ibm.com> 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: 2010-03/txt/msg00443.txt.bz2 This mail pertains to the discussion had on gdb mailing list sometime back here http://sourceware.org/ml/gdb-patches/2009-01/msg00251.html. After a small discussion with Jan I made the following changes and these didn't seem to work. Any inputs or thoughts would be helpful. thanks Chandru --- src/gdb/gdbtypes.c.orig 2010-02-25 00:00:19.000000000 +0530 +++ src/gdb/gdbtypes.c 2010-02-25 00:03:16.000000000 +0530 @@ -727,6 +727,14 @@ create_range_type (struct type *result_t if (low_bound >= 0) TYPE_UNSIGNED (result_type) = 1; + if (high_bound < low_bound) + { + if (high_bound == -1) + TYPE_HIGH_BOUND_UNDEFINED(result_type) = 1; + else + TYPE_HIGH_BOUND_UNDEFINED(result_type) = 0; + } + return result_type; } --- src/gdb/valarith.c.orig 2010-02-25 00:00:26.000000000 +0530 +++ src/gdb/valarith.c 2010-02-25 00:04:37.000000000 +0530 @@ -198,7 +198,7 @@ value_subscripted_rvalue (struct value * unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound); struct value *v; - if (index < lowerbound || elt_offs >= TYPE_LENGTH (array_type)) + if (index < lowerbound || ((elt_offs >= TYPE_LENGTH (array_type)) && !TYPE_HIGH_BOUND_UNDEFINED(array_type))) error (_("no such vector element")); v = allocate_value (elt_type);