This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc][03/37] Eliminate builtin_type_ macros: Extract bitstring subscript handling
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: brobecker at adacore dot com (Joel Brobecker)
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 5 Sep 2008 22:14:51 +0200 (CEST)
- Subject: Re: [rfc][03/37] Eliminate builtin_type_ macros: Extract bitstring subscript handling
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