From df37d818e505165941ceff793fb222616d95ff4e Mon Sep 17 00:00:00 2001 From: qiyao Date: Thu, 16 Aug 2012 07:36:11 +0000 Subject: gdb/ * gdbtypes.h (enum type_code): Define TYPE_CODE_BITSTRING -1. * arm-tdep.c (arm_type_align): Remove code handling TYPE_CODE_BITSTRING. * c-typeprint.c (c_type_print_varspec_prefix): Likewise. (c_type_print_varspec_suffix): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * f-typeprint.c (f_type_print_varspec_prefix): Likewise. (f_type_print_varspec_suffix): Likewise. * gdbtypes.c (is_scalar_type): Likewise. (recursive_dump_type): Likewise. * infcall.c (value_arg_coerce): Likewise. * m2-valprint.c (m2_val_print): Likewise. * p-typeprint.c (pascal_type_print_varspec_prefix): Likewise. (pascal_type_print_varspec_suffix): Likewise. (pascal_type_print_base): Likewise. * p-valprint.c (pascal_val_print): Likewise. (pascal_val_print): Likewise. * valops.c (value_slice): Likewise. * valprint.c (scalar_type_p): Likewise. * valarith.c (value_bitstring_subscript): Remove. (value_concat): Remove code handling TYPE_CODE_BITSTRING. Remove comment on TYPE_CODE_BITSTRING. * stabsread.c (read_type): Don't set TYPE_CODE (type) to TYPE_CODE_BITSTRING. * python/py-type.c (pyty_codes): Move ENTRY (TYPE_CODE_BITSTRING) to slot 0. gdb/doc: * gdb.texinfo (Types In Python): Mention gdb.TYPE_CODE_BITSTRING is deprecated. --- gdb/valops.c | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'gdb/valops.c') diff --git a/gdb/valops.c b/gdb/valops.c index 8167cd49553..17696eef999 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -3744,8 +3744,7 @@ value_slice (struct value *array, int lowbound, int length) array_type = check_typedef (value_type (array)); if (TYPE_CODE (array_type) != TYPE_CODE_ARRAY - && TYPE_CODE (array_type) != TYPE_CODE_STRING - && TYPE_CODE (array_type) != TYPE_CODE_BITSTRING) + && TYPE_CODE (array_type) != TYPE_CODE_STRING) error (_("cannot take slice of non-array")); range_type = TYPE_INDEX_TYPE (array_type); @@ -3762,38 +3761,7 @@ value_slice (struct value *array, int lowbound, int length) TYPE_TARGET_TYPE (range_type), lowbound, lowbound + length - 1); - if (TYPE_CODE (array_type) == TYPE_CODE_BITSTRING) - { - int i; - - slice_type = create_set_type ((struct type *) NULL, - slice_range_type); - TYPE_CODE (slice_type) = TYPE_CODE_BITSTRING; - slice = value_zero (slice_type, not_lval); - for (i = 0; i < length; i++) - { - int element = value_bit_index (array_type, - value_contents (array), - lowbound + i); - - if (element < 0) - error (_("internal error accessing bitstring")); - else if (element > 0) - { - int j = i % TARGET_CHAR_BIT; - - if (gdbarch_bits_big_endian (get_type_arch (array_type))) - j = TARGET_CHAR_BIT - 1 - j; - value_contents_raw (slice)[i / TARGET_CHAR_BIT] |= (1 << j); - } - } - /* We should set the address, bitssize, and bitspos, so the - slice can be used on the LHS, but that may require extensions - to value_assign. For now, just leave as a non_lval. - FIXME. */ - } - else { struct type *element_type = TYPE_TARGET_TYPE (array_type); LONGEST offset = -- cgit v1.2.1