Skip to content

Commit d04183a

Browse files
ivanivanov884jeffmahoney
authored andcommitted
gdb-rhbz795424-bitpos-20of25.patch
;; Fix `GDB cannot access struct member whose offset is larger than 256MB' ;; (RH BZ 795424). ;;=push http://sourceware.org/ml/gdb-patches/2012-09/msg00631.html --MP_/yp5f+W_ED2JtUlSyBi8xujr Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, This is patch 1/4, which implements the bulk of the changes in type length and bitpos/type offset. I have verified that there are no regressions resulting from this patch by running the testsuite on Fedora 16 x86_64. Patch and changelog attached. Regards, Siddhesh --MP_/yp5f+W_ED2JtUlSyBi8xujr Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=ChangeLog-main gdb/ChangeLog 2012-08-05 Siddhesh Poyarekar <siddhesh@redhat.com> * ada-lang.c (fat_pntr_bounds_bitpos): Return LONGEST. (fat_pntr_data_bitpos): Likewise. (desc_bound_bitpos): Likewise. (constrained_packed_array_type): Expand ELT_BITS parameter to LONGEST. (move_bits): Expand parameters SRC_OFFSET and N to LONGEST. (cond_offset_host): Expand parameter OFFSET to LONGEST. (cond_offset_target): Likewise. (ada_type_of_array): Expand ARRAY_BITSIZE to LONGEST. (decode_constrained_packed_array_type): Expand BITS to LONGEST. (decode_constrained_packed_array): Expand BIT_POS to LONGEST. (ada_value_primitive_packed_val): Expand parameter OFFSET to LONGEST. Expand TARG, NTARG and NEW_OFFSET to LONGEST. (ada_value_assign): Expand FROM_SIZE to LONGEST. (value_assign_to_component): Expand BITS to LONGEST. (ensure_lval): Expand LEN to LONGEST. (value_pointer): Expand LEN to ULONGEST. (value_tag_from_contents_and_address): Expand TAG_BYTE_OFFSET to LONGEST. (ada_value_primitive_field): Expand parameter OFFSET to LONGEST. Expand bit_pos to LONGEST. (find_struct_field): Expand parameters OFFSET and BYTE_OFFSET_P to LONGEST. Expand BIT_POS and FLD_OFFSET to LONGEST. (ada_search_struct_field): Expand parameter OFFSET to LONGEST. Expand VAR_OFFSET to LONGEST. (ada_index_struct_field): Expand parameters INDEX and OFFSET to LONGEST. (ada_index_struct_field_1): Expand parameters INDEX_P and OFFSET to LONGEST. (ada_value_struct_elt): Expand BYTE_OFFSET to LONGEST. (align_value): Return ULONGEST. Expand parameter OFF and ALIGNMENT to ULONGEST. (ada_template_to_fixed_record_type_1): Expand OFF, BIT_LEN and fld_bit_len to LONGEST. Expand FIELD_OFFSET to LONGEST. Use pulongest function to print TYPE_LENGTH. (to_fixed_array_type): Expand LEN to LONGEST. * ada-lang.h (ada_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. (ada_printstr): Expand parameter LENGTH to ULONGEST. (ada_value_primitive_packed_val): Expand parameter OFFSET to LONGEST. * ada-typeprint.c (ada_print_type): Use pulongest to print TYPE_LENGTH. * ada-valprint.c (val_print_packed_array_elements): Expand ELTLEN to ULONGEST. (char_at): Expand parameter I to LONGEST. (printstr): Expand parameter LENGTH, I, REP1, REPS to ULONGEST. Use pulongest to format print REPS. (ada_printstr): Expand parameter LENGTH to LONGEST. (ada_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. (ada_val_print_array): Expand ELTLEN, LEN to ULONGEST and TEMP_LEN to LONGEST. (ada_val_print_1): Expand parameter OFFSET to LONGEST. (print_variant_part): Expand parameters OFFSET and OUTER_OFFSET to LONGEST. (print_field_values): Likewise. Expand BIT_POS to LONGEST. * annotate.c (annotate_array_section_begin): Expand parameter IDX to LONGEST. Use plongest to format-print IDX. (annotate_elt_rep): Expand parameter REPCOUNT to ULONGEST. Use plongest to format-print REPCOUNT. * annotate.h: Likewise. * arm-linux-nat.c (arm_linux_region_ok_for_hw_watchpoint): Expand parameter parameter LEN to LONGEST. * ax-gdb.c (gen_left_shift): Expand parameter DISTANCE to LONGEST. (gen_offset): Expand parameter OFFSET to LONGEST. (gen_bitfield_ref): Expand parameters START, END to LONGEST. Expand BOUND_START, BOUND_END, OFFSET to LONGEST. (gen_primitive_field): Expand parameter OFFSET to LONGEST. (gen_struct_ref_recursive): Likewise. * ax-general.c (ax_trace_quick): Expand parameter N to LONGEST. * ax.h (ax_trace_quick): Likewise. * breakpoint.c (breakpoint_address_match_range): Expand parameter LEN1 to LONGEST. (can_use_hardware_watchpoint): Expand LEN to LONGEST. * breakpoint.h (struct bp_target_info): Expand member LENGTH to LONGEST. (struct bp_location): Likewise. * c-lang.c (c_printstr): Expand parameter LENGTH to ULONGEST. (evaluate_subexp_c): Expand ELEMENT_SIZE, I to LONGEST. * c-lang.h (c_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. (c_printstr): Expand parameter LENGTH to ULONGEST. (cp_print_value_fields): Expand parameter OFFSET to LONGEST. (cp_print_value_fields_rtti): Likewise. * c-typeprint.c (c_type_print_varspec_suffix): Remove cast down to int and use plongest to print LONGEST. * c-valprint.c (c_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. Expand OFFSET to LONGEST, ELTLEN to ULONGEST. (c_value_print): Expand TOP to LONGEST. * cp-abi.c (baseclass_offset): Return LONGEST. Expand parameter EMBEDDED_OFFSET to LONGEST. Expand RES to LONGEST. (value_virtual_fn_field): Expand parameter OFFSET to LONGEST. (value_rtti_type): Expand parameter TOP to point to LONGEST. * cp-abi.h (value_virtual_fn_field): Expand OFFSET to LONGEST. (value_rtti_type): Expand TOP to point to LONGEST. (baseclass_offset): Return LONGEST. Expand parameter EMBEDDED_OFFSET to LONGEST. (struct cp_abi_ops): Expand parameter OFFSET for VIRTUAL_FN_FIELD to LONGEST. Expand parameter TOP to point to LONGEST in VALUE_RTTI_TYPE. Return LONGEST from BASECLASS_OFFSET and expand parameter EMBEDDED_OFFSET to LONGEST. * cp-valprint.c (cp_print_value_fields): Expand parameter OFFSET to LONGEST. Expand I_OFFSET to LONGEST. (cp_print_value_fields_rtti): Expand parameter OFFSET to LONGEST. Expand TOP to LONGEST. (cp_print_value): Expand parameter OFFSET to LONGEST. Expand THISOFFSET, BOFFSET to LONGEST. * d-lang.h (d_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. * d-valprint.c (dynamic_array_type): Likewise. (d_val_print): Likewise. * doublest.c (floatformat_from_length): Expand parameter LEN to LONGEST. Use plongest to format string for LONGEST. * dwarf2loc.c (copy_bitwise): Expand parameters DEST_OFFSET_BITS, BIT_COUNT to ULONGEST. Rename parameter SOURCE_OFFSET_BITS to SOURCE_OFFSET and expand to ULONGEST. New variable SOURCE_OFFSET_BITS. (read_pieced_value): Expand OFFSET, DEST_OFFSET_BITS, SOURCE_OFFSET_BITS, SOURCE_OFFSET to LONGEST. Expand TYPE_LEN, THIS_SIZE, THIS_SIZE_BITS to ULONGEST. (write_pieced_value): Likewise. (check_pieced_value_bits): Expand parameters BIT_OFFSET and BIT_LENGTH to LONGEST. Expand THIS_SIZE_BITS to ULONGEST. (check_pieced_value_validity): Expand parameters BIT_OFFSET and BIT_LENGTH to LONGEST. (check_pieced_synthetic_pointer): Likewise. (indirect_pieced_value): Expand BIT_LENGTH, BYTE_OFFSET and BIT_OFFSET to LONGEST. (dwarf2_evaluate_loc_desc_full): Expand N to ULONGEST. * dwarf2read.c (dwarf2_const_value_length_mismatch_complaint): Expand parameters ARG2 and ARG3 to LONGEST. Use plongest to print ARG2 and ARG3. (dwarf2_add_field): Expand ANONYMOUS_SIZE, BIT_OFFSET to LONGEST. * eval.c (evaluate_struct_tuple): Expand BITPOS to LONGEST. (init_array_element): Expand ELEMENT_SIZE to LONGEST. (binop_promote): Expand PROMOTED_LEN1, PROMOTED_LEN2, RESULT_LEN to ULONGEST. (evaluate_subexp_standard): Expand MEM_OFFSET, TOP, ELEMENT_SIZE to LONGEST. * f-lang.c (f_printstr): Expand parameter LENGTH to ULONGEST. * f-lang.h (f_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. * f-valprint.c (f77_array_offset_tbl): Make LONGEST. (f77_create_arrayprint_offset_tbl): Expand ELTLEN to LONGEST. (f77_print_array_1): Expand parameter EMBEDDED_OFFSET to LONGEST. Expand I to LONGEST. (f77_print_array): Expand parameter EMBEDDED_OFFSET to LONGEST. (f_val_print): Likewise. Expand OFFSET to LONGEST. * findvar.c (default_value_from_register): Expand LEN to LONGEST. (read_frame_register_value): Expand OFFSET, REG_OFFSET, LEN, REG_LEN to LONGEST. * frame.c (get_frame_register_bytes): Expand parameter LEN to LONGEST. * frame.h (get_frame_register_bytes): Likewise. * gdbtypes.c (init_type): Expand parameter LENGTH to LONGEST. (is_unique_ancestor_worker): Expand parameters OFFSET, EMBEDDED_OFFSET to LONGEST. Expand THIS_OFFSET to LONGEST. (is_unique_ancestor): Expand OFFSET to LONGEST. (recursive_dump_type): Use pulongest to format print TYPE_LENGTH. Use plongest to format print TYPE_FIELD_BITPOS. (arch_type): Expand parameter LENGTH to LONGEST. * gdbtypes.h (struct type.main_type.fld_bnds.fields): Expand member BITPOS to LONGEST. (struct type): Expand member LENGTH to ULONGEST. (init_type): Expand parameter LENGTH to LONGEST. (arch_type): Likewise. * gnu-v2-abi.c (gnuv2_virtual_fn_field): Expand parameter OFFSET to LONGEST. (gnuv2_value_rtti_type): Expand parameter TOP to point to LONGEST. (gnuv2_baseclass_offset): Return LONGEST. Expand parameter EMBEDDED_OFFSET to LONGEST. Expand FIELD_OFFSET, BOFFSET, FIELD_LENGTH to LONGEST. * gnu-v3-abi.c (build_gdb_vtable_type): Expand OFFSET to LONGEST. (vtable_address_point_offset): Return LONGEST. (gnuv3_rtti_type): Expand parameter TOP_P to point to LONGEST. (gnuv3_virtual_fn_field): Expand parameter OFFSET to LONGEST. (gnuv3_baseclass_offset): Return LONGEST. Expand parameter EMBEDDED_OFSET to LONGEST. Expand CUR_BASE_OFFSET, BASE_OFFSET to LONGEST. (gnuv3_find_method_in): Expand POS to LONGEST. * go-lang.h (go_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. * go-valprint.c (print_go_string): Likewise. (go_val_print): Likewise. * i386-nat.c (i386_handle_nonaligned_watchpoint): Expand parameter LEN to LONGEST. (i386_region_ok_for_watchpoint): Likewise. * inf-ttrace.c (inf_ttrace_region_ok_for_hw_watchpoint): Expand parameter LEN to LONGEST. * jv-lang.c (java_link_class_type): Expand BOFFSET to LONGEST. (java_printstr): Expand parameter LENGTH to ULONGEST. * jv-lang.h (java_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. * jv-valprint.c (java_print_value_fields): Expand parameter OFFSET to LONGEST. (java_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. * language.c (unk_lang_printstr): Expand parameter LENGTH to ULONGEST. (unk_lang_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. * language.h (language_defn): Expand parameter LENGTH of LA_PRINTSTR to ULONGEST. Expand parameter EMBEDDED_OFFSET of LA_VAL_PRINT to LONGEST. * m2-lang.c (m2_printstr): Expand parameter LENGTH to ULONGEST. Expand I, REP1, REPS to ULONGEST. Use pulongest to format print REPS. * m2-lang.h (m2_val_print): Expand parameter embedded_offset to LONGEST. * m2-typeprint.c (m2_array): New variable VAL. Use pulongest to * format print VAL. (m2_enum): expand LASTVAL to LONGEST. * m2-valprint.c (m2_print_long_set): Expand parameter EMBEDDED_OFFSET to LONGEST. (m2_print_unbounded_array): Likewise. (m2_print_array_contents): Likewise. (m2_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. Expand I, LEN, TEMP_LEN to ULONGEST. * memrange.c (mem_ranges_overlap): Expand parameters LEN1, LEN2 to LONGEST. * memrange.h (struct mem_range): Expand member LENGTH to LONGEST. (mem_ranges_overlap): Expand parameters LEN1, LEN2 to LONGEST. * mips-linux-nat.c (mips_linux_region_ok_for_hw_watchpoint): Expand parameter LEN to LONGEST. * objc-lang.c (objc_printstr): Expand parameter LENGTH to ULONGEST. Expand I, REP1, REPS to ULONGEST. use pulongest to format print REPS. * opencl-lang.c (lookup_opencl_vector_type): Expand parameter EL_LENGTH to ULONGEST. Expand LENGTH to ULONGEST. (lval_func_read): Expand OFFSET, N, I, J and ELSIZE to LONGEST. (lval_func_write): Likewise. (lval_func_check_validity): Expand parameter LENGTH to LONGEST. Expand ELSIZE, START, END, I, STARTREST, ENDREST, COMP_OFFSET, COMP_LENGTH to LONGEST. (lval_func_check_any_valid): Expand ELSIZE to LONGEST. (lval_func_check_synthetic_pointer): Expand parameters OFFSET and LENGTH to LONGEST. Expand ELSIZE, START, END, I, STARTREST, ENDREST, COMP_LENGTH, COMP_OFFSET to LONGEST. * p-lang.c (is_pascal_string_type): Expand parameters LENGTH_POS, STRING_POS, LENGTH_SIZE to point to LONGEST. (pascal_printstr): Expand parameter LENGTH to ULONGEST. Expand I, REP1, REPS to ULONGEST. Use pulongest to format print REPS. * p-lang.h (pascal_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. (is_pascal_string_type): Expand parameters LENGTH_POS, STRING_POS, LENGTH_SIZE to point to LONGEST. (pascal_printstr): Expand parameter LENGTH to ULONGEST. (pascal_object_print_value_fields): Expand parameter OFFSET to LONGEST. * p-valprint.c (pascal_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. Expand ELTLEN to ULONGEST. Expand LENGTH_SIZE, LENGTH_POS, STRING_POS to LONGEST. (pascal_object_print_value_fields): Expand parameter OFFSET to LONGEST. (pascal_object_print_value): Likewise. Expand BOFFSET, THISOFFSET to LONGEST. * ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint): Expand parameter LEN to point to LONGEST. * printcmd.c (print_formatted): Expand LEN to LONGEST. (print_scalar_formatted): Likewise. * procfs.c (procfs_region_ok_for_hw_watchpoint): Expand parameter LEN to LONGEST. * python/py-prettyprint.c (apply_val_pretty_printer): Expand parameter EMBEDDED_OFFSET to LONGEST. * python/python.h (apply_val_pretty_printer): Likewise. * regcache.c (regcache_xfer_part): Expand parameter OFFSET to LONGEST. (regcache_raw_read_part): Likewise. (regcache_raw_write_part): Likewise. (regcache_cooked_read_part): Likewise. (regcache_cooked_write_part): Likewise. * regcache.h (regcache_raw_read_part): Likewise. (regcache_raw_write_part): Likewise. (regcache_cooked_read_part): Likewise. (regcache_cooked_write_part): Likewise. * remote.c (remote_region_ok_for_hw_watchpoint): Expand parameter LEN to LONGEST. * s390-nat.c (s390_region_ok_for_hw_watchpoint): Expand parameter LEN to LONGEST. * spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Expand parameter len to LONGEST. * stack.c (print_frame_nameless_args): Expand parameter START to LONGEST. (print_frame_args): Expand HIGHEST_OFFSET, CURRENT_OFFSET, ARG_SIZE, START to LONGEST. * symmisc.c (print_symbol): Expand I to ULONGEST. Use pulongest to format print TYPE_LENGTH. * target.c (default_region_ok_for_hw_watchpoint): Expand parameter LEN to LONGEST. (debug_to_region_ok_for_hw_watchpoint): Likewise. * target.h (struct target_ops): Expand parameter LEN to LONGEST for TO_REGION_OK_FOR_HW_WATCHPOINT. * tracepoint.c (add_memrange): Expand parameter LEN to LONGEST. Use plongest to format print LEN. (collect_symbol): Expand LEN to ULONGEST. Use pulongest to format print LEN. (scope_info): Expand J to LONGEST. Use pulongest to format print TYPE_LENGTH. * typeprint.c (whatis_exp): Expand TOP to LONGEST. * valarith.c (value_subscripted_rvalue): Expand parameters INDEX and LOWERBOUND to LONGEST. Expand ELT_SIZE, ELT_OFFS to ULONGEST. (value_concat): expand INVAL1LEN and INVAL2LEN to ssize_t. (value_logical_not): Expand LEN to LONGEST. (value_strcmp): Expand LEN1, LEN2, I, LEN to LONGEST. * valops.c (value_allocate_space_in_inferior): Expand parameter LEN to LONGEST. (value_cast_structs): Expand TOP to LONGEST. (value_cast): Expand ELEMENT_LENGTH to ULONGEST. Expand VAL_LENGTH to LONGEST. (dynamic_cast_check_1): Expand parameter EMBEDDED_OFFSET to LONGEST. Expand OFFSET to LONGEST. (dynamic_cast_check_2): Likewise. (value_dynamic_cast): Expand TOP to LONGEST. (read_value_memory): Expand EMBEDDED_OFFSET to LONGEST. (value_assign): Expand CHANGED_LEN, OFFSET to LONGEST. (value_array): Expand TYPELENGTH to ULONGEST. (update_search_result): Expand parameters LAST_BOFFSET, BOFFSET to LONGEST. (do_search_struct_field): Expand parameter OFFSET, LAST_BOFFSET to LONGEST. Expand NEW_OFFSET, BOFFSET to LONGEST. (search_struct_field): Expand parameter OFFSET to LONGEST. Expand BOFFSET to LONGEST. (search_struct_method): Expand parameter OFFSET to LONGEST. Expand BASE_OFFSET, THIS_OFFSET to LONGEST. (find_method_list): Expand parameters OFFSET, BOFFSET to LONGEST. Expand BASE_OFFSET to LONGEST. (value_find_oload_method_list): Expand parameter BOFFSET to point to LONGEST. (find_overload_match): Expand BOFFSET to LONGEST. (value_struct_elt_for_reference): Expand parameter OFFSET to LONGEST. Remove unneeded cast. Expand BASE_OFFSET to LONGEST. (value_rtti_indirect_type): Expand parameter TOP to point to LONGEST. (value_full_object): Expand parameter XTOP to LONGEST. Expand TOP to LONGEST. * valprint.c (valprint_check_validity): Expand parameter EMBEDDED_OFFSET to LONGEST. (generic_val_print): Likewise. (val_print): Likewise. (val_print_scalar_formatted): Likewise. (print_hex_chars): Expand parameter LEN to ULONGEST. (val_print_array_elements): Expand parameter EMBEDDED_OFFSET to LONGEST, I to ULONGEST. Expand LEN, ELTLEN, REP1, REPS to ULONGEST. Use pulongest to format print REPS. (generic_printstr): Expand parameter LENGTH to ULONGEST. * valprint.h (val_print_array_elements): Expand parameter EMBEDDED_OFFSET to LONGEST. (val_print_scalar_formatted): Likewise. (print_hex_chars): Expand parameter LEN to ULONGEST. (generic_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. (generic_printstr): Expand parameter LENGTH to ULONGEST. * value.c (struct range): Expand members OFFSET, LENGTH to LONGEST. (ranges_overlap): Expand parameters OFFSET1, OFFSET2, LEN1 AND LEN2 to LONGEST. (range_contain): Expand parameter OFFSET, LENGTH to LONGEST. (struct value): Expand members OFFSET, EMBEDDED_OFFSET, POINTED_TO_OFFSET to LONGEST. (value_bytes_available): Expand parameters OFFSET, LENGTH to LONGEST. (mark_value_bytes_unavailable): Likewise. (find_first_range_overlap): Likewise. (value_available_contents_eq): Expand parameters OFFSET1, OFFSET2 and LENGTH to LONGEST. (value_offset): Return LONGEST. (set_value_offset): Expand parameter OFFSET to LONGEST. (value_contents_copy_raw): Expand parameters SRC_OFFSET, DST_OFFSET, LENGTH to ssize_t. (value_contents_copy): Likewise. (value_bits_valid): Expand parameters OFFSET, LENGTH to LONGEST. (value_bits_synthetic_pointer): Likewise. (value_embedded_offset): Return LONGEST. (set_value_embedded_offset): Expand parameter VAL to LONGEST. (value_pointed_to_offset): Return LONGEST. (set_value_pointed_to_offset): Expand parameter VAL to LONGEST. (set_internalvar_component): Expand parameter OFFSET to LONGEST. (value_primitive_field): Likewise. Expand BITPOS, BOFFSET, CONTAINER_BITSIZE to LONGEST. (value_fn_field): Expand parameter OFFSET to LONGEST. (unpack_value_bits_as_long_1): Expand parameters EMBEDDED_OFFSET, BITPOS to LONGEST. Expand READ_OFFSET to LONGEST. (unpack_value_bits_as_long): Expand parameter EMBEDED_OFFSET to LONGEST. (unpack_value_field_as_long_1): Likewise. Expand BITPOS to LONGEST. (unpack_value_field_as_long): Expand parameter EMBEDDED_OFFSET to LONGEST. (value_field_bitfield): Likewise. (modify_field): Expand parameter BITPOS to LONGEST. Expand BYTESIZE to LONGEST. * value.h (value_offset): Return LONGEST. (set_value_offset): Expand parameter OFFSET to LONGEST. (value_pointed_to_offset): Return LONGEST. (set_value_pointed_to_offset): Expand parameter VAL to LONGEST. (value_embedded_offset): Return LONGEST. (set_value_embedded_offset): Expand parameter VAL to LONGEST. (struct lval_funcs): Expand parameters OFFSET and LENGTH to LONGEST for CHECK_VALIDITY. Likewise for CHECK_SYNTHETIC_POINTER. (valprint_check_validity): Expand parameter EMBEDDED_OFFSET to LONGEST. (value_bits_valid): Expand parameters OFFSET, LENGTH to LONGEST. (value_bits_synthetic_pointer): Likewise. (value_bytes_available): Likewise. (mark_value_bytes_unavailable): Likewise. (value_available_contents_eq): Fix comment. Expand parameters OFFSET1, OFFSET2, LENGTH to LONGEST. (read_value_memory): Expand parameter EMBEDDED_OFFSET to LONGEST. (unpack_value_bits_as_long): Expand parameter EMBEDDED_OFFSET to LONGEST. (unpack_value_field_as_long): Likewise. (value_field_bitfield): Likewise. (value_contents_copy_raw): Expand parameters SRC_OFFSET, DST_OFFSET, LENGTH to LONGEST. (value_contents_copy): Likewise. (value_primitive_field): Expand parameter OFFSET to LONGEST. (value_rtti_indirect_type): Expand parameter TOP to point to LONGEST. (value_full_object): Expand parameter XTOP to LONGEST. (set_internalvar_component): Expand parameter OFFSET to LONGEST. (value_fn_field): Expand parameter OFFSET to LONGEST. (modify_field): Expand parameter BITPOS to LONGEST. (val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. (value_allocate_space_in_inferior): Expand parameter LEN to LONGEST. gdb/testsuite/ChangeLog: 2012-08-05 Siddhesh Poyarekar <siddhesh@redhat.com> * gdb.base/longest-types.exp: Add test case to get offset of BUF2. --MP_/yp5f+W_ED2JtUlSyBi8xujr Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-main.patch
1 parent c2c7aee commit d04183a

85 files changed

Lines changed: 384 additions & 366 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gdb/aarch64-linux-nat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ aarch64_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len,
808808
/* Implement the "region_ok_for_hw_watchpoint" target_ops method. */
809809

810810
int
811-
aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
811+
aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
812812
{
813813
return aarch64_linux_region_ok_for_watchpoint (addr, len);
814814
}

gdb/ada-lang.c

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,21 @@ static struct type *desc_bounds_type (struct type *);
7878

7979
static struct value *desc_bounds (struct value *);
8080

81-
static int fat_pntr_bounds_bitpos (struct type *);
81+
static LONGEST fat_pntr_bounds_bitpos (struct type *);
8282

8383
static int fat_pntr_bounds_bitsize (struct type *);
8484

8585
static struct type *desc_data_target_type (struct type *);
8686

8787
static struct value *desc_data (struct value *);
8888

89-
static int fat_pntr_data_bitpos (struct type *);
89+
static LONGEST fat_pntr_data_bitpos (struct type *);
9090

9191
static int fat_pntr_data_bitsize (struct type *);
9292

9393
static struct value *desc_one_bound (struct value *, int, int);
9494

95-
static int desc_bound_bitpos (struct type *, int, int);
95+
static LONGEST desc_bound_bitpos (struct type *, int, int);
9696

9797
static int desc_bound_bitsize (struct type *, int, int);
9898

@@ -175,7 +175,7 @@ static struct type *static_unwrap_type (struct type *type);
175175

176176
static struct value *unwrap_value (struct value *);
177177

178-
static struct type *constrained_packed_array_type (struct type *, long *);
178+
static struct type *constrained_packed_array_type (struct type *, LONGEST *);
179179

180180
static struct type *decode_constrained_packed_array_type (struct type *);
181181

@@ -190,7 +190,8 @@ static int ada_is_unconstrained_packed_array_type (struct type *);
190190
static struct value *value_subscript_packed (struct value *, int,
191191
struct value **);
192192

193-
static void move_bits (gdb_byte *, int, const gdb_byte *, int, int, int);
193+
static void move_bits (gdb_byte *, int, const gdb_byte *, LONGEST, LONGEST,
194+
int);
194195

195196
static struct value *coerce_unspec_val_to_type (struct value *,
196197
struct type *);
@@ -216,14 +217,14 @@ static struct value *value_val_atr (struct type *, struct value *);
216217
static struct symbol *standard_lookup (const char *, const struct block *,
217218
domain_enum);
218219

219-
static struct value *ada_search_struct_field (const char *, struct value *, int,
220+
static struct value *ada_search_struct_field (const char *, struct value *, LONGEST,
220221
struct type *);
221222

222-
static struct value *ada_value_primitive_field (struct value *, int, int,
223+
static struct value *ada_value_primitive_field (struct value *, LONGEST, int,
223224
struct type *);
224225

225-
static int find_struct_field (const char *, struct type *, int,
226-
struct type **, int *, int *, int *, int *);
226+
static int find_struct_field (const char *, struct type *, LONGEST,
227+
struct type **, LONGEST *, int *, int *, int *);
227228

228229
static int ada_resolve_function (struct block_symbol *, int,
229230
struct value **, int, const char *,
@@ -234,7 +235,7 @@ static int ada_is_direct_array_type (struct type *);
234235
static void ada_language_arch_info (struct gdbarch *,
235236
struct language_arch_info *);
236237

237-
static struct value *ada_index_struct_field (int, struct value *, int,
238+
static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST,
238239
struct type *);
239240

240241
static struct value *assign_aggregate (struct value *, struct value *,
@@ -697,7 +698,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type)
697698
}
698699

699700
static const gdb_byte *
700-
cond_offset_host (const gdb_byte *valaddr, long offset)
701+
cond_offset_host (const gdb_byte *valaddr, LONGEST offset)
701702
{
702703
if (valaddr == NULL)
703704
return NULL;
@@ -706,7 +707,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset)
706707
}
707708

708709
static CORE_ADDR
709-
cond_offset_target (CORE_ADDR address, long offset)
710+
cond_offset_target (CORE_ADDR address, LONGEST offset)
710711
{
711712
if (address == 0)
712713
return 0;
@@ -1743,7 +1744,7 @@ desc_bounds (struct value *arr)
17431744
/* If TYPE is the type of an array-descriptor (fat pointer), the bit
17441745
position of the field containing the address of the bounds data. */
17451746

1746-
static int
1747+
static LONGEST
17471748
fat_pntr_bounds_bitpos (struct type *type)
17481749
{
17491750
return TYPE_FIELD_BITPOS (desc_base_type (type), 1);
@@ -1809,7 +1810,7 @@ desc_data (struct value *arr)
18091810
/* If TYPE is the type of an array-descriptor (fat pointer), the bit
18101811
position of the field containing the address of the data. */
18111812

1812-
static int
1813+
static LONGEST
18131814
fat_pntr_data_bitpos (struct type *type)
18141815
{
18151816
return TYPE_FIELD_BITPOS (desc_base_type (type), 0);
@@ -1844,7 +1845,7 @@ desc_one_bound (struct value *bounds, int i, int which)
18441845
of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
18451846
bound, if WHICH is 1. The first bound is I=1. */
18461847

1847-
static int
1848+
static LONGEST
18481849
desc_bound_bitpos (struct type *type, int i, int which)
18491850
{
18501851
return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2);
@@ -2034,7 +2035,7 @@ ada_type_of_array (struct value *arr, int bounds)
20342035
zero, and does not need to be recomputed. */
20352036
if (lo < hi)
20362037
{
2037-
int array_bitsize =
2038+
LONGEST array_bitsize =
20382039
(hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0);
20392040

20402041
TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8;
@@ -2194,7 +2195,7 @@ decode_packed_array_bitsize (struct type *type)
21942195
the length is arbitrary. */
21952196

21962197
static struct type *
2197-
constrained_packed_array_type (struct type *type, long *elt_bits)
2198+
constrained_packed_array_type (struct type *type, LONGEST *elt_bits)
21982199
{
21992200
struct type *new_elt_type;
22002201
struct type *new_type;
@@ -2248,7 +2249,7 @@ decode_constrained_packed_array_type (struct type *type)
22482249
char *name;
22492250
const char *tail;
22502251
struct type *shadow_type;
2251-
long bits;
2252+
LONGEST bits;
22522253

22532254
if (!raw_name)
22542255
raw_name = ada_type_name (desc_base_type (type));
@@ -2319,7 +2320,8 @@ decode_constrained_packed_array (struct value *arr)
23192320
array with no wrapper. In order to interpret the value through
23202321
the (left-justified) packed array type we just built, we must
23212322
first left-justify it. */
2322-
int bit_size, bit_pos;
2323+
int bit_size;
2324+
LONGEST bit_pos;
23232325
ULONGEST mod;
23242326

23252327
mod = ada_modulus (value_type (arr)) - 1;
@@ -2547,7 +2549,7 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size,
25472549

25482550
struct value *
25492551
ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
2550-
long offset, int bit_offset, int bit_size,
2552+
LONGEST offset, int bit_offset, int bit_size,
25512553
struct type *type)
25522554
{
25532555
struct value *v;
@@ -2617,7 +2619,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
26172619

26182620
if (obj != NULL)
26192621
{
2620-
long new_offset = offset;
2622+
LONGEST new_offset = offset;
26212623

26222624
set_value_component_location (v, obj);
26232625
set_value_bitpos (v, bit_offset + value_bitpos (obj));
@@ -2663,7 +2665,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
26632665
not overlap. */
26642666
static void
26652667
move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source,
2666-
int src_offset, int n, int bits_big_endian_p)
2668+
LONGEST src_offset, LONGEST n, int bits_big_endian_p)
26672669
{
26682670
unsigned int accum, mask;
26692671
int accum_bits, chunk_size;
@@ -2753,7 +2755,7 @@ ada_value_assign (struct value *toval, struct value *fromval)
27532755
{
27542756
int len = (value_bitpos (toval)
27552757
+ bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
2756-
int from_size;
2758+
LONGEST from_size;
27572759
gdb_byte *buffer = (gdb_byte *) alloca (len);
27582760
struct value *val;
27592761
CORE_ADDR to_addr = value_address (toval);
@@ -2804,7 +2806,7 @@ value_assign_to_component (struct value *container, struct value *component,
28042806
(LONGEST) (value_address (component) - value_address (container));
28052807
int bit_offset_in_container =
28062808
value_bitpos (component) - value_bitpos (container);
2807-
int bits;
2809+
LONGEST bits;
28082810

28092811
val = value_cast (value_type (component), val);
28102812

@@ -4462,7 +4464,7 @@ ensure_lval (struct value *val)
44624464
if (VALUE_LVAL (val) == not_lval
44634465
|| VALUE_LVAL (val) == lval_internalvar)
44644466
{
4465-
int len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
4467+
LONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
44664468
const CORE_ADDR addr =
44674469
value_as_long (value_allocate_space_in_inferior (len));
44684470

@@ -4546,7 +4548,7 @@ static CORE_ADDR
45464548
value_pointer (struct value *value, struct type *type)
45474549
{
45484550
struct gdbarch *gdbarch = get_type_arch (type);
4549-
unsigned len = TYPE_LENGTH (type);
4551+
ULONGEST len = TYPE_LENGTH (type);
45504552
gdb_byte *buf = (gdb_byte *) alloca (len);
45514553
CORE_ADDR addr;
45524554

@@ -6657,7 +6659,7 @@ value_tag_from_contents_and_address (struct type *type,
66576659
const gdb_byte *valaddr,
66586660
CORE_ADDR address)
66596661
{
6660-
int tag_byte_offset;
6662+
LONGEST tag_byte_offset;
66616663
struct type *tag_type;
66626664

66636665
if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
@@ -7150,7 +7152,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num)
71507152
only in that it can handle packed values of arbitrary type. */
71517153

71527154
static struct value *
7153-
ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
7155+
ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno,
71547156
struct type *arg_type)
71557157
{
71567158
struct type *type;
@@ -7162,7 +7164,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
71627164

71637165
if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0)
71647166
{
7165-
int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
7167+
LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
71667168
int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
71677169

71687170
return ada_value_primitive_packed_val (arg1, value_contents (arg1),
@@ -7239,9 +7241,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
72397241
Returns 1 if found, 0 otherwise. */
72407242

72417243
static int
7242-
find_struct_field (const char *name, struct type *type, int offset,
7244+
find_struct_field (const char *name, struct type *type, LONGEST offset,
72437245
struct type **field_type_p,
7244-
int *byte_offset_p, int *bit_offset_p, int *bit_size_p,
7246+
LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p,
72457247
int *index_p)
72467248
{
72477249
int i;
@@ -7260,8 +7262,8 @@ find_struct_field (const char *name, struct type *type, int offset,
72607262

72617263
for (i = 0; i < TYPE_NFIELDS (type); i += 1)
72627264
{
7263-
int bit_pos = TYPE_FIELD_BITPOS (type, i);
7264-
int fld_offset = offset + bit_pos / 8;
7265+
LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
7266+
LONGEST fld_offset = offset + bit_pos / 8;
72657267
const char *t_field_name = TYPE_FIELD_NAME (type, i);
72667268

72677269
if (t_field_name == NULL)
@@ -7363,7 +7365,7 @@ num_visible_fields (struct type *type)
73637365
long explanation in find_struct_field's function documentation. */
73647366

73657367
static struct value *
7366-
ada_search_struct_field (const char *name, struct value *arg, int offset,
7368+
ada_search_struct_field (const char *name, struct value *arg, LONGEST offset,
73677369
struct type *type)
73687370
{
73697371
int i;
@@ -7411,7 +7413,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset,
74117413
int j;
74127414
struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type,
74137415
i));
7414-
int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
7416+
LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
74157417

74167418
for (j = 0; j < TYPE_NFIELDS (field_type); j += 1)
74177419
{
@@ -7443,8 +7445,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset,
74437445
return NULL;
74447446
}
74457447

7446-
static struct value *ada_index_struct_field_1 (int *, struct value *,
7447-
int, struct type *);
7448+
static struct value *ada_index_struct_field_1 (LONGEST *, struct value *,
7449+
LONGEST, struct type *);
74487450

74497451

74507452
/* Return field #INDEX in ARG, where the index is that returned by
@@ -7453,7 +7455,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *,
74537455
* If found, return value, else return NULL. */
74547456

74557457
static struct value *
7456-
ada_index_struct_field (int index, struct value *arg, int offset,
7458+
ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset,
74577459
struct type *type)
74587460
{
74597461
return ada_index_struct_field_1 (&index, arg, offset, type);
@@ -7465,7 +7467,7 @@ ada_index_struct_field (int index, struct value *arg, int offset,
74657467
* *INDEX_P. */
74667468

74677469
static struct value *
7468-
ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
7470+
ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset,
74697471
struct type *type)
74707472
{
74717473
int i;
@@ -7555,7 +7557,8 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err)
75557557
v = ada_search_struct_field (name, arg, 0, t);
75567558
else
75577559
{
7558-
int bit_offset, bit_size, byte_offset;
7560+
int bit_offset, bit_size;
7561+
LONGEST byte_offset;
75597562
struct type *field_type;
75607563
CORE_ADDR address;
75617564

@@ -7899,8 +7902,8 @@ ada_coerce_ref (struct value *val0)
78997902
/* Return OFF rounded upward if necessary to a multiple of
79007903
ALIGNMENT (a power of 2). */
79017904

7902-
static unsigned int
7903-
align_value (unsigned int off, unsigned int alignment)
7905+
static ULONGEST
7906+
align_value (ULONGEST off, ULONGEST alignment)
79047907
{
79057908
return (off + alignment - 1) & ~(alignment - 1);
79067909
}
@@ -8290,10 +8293,9 @@ ada_template_to_fixed_record_type_1 (struct type *type,
82908293
struct value *mark = value_mark ();
82918294
struct value *dval;
82928295
struct type *rtype;
8293-
int nfields, bit_len;
8296+
int nfields;
82948297
int variant_field;
8295-
long off;
8296-
int fld_bit_len;
8298+
LONGEST off, bit_len, fld_bit_len;
82978299
int f;
82988300

82998301
/* Compute the number of fields in this record type that are going
@@ -8370,7 +8372,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
83708372
that follow this one. */
83718373
if (ada_is_aligner_type (field_type))
83728374
{
8373-
long field_offset = TYPE_FIELD_BITPOS (field_type, f);
8375+
LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f);
83748376

83758377
field_valaddr = cond_offset_host (field_valaddr, field_offset);
83768378
field_address = cond_offset_target (field_address, field_offset);
@@ -8506,11 +8508,11 @@ ada_template_to_fixed_record_type_1 (struct type *type,
85068508
if (TYPE_LENGTH (type) <= 0)
85078509
{
85088510
if (TYPE_NAME (rtype))
8509-
warning (_("Invalid type size for `%s' detected: %d."),
8510-
TYPE_NAME (rtype), TYPE_LENGTH (type));
8511+
warning (_("Invalid type size for `%s' detected: %s."),
8512+
TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type)));
85118513
else
8512-
warning (_("Invalid type size for <unnamed> detected: %d."),
8513-
TYPE_LENGTH (type));
8514+
warning (_("Invalid type size for <unnamed> detected: %s."),
8515+
pulongest (TYPE_LENGTH (type)));
85148516
}
85158517
else
85168518
{
@@ -8974,7 +8976,8 @@ to_fixed_array_type (struct type *type0, struct value *dval,
89748976
type was a regular (non-packed) array type. As a result, the
89758977
bitsize of the array elements needs to be set again, and the array
89768978
length needs to be recomputed based on that bitsize. */
8977-
int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result));
8979+
LONGEST len = (TYPE_LENGTH (result)
8980+
/ TYPE_LENGTH (TYPE_TARGET_TYPE (result)));
89788981
int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0);
89798982

89808983
TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0);

0 commit comments

Comments
 (0)