On Wed, 28 Mar 2012 10:55:13 -0600 Tom Tromey wrote: > >>>>> "Siddhesh" == Siddhesh Poyarekar writes: > > Siddhesh> I took a separate approach from the one I took in: > Siddhesh> http://sourceware.org/ml/gdb-patches/2012-02/msg00403.html > > Siddhesh> and removed the overloaded meaning of the bitpos location > Siddhesh> variable to fix PR symtab/7259. In the following patch, I > Siddhesh> introduce a separate field_location union member 'enumval' > Siddhesh> which can accept LONGEST and hence expand enum values to > Siddhesh> 64-bit signed values. With this change, bitpos now only is > Siddhesh> used for (non-negative) offsets into structures, since the > Siddhesh> other overload of bitpos (range bounds) were already > Siddhesh> separated into struct range_bound. > > I think this also needs an update in py-type.c:convert_field. Thanks, I missed that. I have attached a modified patch with this change (and other changes resulting from it) included. Updated ChangeLog below. Regards, Siddhesh ChangeLog: 2012-03-21 Siddhesh Poyarekar PR symtab/7259: * gdbtypes.h (enum field_loc_kind): New FIELD_LOC_KIND_ENUMVAL. (struct main_type.fields): Adjust loc_kind and bitsize to accommodate FIELD_LOC_KIND_ENUMVAL. (struct main_type.fields.field_location): New enumval. New macros: FIELD_ENUMVAL, SET_FIELD_ENUMVAL and TYPE_FIELD_ENUMVAL. * ada-exp.y (convert_char_literal): use TYPE_FIELD_ENUMVAL if type is TYPE_CODE_ENUM. * ada-lang.c (ada_discrete_type_high_bound): Ditto. (ada_discrete_type_low_bound, value_val_atr): Ditto. (ada_identical_enum_types_p, pos_atr): Ditto. * ada-typeprint.c (print_enum_type): Ditto. * ada-valprint.c (print_optional_low_bound): Ditto. (ada_print_scalar, ada_val_print_1): Ditto. * c-typeprint.c (c_type_print_base): Ditto. * coffread.c (coff_read_enum_type): Ditto. * dwarf2read.c (process_enumeration_scope): Ditto. * gdbtypes.c (get_discrete_bounds): Ditto (recursive_dump_type, copy_type_recursive): Ditto. * m2-typeprint.c (m2_enum): Ditto. * mdebugread.c (parse_symbol): Ditto. * p-typeprint.c (pascal_type_print_base): Ditto. * python/py-type.c (check_types_equal, convert_field): Ditto. * stabsread.c (read_enum_type): Ditto. * typepint.c (print_type_scalar): Ditto. * valprint.c (generic_val_print): Ditto. * gdb-gdb.py (class StructMainTypePrettyPrinter): Ditto. (TypeFlagsPrinter): Use field.enumval instead of field.bitpos. * python/lib/gdb/printing.py (FlagEnumerationPrinter): Ditto. * python/lib/gdb/types.py (make_enum_dict): Ditto. testsuite/ChangeLog: 2012-03-21 Siddhesh Poyarekar PR symtab/7259: * gdb.base/enumval.exp: New test case. * gdb.base/enumval.c: New test case. * gdb.python/py-type.exp (test_enums): Modify test to look for field.enumval instead of field.bitpos.