aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-11-16 22:13:02 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-11-16 22:13:02 +0000
commit19f220c3b4954d0f9f8597d7de19b071bcf99be0 (patch)
treed210b0d084605590ef80e8e89804b3510e3f8948 /gdb/ada-lang.c
parent87df528e2a286b731101643c2c485d85be60f987 (diff)
downloadgdb-19f220c3b4954d0f9f8597d7de19b071bcf99be0.zip
gdb-19f220c3b4954d0f9f8597d7de19b071bcf99be0.tar.gz
gdb-19f220c3b4954d0f9f8597d7de19b071bcf99be0.tar.bz2
gdb/
* ada-lang.c (modify_general_field): Remove. (make_array_descriptor): Replace all modify_general_field calls by modify_field. * value.c (modify_field): Update comment. New variable bytesize. Normalize BITPOS. Initialize BYTESIZE, use it.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c55
1 files changed, 21 insertions, 34 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index ea71ea2..76b20e7 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -69,8 +69,6 @@
#define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2)
#endif
-static void modify_general_field (struct type *, char *, LONGEST, int, int);
-
static struct type *desc_base_type (struct type *);
static struct type *desc_bounds_type (struct type *);
@@ -1343,15 +1341,6 @@ static char *bound_name[] = {
#define MAX_ADA_DIMENS (sizeof(bound_name) / (2*sizeof(char *)))
-/* Like modify_field, but allows bitpos > wordlength. */
-
-static void
-modify_general_field (struct type *type, char *addr,
- LONGEST fieldval, int bitpos, int bitsize)
-{
- modify_field (type, addr + bitpos / 8, fieldval, bitpos % 8, bitsize);
-}
-
/* The desc_* routines return primitive portions of array descriptors
(fat pointers). */
@@ -4038,33 +4027,31 @@ make_array_descriptor (struct type *type, struct value *arr)
for (i = ada_array_arity (ada_check_typedef (value_type (arr))); i > 0; i -= 1)
{
- modify_general_field (value_type (bounds),
- value_contents_writeable (bounds),
- ada_array_bound (arr, i, 0),
- desc_bound_bitpos (bounds_type, i, 0),
- desc_bound_bitsize (bounds_type, i, 0));
- modify_general_field (value_type (bounds),
- value_contents_writeable (bounds),
- ada_array_bound (arr, i, 1),
- desc_bound_bitpos (bounds_type, i, 1),
- desc_bound_bitsize (bounds_type, i, 1));
+ modify_field (value_type (bounds), value_contents_writeable (bounds),
+ ada_array_bound (arr, i, 0),
+ desc_bound_bitpos (bounds_type, i, 0),
+ desc_bound_bitsize (bounds_type, i, 0));
+ modify_field (value_type (bounds), value_contents_writeable (bounds),
+ ada_array_bound (arr, i, 1),
+ desc_bound_bitpos (bounds_type, i, 1),
+ desc_bound_bitsize (bounds_type, i, 1));
}
bounds = ensure_lval (bounds);
- modify_general_field (value_type (descriptor),
- value_contents_writeable (descriptor),
- value_pointer (ensure_lval (arr),
- TYPE_FIELD_TYPE (desc_type, 0)),
- fat_pntr_data_bitpos (desc_type),
- fat_pntr_data_bitsize (desc_type));
-
- modify_general_field (value_type (descriptor),
- value_contents_writeable (descriptor),
- value_pointer (bounds,
- TYPE_FIELD_TYPE (desc_type, 1)),
- fat_pntr_bounds_bitpos (desc_type),
- fat_pntr_bounds_bitsize (desc_type));
+ modify_field (value_type (descriptor),
+ value_contents_writeable (descriptor),
+ value_pointer (ensure_lval (arr),
+ TYPE_FIELD_TYPE (desc_type, 0)),
+ fat_pntr_data_bitpos (desc_type),
+ fat_pntr_data_bitsize (desc_type));
+
+ modify_field (value_type (descriptor),
+ value_contents_writeable (descriptor),
+ value_pointer (bounds,
+ TYPE_FIELD_TYPE (desc_type, 1)),
+ fat_pntr_bounds_bitpos (desc_type),
+ fat_pntr_bounds_bitsize (desc_type));
descriptor = ensure_lval (descriptor);