From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3581 invoked by alias); 17 Jun 2014 13:53:59 -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 3569 invoked by uid 89); 17 Jun 2014 13:53:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mga01.intel.com Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Jun 2014 13:53:54 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 17 Jun 2014 06:53:51 -0700 X-ExtLoop1: 1 Received: from kboell-mobl2.ger.corp.intel.com (HELO [172.28.205.55]) ([172.28.205.55]) by fmsmga002.fm.intel.com with ESMTP; 17 Jun 2014 06:48:20 -0700 Message-ID: <53A04723.8050802@linux.intel.com> Date: Tue, 17 Jun 2014 13:53:00 -0000 From: Keven Boell User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Jan Kratochvil , Keven Boell CC: gdb-patches@sourceware.org, sanimir.agovic@intel.com Subject: Re: [PATCH 04/23] vla: make dynamic fortran arrays functional. References: <1401861266-6240-1-git-send-email-keven.boell@intel.com> <1401861266-6240-5-git-send-email-keven.boell@intel.com> <20140616210229.GB20395@host2.jankratochvil.net> In-Reply-To: <20140616210229.GB20395@host2.jankratochvil.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00584.txt.bz2 Am 16.06.2014 23:02, schrieb Jan Kratochvil: > 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'. This change just adds some more information for the already existing "no such vector element" message. To me the change you are describing sounds more like a generic fix for this function or am I wrong? > > > Thanks, > Jan >