From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18090 invoked by alias); 5 Sep 2008 20:17:05 -0000 Received: (qmail 18077 invoked by uid 22791); 5 Sep 2008 20:17:05 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 05 Sep 2008 20:16:22 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id m85KFLPg148292 for ; Fri, 5 Sep 2008 20:15:21 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m85KFKKZ1314960 for ; Fri, 5 Sep 2008 22:15:20 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m85KFKFt029902 for ; Fri, 5 Sep 2008 22:15:20 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m85KFKWT029320; Fri, 5 Sep 2008 22:15:20 +0200 Message-Id: <200809052015.m85KFKWT029320@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 5 Sep 2008 22:14:51 +0200 Subject: Re: [rfc][03/37] Eliminate builtin_type_ macros: Extract bitstring subscript handling To: brobecker@adacore.com (Joel Brobecker) Date: Fri, 05 Sep 2008 20:17:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <20080905181542.GB15267@adacore.com> from "Joel Brobecker" at Sep 05, 2008 11:15:42 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 2008-09/txt/msg00110.txt.bz2 Joel Brobecker wrote: > > * valarith.h (value_bitstring_subscript): New function. > > (value_subscript): No longer handle TYPE_CODE_BITSTRING. > > Perhaps it would be worth mentioning in the function description > that it no longer handle bitstrings? Makes sense. I've added the following text: @@ -171,6 +171,11 @@ an integer nor a pointer of the same typ } /* Return the value of ARRAY[IDX]. + + ARRAY may be of type TYPE_CODE_ARRAY or TYPE_CODE_STRING. If the + current language supports C-style arrays, it may also be TYPE_CODE_PTR. + To access TYPE_CODE_BITSTRING values, use value_bitstring_subscript. + See comments in value_coerce_array() for rationale for reason for doing lower bounds adjustment here rather than there. FIXME: Perhaps we should validate that the index is valid and if Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com