From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19774 invoked by alias); 24 Feb 2012 16:34:07 -0000 Received: (qmail 19584 invoked by uid 22791); 24 Feb 2012 16:34:05 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Feb 2012 16:33:45 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id E5A771C6C5A; Fri, 24 Feb 2012 11:33:44 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hrYs3DkzO2lh; Fri, 24 Feb 2012 11:33:44 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A4F751C6C62; Fri, 24 Feb 2012 11:33:44 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 11EF9145615; Fri, 24 Feb 2012 08:33:39 -0800 (PST) Date: Fri, 24 Feb 2012 16:49:00 -0000 From: Joel Brobecker To: Tristan Gingold Cc: gdb-patches@sourceware.org Subject: Re: patch in ada-tasks needs small fix (was: "New ARI warning Fri Feb 24 01:54:10 UTC 2012") Message-ID: <20120224163339.GK2692@adacore.com> References: <20120224015410.GA23561@sourceware.org> <20120224134032.GJ2692@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2012-02/txt/msg00587.txt.bz2 > > Would you take a look at that? If you don't get to it today, then > > I will try to have a look at it. > > I can propose this patch, but I haven't yet tested it beyond compiling gdb: This looks good to me. I think that native testing is going to be sufficient. If you are running out of time, no worries, I can test and commit for you. > diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c > index 4c0b667..11ad262 100644 > --- a/gdb/ada-tasks.c > +++ b/gdb/ada-tasks.c > @@ -870,13 +870,15 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) > { > /* Validate. */ > struct type *type = check_typedef (SYMBOL_TYPE (sym)); > - struct type *eltype; > - struct type *idxtype; > - > - if (TYPE_CODE (type) == TYPE_CODE_ARRAY > - && (eltype = check_typedef (TYPE_TARGET_TYPE (type))) > - && TYPE_CODE (eltype) == TYPE_CODE_PTR > - && (idxtype = check_typedef (TYPE_INDEX_TYPE (type))) > + struct type *eltype = NULL; > + struct type *idxtype = NULL; > + > + if (TYPE_CODE (type) == TYPE_CODE_ARRAY) > + eltype = check_typedef (TYPE_TARGET_TYPE (type)); > + if (eltype != NULL > + && TYPE_CODE (eltype) == TYPE_CODE_PTR) > + idxtype = check_typedef (TYPE_INDEX_TYPE (type)); > + if (idxtype != NULL > && !TYPE_LOW_BOUND_UNDEFINED (idxtype) > && !TYPE_HIGH_BOUND_UNDEFINED (idxtype)) Thanks! -- Joel