From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23465 invoked by alias); 16 Jun 2014 21:02:38 -0000 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 Received: (qmail 23455 invoked by uid 89); 16 Jun 2014 21:02:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Jun 2014 21:02:36 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5GL2XWN021004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Jun 2014 17:02:33 -0400 Received: from host2.jankratochvil.net (ovpn-116-65.ams2.redhat.com [10.36.116.65]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5GL2TjO029013 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Mon, 16 Jun 2014 17:02:32 -0400 Date: Mon, 16 Jun 2014 21:02:00 -0000 From: Jan Kratochvil To: Keven Boell Cc: gdb-patches@sourceware.org, sanimir.agovic@intel.com Subject: Re: [PATCH 04/23] vla: make dynamic fortran arrays functional. Message-ID: <20140616210229.GB20395@host2.jankratochvil.net> References: <1401861266-6240-1-git-send-email-keven.boell@intel.com> <1401861266-6240-5-git-send-email-keven.boell@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1401861266-6240-5-git-send-email-keven.boell@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00570.txt.bz2 On Wed, 04 Jun 2014 07:54:07 +0200, Keven Boell wrote: > diff --git a/gdb/valarith.c b/gdb/valarith.c > index 8e863e3..bddb9db 100644 > --- a/gdb/valarith.c > +++ b/gdb/valarith.c > @@ -200,7 +200,14 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) > > if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) > && elt_offs >= TYPE_LENGTH (array_type))) > - error (_("no such vector element")); > + { > + if (TYPE_NOT_ASSOCIATED (array_type)) > + error (_("no such vector element because not associated")); > + else if (TYPE_NOT_ALLOCATED (array_type)) > + error (_("no such vector element because not allocated")); > + else > + error (_("no such vector element")); > + } > > if (VALUE_LVAL (array) == lval_memory && value_lazy (array)) > v = allocate_value_lazy (elt_type); I find here the patch is incomplete. Earlier this function has: unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound); and in some cases - specifically with the 64-bit inferior objects patch, the *bitpos* patches from: http://pkgs.fedoraproject.org/cgit/gdb.git/tree/ one occasionally gets for TYPE_NOT_ALLOCATED inferior variables: Value out of range. instead of the more correct: no such vector element because not allocated Because for TYPE_NOT_ALLOCATED inferior variable the LOWERBOUND value read from the inferior is bogus and 'index - lowerbound' will not fit in 'int'. Thanks, Jan