This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] DW_AT_byte_size for array type entries
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Ken Werner <ken at linux dot vnet dot ibm dot com>
- Cc: gdb-patches at sourceware dot org, Tom Tromey <tromey at redhat dot com>
- Date: Tue, 14 Dec 2010 09:41:50 +0400
- Subject: Re: [patch] DW_AT_byte_size for array type entries
- References: <201010191323.57251.ken@linux.vnet.ibm.com> <m3iq0fgxy0.fsf@fleche.redhat.com> <201011031522.50715.ken@linux.vnet.ibm.com> <201012132103.09320.ken@linux.vnet.ibm.com>
> 2010-12-13 Ken Werner <ken.werner@de.ibm.com>
>
> * valops.c (value_one): Use get_array_bounds to compute the number
> of array elements instead of dividing the length of the array by the
> length of the element types.
> * valarith.c (value_complement, value_neg): Likewise.
This is OK.
As a followup patch, how about defining a new function `get_array_length'
next to get_array_bounds? That way, you can factorize of this code that
keeps being repeated...
--
Joel