diff options
author | Yao Qi <yao@codesourcery.com> | 2012-08-16 07:36:28 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2012-08-16 07:36:28 +0000 |
commit | 6b1755ce16be3fbe1630507651c73df2710da80f (patch) | |
tree | 1b9a902a1ff3598a7e0bf06002c2abbeaffb9790 /gdb | |
parent | 8acc40656214b647cd7f078e6d2c7a13321e2be5 (diff) | |
download | gdb-6b1755ce16be3fbe1630507651c73df2710da80f.zip gdb-6b1755ce16be3fbe1630507651c73df2710da80f.tar.gz gdb-6b1755ce16be3fbe1630507651c73df2710da80f.tar.bz2 |
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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 30 | ||||
-rw-r--r-- | gdb/arm-tdep.c | 1 | ||||
-rw-r--r-- | gdb/c-typeprint.c | 2 | ||||
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 2 | ||||
-rw-r--r-- | gdb/eval.c | 6 | ||||
-rw-r--r-- | gdb/f-typeprint.c | 2 | ||||
-rw-r--r-- | gdb/gdbtypes.c | 4 | ||||
-rw-r--r-- | gdb/gdbtypes.h | 7 | ||||
-rw-r--r-- | gdb/infcall.c | 1 | ||||
-rw-r--r-- | gdb/m2-valprint.c | 16 | ||||
-rw-r--r-- | gdb/p-typeprint.c | 6 | ||||
-rw-r--r-- | gdb/p-valprint.c | 16 | ||||
-rw-r--r-- | gdb/python/py-type.c | 2 | ||||
-rw-r--r-- | gdb/stabsread.c | 4 | ||||
-rw-r--r-- | gdb/valarith.c | 56 | ||||
-rw-r--r-- | gdb/valops.c | 34 | ||||
-rw-r--r-- | gdb/valprint.c | 1 |
18 files changed, 53 insertions, 142 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 17b7651..fd04d7a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,35 @@ 2012-08-16 Yao Qi <yao@codesourcery.com> + * 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. + +2012-08-16 Yao Qi <yao@codesourcery.com> + * tracepoint.c (trace_find_none_command): Remove. (_initialize_tracepoint): Call add_alias_cmd for "tfind none". diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 568ace5..063c1db 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3285,7 +3285,6 @@ arm_type_align (struct type *t) case TYPE_CODE_FLT: case TYPE_CODE_SET: case TYPE_CODE_RANGE: - case TYPE_CODE_BITSTRING: case TYPE_CODE_REF: case TYPE_CODE_CHAR: case TYPE_CODE_BOOL: diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index a5892b5..29b27e9 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -322,7 +322,6 @@ c_type_print_varspec_prefix (struct type *type, case TYPE_CODE_SET: case TYPE_CODE_RANGE: case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: case TYPE_CODE_COMPLEX: case TYPE_CODE_NAMESPACE: case TYPE_CODE_DECFLOAT: @@ -679,7 +678,6 @@ c_type_print_varspec_suffix (struct type *type, case TYPE_CODE_SET: case TYPE_CODE_RANGE: case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: case TYPE_CODE_COMPLEX: case TYPE_CODE_NAMESPACE: case TYPE_CODE_DECFLOAT: diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 661d933..cedc5f5 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2012-08-16 Yao Qi <yao@codesourcery.com> + + * gdb.texinfo (Types In Python): Mention gdb.TYPE_CODE_BITSTRING + is deprecated. + 2012-08-13 Doug Evans <dje@google.com> * gdb.texinfo (Convenience Vars): Update text for "show convenience" diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 5cb8c8e..7dee642 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -23552,7 +23552,7 @@ language-defined string types; C strings are not represented this way. @findex TYPE_CODE_BITSTRING @findex gdb.TYPE_CODE_BITSTRING @item gdb.TYPE_CODE_BITSTRING -A string of bits. +A string of bits. It is deprecated. @findex TYPE_CODE_ERROR @findex gdb.TYPE_CODE_ERROR @@ -2323,12 +2323,6 @@ evaluate_subexp_standard (struct type *expect_type, arg1 = value_subscript (arg1, value_as_long (arg2)); break; - case TYPE_CODE_BITSTRING: - type = language_bool_type (exp->language_defn, exp->gdbarch); - arg1 = value_bitstring_subscript (type, arg1, - value_as_long (arg2)); - break; - default: if (TYPE_NAME (type)) error (_("cannot subscript something of type `%s'"), diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c index a95ef84..c59e639 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -131,7 +131,6 @@ f_type_print_varspec_prefix (struct type *type, struct ui_file *stream, case TYPE_CODE_SET: case TYPE_CODE_RANGE: case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: case TYPE_CODE_METHOD: case TYPE_CODE_REF: case TYPE_CODE_COMPLEX: @@ -230,7 +229,6 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, case TYPE_CODE_SET: case TYPE_CODE_RANGE: case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: case TYPE_CODE_METHOD: case TYPE_CODE_COMPLEX: case TYPE_CODE_TYPEDEF: diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 3903ede..119a658 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -2034,7 +2034,6 @@ is_scalar_type (struct type *type) case TYPE_CODE_UNION: case TYPE_CODE_SET: case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: return 0; default: return 1; @@ -3075,9 +3074,6 @@ recursive_dump_type (struct type *type, int spaces) case TYPE_CODE_STRING: printf_filtered ("(TYPE_CODE_STRING)"); break; - case TYPE_CODE_BITSTRING: - printf_filtered ("(TYPE_CODE_BITSTRING)"); - break; case TYPE_CODE_ERROR: printf_filtered ("(TYPE_CODE_ERROR)"); break; diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 17bfbc5..afe0103 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -58,7 +58,8 @@ typedef struct enum type_code { - TYPE_CODE_UNDEF, /* Not used; catches errors */ + TYPE_CODE_BITSTRING = -1, /* Deprecated */ + TYPE_CODE_UNDEF = 0, /* Not used; catches errors */ TYPE_CODE_PTR, /* Pointer type */ /* Array type with lower & upper bounds. @@ -109,10 +110,6 @@ enum type_code a new type code. */ TYPE_CODE_STRING, - /* String of bits; like TYPE_CODE_SET but prints differently (at - least for (the deleted) CHILL). */ - TYPE_CODE_BITSTRING, - /* Unknown type. The length field is valid if we were able to deduce that much about the type, or 0 if we don't even know that. */ TYPE_CODE_ERROR, diff --git a/gdb/infcall.c b/gdb/infcall.c index 1b2c3d6..1b92748 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -213,7 +213,6 @@ value_arg_coerce (struct gdbarch *gdbarch, struct value *arg, case TYPE_CODE_SET: case TYPE_CODE_RANGE: case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: case TYPE_CODE_ERROR: case TYPE_CODE_MEMBERPTR: case TYPE_CODE_METHODPTR: diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c index e92679f..3d3127e 100644 --- a/gdb/m2-valprint.c +++ b/gdb/m2-valprint.c @@ -409,7 +409,6 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, options, NULL, 0); break; - case TYPE_CODE_BITSTRING: case TYPE_CODE_SET: elttype = TYPE_INDEX_TYPE (type); CHECK_TYPEDEF (elttype); @@ -424,13 +423,9 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, struct type *range = elttype; LONGEST low_bound, high_bound; int i; - int is_bitstring = TYPE_CODE (type) == TYPE_CODE_BITSTRING; int need_comma = 0; - if (is_bitstring) - fputs_filtered ("B'", stream); - else - fputs_filtered ("{", stream); + fputs_filtered ("{", stream); i = get_discrete_bounds (range, &low_bound, &high_bound); maybe_bad_bstring: @@ -450,9 +445,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, i = element; goto maybe_bad_bstring; } - if (is_bitstring) - fprintf_filtered (stream, "%d", element); - else if (element) + if (element) { if (need_comma) fputs_filtered (", ", stream); @@ -476,10 +469,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, } } done: - if (is_bitstring) - fputs_filtered ("'", stream); - else - fputs_filtered ("}", stream); + fputs_filtered ("}", stream); } break; diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index a00f5b3..fceb97a 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -289,7 +289,6 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream, case TYPE_CODE_SET: case TYPE_CODE_RANGE: case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: case TYPE_CODE_COMPLEX: case TYPE_CODE_TYPEDEF: /* These types need no prefix. They are listed here so that @@ -408,7 +407,6 @@ pascal_type_print_varspec_suffix (struct type *type, struct ui_file *stream, case TYPE_CODE_SET: case TYPE_CODE_RANGE: case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: case TYPE_CODE_COMPLEX: case TYPE_CODE_TYPEDEF: /* These types do not need a suffix. They are listed so that @@ -792,10 +790,6 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, show - 1, level); break; - case TYPE_CODE_BITSTRING: - fputs_filtered ("BitString", stream); - break; - case TYPE_CODE_STRING: fputs_filtered ("String", stream); break; diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 9f44617..b2287f2 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -334,7 +334,6 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, } break; - case TYPE_CODE_BITSTRING: case TYPE_CODE_SET: elttype = TYPE_INDEX_TYPE (type); CHECK_TYPEDEF (elttype); @@ -349,13 +348,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, struct type *range = elttype; LONGEST low_bound, high_bound; int i; - int is_bitstring = TYPE_CODE (type) == TYPE_CODE_BITSTRING; int need_comma = 0; - if (is_bitstring) - fputs_filtered ("B'", stream); - else - fputs_filtered ("[", stream); + fputs_filtered ("[", stream); i = get_discrete_bounds (range, &low_bound, &high_bound); if (low_bound == 0 && high_bound == -1 && TYPE_LENGTH (type) > 0) @@ -383,9 +378,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, i = element; goto maybe_bad_bstring; } - if (is_bitstring) - fprintf_filtered (stream, "%d", element); - else if (element) + if (element) { if (need_comma) fputs_filtered (", ", stream); @@ -409,10 +402,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, } } done: - if (is_bitstring) - fputs_filtered ("'", stream); - else - fputs_filtered ("]", stream); + fputs_filtered ("]", stream); } break; diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index 3d8ab29..f20f974 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -85,6 +85,7 @@ static PyObject *typy_make_iter (PyObject *self, enum gdbpy_iter_kind kind); static struct pyty_code pyty_codes[] = { + ENTRY (TYPE_CODE_BITSTRING), ENTRY (TYPE_CODE_PTR), ENTRY (TYPE_CODE_ARRAY), ENTRY (TYPE_CODE_STRUCT), @@ -98,7 +99,6 @@ static struct pyty_code pyty_codes[] = ENTRY (TYPE_CODE_SET), ENTRY (TYPE_CODE_RANGE), ENTRY (TYPE_CODE_STRING), - ENTRY (TYPE_CODE_BITSTRING), ENTRY (TYPE_CODE_ERROR), ENTRY (TYPE_CODE_METHOD), ENTRY (TYPE_CODE_METHODPTR), diff --git a/gdb/stabsread.c b/gdb/stabsread.c index eb09c9d..1c288ee 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -2024,11 +2024,9 @@ again: make_vector_type (type); break; - case 'S': /* Set or bitstring type */ + case 'S': /* Set type */ type1 = read_type (pp, objfile); type = create_set_type ((struct type *) NULL, type1); - if (is_string) - TYPE_CODE (type) = TYPE_CODE_BITSTRING; if (typenums[0] != -1) *dbx_lookup_type (typenums, objfile) = type; break; diff --git a/gdb/valarith.c b/gdb/valarith.c index 96d5411..6858d2b 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -139,7 +139,6 @@ value_ptrdiff (struct value *arg1, struct value *arg2) 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. @@ -221,46 +220,6 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) return v; } -/* Return the value of BITSTRING[IDX] as (boolean) type TYPE. */ - -struct value * -value_bitstring_subscript (struct type *type, - struct value *bitstring, LONGEST index) -{ - - struct type *bitstring_type, *range_type; - struct value *v; - int offset, byte, bit_index; - LONGEST lowerbound, upperbound; - - bitstring_type = check_typedef (value_type (bitstring)); - gdb_assert (TYPE_CODE (bitstring_type) == TYPE_CODE_BITSTRING); - - range_type = TYPE_INDEX_TYPE (bitstring_type); - get_discrete_bounds (range_type, &lowerbound, &upperbound); - if (index < lowerbound || index > upperbound) - error (_("bitstring index out of range")); - - index -= lowerbound; - offset = index / TARGET_CHAR_BIT; - byte = *((char *) value_contents (bitstring) + offset); - - bit_index = index % TARGET_CHAR_BIT; - byte >>= (gdbarch_bits_big_endian (get_type_arch (bitstring_type)) ? - TARGET_CHAR_BIT - 1 - bit_index : bit_index); - - v = value_from_longest (type, byte & 1); - - set_value_bitpos (v, bit_index); - set_value_bitsize (v, 1); - set_value_component_location (v, bitstring); - VALUE_FRAME_ID (v) = VALUE_FRAME_ID (bitstring); - - set_value_offset (v, offset + value_offset (bitstring)); - - return v; -} - /* Check to see if either argument is a structure, or a reference to one. This is called so we know whether to go ahead with the normal @@ -735,10 +694,9 @@ value_concat (struct value *arg1, struct value *arg2) } outval = value_string (ptr, count * inval2len, char_type); } - else if (TYPE_CODE (type2) == TYPE_CODE_BITSTRING - || TYPE_CODE (type2) == TYPE_CODE_BOOL) + else if (TYPE_CODE (type2) == TYPE_CODE_BOOL) { - error (_("unimplemented support for bitstring/boolean repeats")); + error (_("unimplemented support for boolean repeats")); } else { @@ -780,17 +738,15 @@ value_concat (struct value *arg1, struct value *arg2) } outval = value_string (ptr, inval1len + inval2len, char_type); } - else if (TYPE_CODE (type1) == TYPE_CODE_BITSTRING - || TYPE_CODE (type1) == TYPE_CODE_BOOL) + else if (TYPE_CODE (type1) == TYPE_CODE_BOOL) { /* We have two bitstrings to concatenate. */ - if (TYPE_CODE (type2) != TYPE_CODE_BITSTRING - && TYPE_CODE (type2) != TYPE_CODE_BOOL) + if (TYPE_CODE (type2) != TYPE_CODE_BOOL) { - error (_("Bitstrings or booleans can only be concatenated " + error (_("Booleans can only be concatenated " "with other bitstrings or booleans.")); } - error (_("unimplemented support for bitstring/boolean concatenation.")); + error (_("unimplemented support for boolean concatenation.")); } else { diff --git a/gdb/valops.c b/gdb/valops.c index 8167cd4..17696ee 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 = diff --git a/gdb/valprint.c b/gdb/valprint.c index fc5942d..6e651f6 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -252,7 +252,6 @@ scalar_type_p (struct type *type) case TYPE_CODE_UNION: case TYPE_CODE_SET: case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: return 0; default: return 1; |