92b52c5
http://sourceware.org/ml/gdb-patches/2012-09/msg00631.html
92b52c5
Subject: [PATCH 1/4] Expand bitpos and type.length to LONGEST and ULONGEST
92b52c5
92b52c5
92b52c5
--MP_/yp5f+W_ED2JtUlSyBi8xujr
92b52c5
Content-Type: text/plain; charset=US-ASCII
92b52c5
Content-Transfer-Encoding: 7bit
92b52c5
Content-Disposition: inline
92b52c5
92b52c5
Hi,
92b52c5
92b52c5
This is patch 1/4, which implements the bulk of the changes in type
92b52c5
length and bitpos/type offset. I have verified that there are no
92b52c5
regressions resulting from this patch by running the testsuite on
92b52c5
Fedora 16 x86_64.  Patch and changelog attached.
92b52c5
92b52c5
Regards,
92b52c5
Siddhesh
92b52c5
92b52c5
--MP_/yp5f+W_ED2JtUlSyBi8xujr
92b52c5
Content-Type: text/plain
92b52c5
Content-Transfer-Encoding: quoted-printable
92b52c5
Content-Disposition: attachment; filename=ChangeLog-main
92b52c5
92b52c5
gdb/ChangeLog
92b52c5
92b52c5
2012-08-05  Siddhesh Poyarekar  <siddhesh@redhat.com>
92b52c5
92b52c5
	* ada-lang.c (fat_pntr_bounds_bitpos): Return LONGEST.
92b52c5
	(fat_pntr_data_bitpos): Likewise.
92b52c5
	(desc_bound_bitpos): Likewise.
92b52c5
	(constrained_packed_array_type): Expand ELT_BITS parameter to
92b52c5
	LONGEST.
92b52c5
	(move_bits): Expand parameters SRC_OFFSET and N to LONGEST.
92b52c5
	(cond_offset_host): Expand parameter OFFSET to LONGEST.
92b52c5
	(cond_offset_target): Likewise.
92b52c5
	(ada_type_of_array): Expand ARRAY_BITSIZE to LONGEST.
92b52c5
	(decode_constrained_packed_array_type): Expand BITS to LONGEST.
92b52c5
	(decode_constrained_packed_array): Expand BIT_POS to LONGEST.
92b52c5
	(ada_value_primitive_packed_val): Expand parameter OFFSET to
92b52c5
	LONGEST.  Expand TARG, NTARG and NEW_OFFSET to LONGEST.
92b52c5
	(ada_value_assign): Expand FROM_SIZE to LONGEST.
92b52c5
	(value_assign_to_component): Expand BITS to LONGEST.
92b52c5
	(ensure_lval): Expand LEN to LONGEST.
92b52c5
	(value_pointer): Expand LEN to ULONGEST.
92b52c5
	(value_tag_from_contents_and_address): Expand TAG_BYTE_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(ada_value_primitive_field): Expand parameter OFFSET to LONGEST.
92b52c5
	Expand bit_pos to LONGEST.
92b52c5
	(find_struct_field): Expand parameters OFFSET and BYTE_OFFSET_P to
92b52c5
	LONGEST.  Expand BIT_POS and FLD_OFFSET to LONGEST.
92b52c5
	(ada_search_struct_field): Expand parameter OFFSET to LONGEST.
92b52c5
	Expand VAR_OFFSET to LONGEST.
92b52c5
	(ada_index_struct_field): Expand parameters INDEX and OFFSET to
92b52c5
	LONGEST.
92b52c5
	(ada_index_struct_field_1): Expand parameters INDEX_P and OFFSET
92b52c5
	to LONGEST.
92b52c5
	(ada_value_struct_elt): Expand BYTE_OFFSET to LONGEST.
92b52c5
	(align_value): Return ULONGEST.  Expand parameter OFF and
92b52c5
	ALIGNMENT to ULONGEST.
92b52c5
	(ada_template_to_fixed_record_type_1): Expand OFF, BIT_LEN and
92b52c5
	fld_bit_len to LONGEST.  Expand FIELD_OFFSET to LONGEST.  Use
92b52c5
	pulongest function to print TYPE_LENGTH.
92b52c5
	(to_fixed_array_type): Expand LEN to LONGEST.
92b52c5
	* ada-lang.h (ada_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(ada_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	(ada_value_primitive_packed_val): Expand parameter OFFSET to
92b52c5
	LONGEST.
92b52c5
	* ada-typeprint.c (ada_print_type): Use pulongest to print
92b52c5
	TYPE_LENGTH.
92b52c5
	* ada-valprint.c (val_print_packed_array_elements): Expand ELTLEN
92b52c5
	to ULONGEST.
92b52c5
	(char_at): Expand parameter I to LONGEST.
92b52c5
	(printstr): Expand parameter LENGTH, I, REP1, REPS to ULONGEST.
92b52c5
	Use pulongest to format print REPS.
92b52c5
	(ada_printstr): Expand parameter LENGTH to LONGEST.
92b52c5
	(ada_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	(ada_val_print_array): Expand ELTLEN, LEN to ULONGEST and TEMP_LEN
92b52c5
	to LONGEST.
92b52c5
	(ada_val_print_1): Expand parameter OFFSET to LONGEST.
92b52c5
	(print_variant_part): Expand parameters OFFSET and OUTER_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(print_field_values): Likewise.  Expand BIT_POS to LONGEST.
92b52c5
	* annotate.c (annotate_array_section_begin): Expand parameter
92b52c5
	IDX to LONGEST.  Use plongest to format-print IDX.
92b52c5
	(annotate_elt_rep): Expand parameter REPCOUNT to ULONGEST.  Use
92b52c5
	plongest to format-print REPCOUNT.
92b52c5
	* annotate.h: Likewise.
92b52c5
	* arm-linux-nat.c (arm_linux_region_ok_for_hw_watchpoint):
92b52c5
	Expand parameter parameter LEN to LONGEST.
92b52c5
	* ax-gdb.c (gen_left_shift): Expand parameter DISTANCE to LONGEST.
92b52c5
	(gen_offset): Expand parameter OFFSET to LONGEST.
92b52c5
	(gen_bitfield_ref): Expand parameters START, END to LONGEST.
92b52c5
	Expand BOUND_START, BOUND_END, OFFSET to LONGEST.
92b52c5
	(gen_primitive_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(gen_struct_ref_recursive): Likewise.
92b52c5
	* ax-general.c (ax_trace_quick): Expand parameter N to LONGEST.
92b52c5
	* ax.h (ax_trace_quick): Likewise.
92b52c5
	* breakpoint.c (breakpoint_address_match_range): Expand parameter
92b52c5
	LEN1 to LONGEST.
92b52c5
	(can_use_hardware_watchpoint): Expand LEN to LONGEST.
92b52c5
	* breakpoint.h (struct bp_target_info): Expand member LENGTH to
92b52c5
	LONGEST.
92b52c5
	(struct bp_location): Likewise.
92b52c5
	* c-lang.c (c_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	(evaluate_subexp_c): Expand ELEMENT_SIZE, I to LONGEST.
92b52c5
	* c-lang.h (c_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(c_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	(cp_print_value_fields): Expand parameter OFFSET to LONGEST.
92b52c5
	(cp_print_value_fields_rtti): Likewise.
92b52c5
	* c-typeprint.c (c_type_print_varspec_suffix): Remove cast down to
92b52c5
	int and use plongest to print LONGEST.
92b52c5
	* c-valprint.c (c_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.  Expand OFFSET to LONGEST, ELTLEN to ULONGEST.
92b52c5
	(c_value_print): Expand TOP to LONGEST.
92b52c5
	* cp-abi.c (baseclass_offset): Return LONGEST.  Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.  Expand RES to LONGEST.
92b52c5
	(value_virtual_fn_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_rtti_type): Expand parameter TOP to point to LONGEST.
92b52c5
	* cp-abi.h (value_virtual_fn_field): Expand OFFSET to LONGEST.
92b52c5
	(value_rtti_type): Expand TOP to point to LONGEST.
92b52c5
	(baseclass_offset): Return LONGEST.  Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.
92b52c5
	(struct cp_abi_ops): Expand parameter OFFSET for VIRTUAL_FN_FIELD
92b52c5
	to LONGEST.  Expand parameter TOP to point to LONGEST in
92b52c5
	VALUE_RTTI_TYPE.  Return LONGEST from BASECLASS_OFFSET and expand
92b52c5
	parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	* cp-valprint.c (cp_print_value_fields): Expand parameter OFFSET
92b52c5
	to LONGEST.  Expand I_OFFSET to LONGEST.
92b52c5
	(cp_print_value_fields_rtti): Expand parameter OFFSET to
92b52c5
	LONGEST.  Expand TOP to LONGEST.
92b52c5
	(cp_print_value): Expand parameter OFFSET to LONGEST.  Expand
92b52c5
	THISOFFSET, BOFFSET to LONGEST.
92b52c5
	* d-lang.h (d_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	* d-valprint.c (dynamic_array_type): Likewise.
92b52c5
	(d_val_print): Likewise.
92b52c5
	* doublest.c (floatformat_from_length): Expand parameter LEN to
92b52c5
	LONGEST.  Use plongest to format string for LONGEST.
92b52c5
	* dwarf2loc.c (copy_bitwise): Expand parameters DEST_OFFSET_BITS,
92b52c5
	BIT_COUNT to ULONGEST.  Rename parameter SOURCE_OFFSET_BITS to
92b52c5
	SOURCE_OFFSET and expand to ULONGEST.  New variable
92b52c5
	SOURCE_OFFSET_BITS.
92b52c5
	(read_pieced_value): Expand OFFSET, DEST_OFFSET_BITS,
92b52c5
	SOURCE_OFFSET_BITS, SOURCE_OFFSET to LONGEST.  Expand TYPE_LEN,
92b52c5
	THIS_SIZE, THIS_SIZE_BITS to ULONGEST.
92b52c5
	(write_pieced_value): Likewise.
92b52c5
	(check_pieced_value_bits): Expand parameters BIT_OFFSET and
92b52c5
	BIT_LENGTH to LONGEST.  Expand THIS_SIZE_BITS to ULONGEST.
92b52c5
	(check_pieced_value_validity): Expand parameters BIT_OFFSET and
92b52c5
	BIT_LENGTH to LONGEST.
92b52c5
	(check_pieced_synthetic_pointer): Likewise.
92b52c5
	(indirect_pieced_value): Expand BIT_LENGTH, BYTE_OFFSET and
92b52c5
	BIT_OFFSET to LONGEST.
92b52c5
	(dwarf2_evaluate_loc_desc_full): Expand N to ULONGEST.
92b52c5
	* dwarf2read.c (dwarf2_const_value_length_mismatch_complaint):
92b52c5
	Expand parameters ARG2 and ARG3 to LONGEST.  Use plongest to
92b52c5
	print ARG2 and ARG3.
92b52c5
	(dwarf2_add_field): Expand ANONYMOUS_SIZE, BIT_OFFSET to
92b52c5
	LONGEST.
92b52c5
	* eval.c (evaluate_struct_tuple): Expand BITPOS to LONGEST.
92b52c5
	(init_array_element): Expand ELEMENT_SIZE to LONGEST.
92b52c5
	(binop_promote): Expand PROMOTED_LEN1, PROMOTED_LEN2, RESULT_LEN
92b52c5
	to ULONGEST.
92b52c5
	(evaluate_subexp_standard): Expand MEM_OFFSET, TOP, ELEMENT_SIZE
92b52c5
	to LONGEST.
92b52c5
	* f-lang.c (f_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	* f-lang.h (f_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	* f-valprint.c (f77_array_offset_tbl): Make LONGEST.
92b52c5
	(f77_create_arrayprint_offset_tbl): Expand ELTLEN to LONGEST.
92b52c5
	(f77_print_array_1): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.  Expand I to LONGEST.
92b52c5
	(f77_print_array): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	(f_val_print): Likewise.  Expand OFFSET to LONGEST.
92b52c5
	* findvar.c (default_value_from_register): Expand LEN to LONGEST.
92b52c5
	(read_frame_register_value): Expand OFFSET, REG_OFFSET, LEN,
92b52c5
	REG_LEN to LONGEST.
92b52c5
	* frame.c (get_frame_register_bytes): Expand parameter LEN to
92b52c5
	LONGEST.
92b52c5
	* frame.h (get_frame_register_bytes): Likewise.
92b52c5
	* gdbtypes.c (init_type): Expand parameter LENGTH to LONGEST.
92b52c5
	(is_unique_ancestor_worker): Expand parameters OFFSET,
92b52c5
	EMBEDDED_OFFSET to LONGEST.  Expand THIS_OFFSET to LONGEST.
92b52c5
	(is_unique_ancestor): Expand OFFSET to LONGEST.
92b52c5
	(recursive_dump_type): Use pulongest to format print TYPE_LENGTH.
92b52c5
	Use plongest to format print TYPE_FIELD_BITPOS.
92b52c5
	(arch_type): Expand parameter LENGTH to LONGEST.
92b52c5
	* gdbtypes.h (struct type.main_type.fld_bnds.fields): Expand
92b52c5
	member BITPOS to LONGEST.
92b52c5
	(struct type): Expand member LENGTH to ULONGEST.
92b52c5
	(init_type): Expand parameter LENGTH to LONGEST.
92b52c5
	(arch_type): Likewise.
92b52c5
	* gnu-v2-abi.c (gnuv2_virtual_fn_field): Expand parameter OFFSET
92b52c5
	to LONGEST.
92b52c5
	(gnuv2_value_rtti_type): Expand parameter TOP to point to LONGEST.
92b52c5
	(gnuv2_baseclass_offset): Return LONGEST.  Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.  Expand FIELD_OFFSET, BOFFSET,
92b52c5
	FIELD_LENGTH to LONGEST.
92b52c5
	* gnu-v3-abi.c (build_gdb_vtable_type): Expand OFFSET to LONGEST.
92b52c5
	(vtable_address_point_offset): Return LONGEST.
92b52c5
	(gnuv3_rtti_type): Expand parameter TOP_P to point to LONGEST.
92b52c5
	(gnuv3_virtual_fn_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(gnuv3_baseclass_offset): Return LONGEST.  Expand parameter
92b52c5
	EMBEDDED_OFSET to LONGEST.  Expand CUR_BASE_OFFSET, BASE_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(gnuv3_find_method_in): Expand POS to LONGEST.
92b52c5
	* go-lang.h (go_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	* go-valprint.c (print_go_string): Likewise.
92b52c5
	(go_val_print): Likewise.
92b52c5
	* i386-nat.c (i386_handle_nonaligned_watchpoint): Expand
92b52c5
	parameter LEN to LONGEST.
92b52c5
	(i386_region_ok_for_watchpoint): Likewise.
92b52c5
	* inf-ttrace.c (inf_ttrace_region_ok_for_hw_watchpoint): Expand
92b52c5
	parameter LEN to LONGEST.
92b52c5
	* jv-lang.c (java_link_class_type): Expand BOFFSET to LONGEST.
92b52c5
	(java_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	* jv-lang.h (java_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	* jv-valprint.c (java_print_value_fields): Expand parameter OFFSET
92b52c5
	to LONGEST.
92b52c5
	(java_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	* language.c (unk_lang_printstr): Expand parameter LENGTH to
92b52c5
	ULONGEST.
92b52c5
	(unk_lang_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	* language.h (language_defn): Expand parameter LENGTH of
92b52c5
	LA_PRINTSTR to ULONGEST.  Expand parameter EMBEDDED_OFFSET of
92b52c5
	LA_VAL_PRINT to LONGEST.
92b52c5
	* m2-lang.c (m2_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	Expand I, REP1, REPS to ULONGEST.  Use pulongest to format print
92b52c5
	REPS.
92b52c5
	* m2-lang.h (m2_val_print): Expand parameter embedded_offset to
92b52c5
	LONGEST.
92b52c5
	* m2-typeprint.c (m2_array): New variable VAL.  Use pulongest to
92b52c5
	* format print VAL.
92b52c5
	(m2_enum): expand LASTVAL to LONGEST.
92b52c5
	* m2-valprint.c (m2_print_long_set): Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.
92b52c5
	(m2_print_unbounded_array): Likewise.
92b52c5
	(m2_print_array_contents): Likewise.
92b52c5
	(m2_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	Expand I, LEN, TEMP_LEN to ULONGEST.
92b52c5
	* memrange.c (mem_ranges_overlap): Expand parameters LEN1, LEN2 to
92b52c5
	LONGEST.
92b52c5
	* memrange.h (struct mem_range): Expand member LENGTH to LONGEST.
92b52c5
	(mem_ranges_overlap): Expand parameters LEN1, LEN2 to LONGEST.
92b52c5
	* mips-linux-nat.c (mips_linux_region_ok_for_hw_watchpoint):
92b52c5
	Expand parameter LEN to LONGEST.
92b52c5
	* objc-lang.c (objc_printstr): Expand parameter LENGTH to
92b52c5
	ULONGEST.  Expand I, REP1, REPS to ULONGEST.  use pulongest to
92b52c5
	format print REPS.
92b52c5
	* opencl-lang.c (lookup_opencl_vector_type): Expand parameter
92b52c5
	EL_LENGTH to ULONGEST.  Expand LENGTH to ULONGEST.
92b52c5
	(lval_func_read): Expand OFFSET, N, I, J and ELSIZE to LONGEST.
92b52c5
	(lval_func_write): Likewise.
92b52c5
	(lval_func_check_validity): Expand parameter LENGTH to LONGEST.
92b52c5
	Expand ELSIZE, START, END, I, STARTREST, ENDREST, COMP_OFFSET,
92b52c5
	COMP_LENGTH to LONGEST.
92b52c5
	(lval_func_check_any_valid): Expand ELSIZE to LONGEST.
92b52c5
	(lval_func_check_synthetic_pointer): Expand parameters OFFSET and
92b52c5
	LENGTH to LONGEST.  Expand ELSIZE, START, END, I, STARTREST,
92b52c5
	ENDREST, COMP_LENGTH, COMP_OFFSET to LONGEST.
92b52c5
	* p-lang.c (is_pascal_string_type): Expand parameters LENGTH_POS,
92b52c5
	STRING_POS, LENGTH_SIZE to point to LONGEST.
92b52c5
	(pascal_printstr): Expand parameter LENGTH to ULONGEST.  Expand
92b52c5
	I, REP1, REPS to ULONGEST.  Use pulongest to format print REPS.
92b52c5
	* p-lang.h (pascal_val_print): Expand parameter EMBEDDED_OFFSET
92b52c5
	to LONGEST.
92b52c5
	(is_pascal_string_type): Expand parameters LENGTH_POS, STRING_POS,
92b52c5
	LENGTH_SIZE to point to LONGEST.
92b52c5
	(pascal_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	(pascal_object_print_value_fields): Expand parameter OFFSET to
92b52c5
	LONGEST.
92b52c5
	* p-valprint.c (pascal_val_print): Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.  Expand ELTLEN to ULONGEST.  Expand
92b52c5
	LENGTH_SIZE, LENGTH_POS, STRING_POS to LONGEST.
92b52c5
	(pascal_object_print_value_fields): Expand parameter OFFSET to
92b52c5
	LONGEST.
92b52c5
	(pascal_object_print_value): Likewise.  Expand BOFFSET,
92b52c5
	THISOFFSET to LONGEST.
92b52c5
	* ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint):
92b52c5
	Expand parameter LEN to point to LONGEST.
92b52c5
	* printcmd.c (print_formatted): Expand LEN to LONGEST.
92b52c5
	(print_scalar_formatted): Likewise.
92b52c5
	* procfs.c (procfs_region_ok_for_hw_watchpoint): Expand
92b52c5
	parameter LEN to LONGEST.
92b52c5
	* python/py-prettyprint.c (apply_val_pretty_printer): Expand
92b52c5
	parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	* python/python.h (apply_val_pretty_printer): Likewise.
92b52c5
	* regcache.c (regcache_xfer_part): Expand parameter OFFSET to
92b52c5
	LONGEST.
92b52c5
	(regcache_raw_read_part): Likewise.
92b52c5
	(regcache_raw_write_part): Likewise.
92b52c5
	(regcache_cooked_read_part): Likewise.
92b52c5
	(regcache_cooked_write_part): Likewise.
92b52c5
	* regcache.h (regcache_raw_read_part): Likewise.
92b52c5
	(regcache_raw_write_part): Likewise.
92b52c5
	(regcache_cooked_read_part): Likewise.
92b52c5
	(regcache_cooked_write_part): Likewise.
92b52c5
	* remote.c (remote_region_ok_for_hw_watchpoint): Expand
92b52c5
	parameter LEN to LONGEST.
92b52c5
	* s390-nat.c (s390_region_ok_for_hw_watchpoint): Expand
92b52c5
	parameter LEN to LONGEST.
92b52c5
	* spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Expand
92b52c5
	parameter len to LONGEST.
92b52c5
	* stack.c (print_frame_nameless_args): Expand parameter START to
92b52c5
	LONGEST.
92b52c5
	(print_frame_args): Expand HIGHEST_OFFSET, CURRENT_OFFSET,
92b52c5
	ARG_SIZE, START to LONGEST.
92b52c5
	* symmisc.c (print_symbol): Expand I to ULONGEST.  Use pulongest
92b52c5
	to format print TYPE_LENGTH.
92b52c5
	* target.c (default_region_ok_for_hw_watchpoint): Expand parameter
92b52c5
	LEN to LONGEST.
92b52c5
	(debug_to_region_ok_for_hw_watchpoint): Likewise.
92b52c5
	* target.h (struct target_ops): Expand parameter LEN to LONGEST
92b52c5
	for TO_REGION_OK_FOR_HW_WATCHPOINT.
92b52c5
	* tracepoint.c (add_memrange): Expand parameter LEN to LONGEST.
92b52c5
	Use plongest to format print LEN.
92b52c5
	(collect_symbol): Expand LEN to ULONGEST.  Use pulongest to
92b52c5
	format print LEN.
92b52c5
	(scope_info): Expand J to LONGEST.  Use pulongest to format
92b52c5
	print TYPE_LENGTH.
92b52c5
	* typeprint.c (whatis_exp): Expand TOP to LONGEST.
92b52c5
	* valarith.c (value_subscripted_rvalue): Expand parameters INDEX
92b52c5
	and LOWERBOUND to LONGEST.  Expand ELT_SIZE, ELT_OFFS to ULONGEST.
92b52c5
	(value_concat): expand INVAL1LEN and INVAL2LEN to ssize_t.
92b52c5
	(value_logical_not): Expand LEN to LONGEST.
92b52c5
	(value_strcmp): Expand LEN1, LEN2, I, LEN to LONGEST.
92b52c5
	* valops.c (value_allocate_space_in_inferior): Expand parameter
92b52c5
	LEN to LONGEST.
92b52c5
	(value_cast_structs): Expand TOP to LONGEST.
92b52c5
	(value_cast): Expand ELEMENT_LENGTH to ULONGEST.  Expand
92b52c5
	VAL_LENGTH to LONGEST.
92b52c5
	(dynamic_cast_check_1): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.  Expand OFFSET to LONGEST.
92b52c5
	(dynamic_cast_check_2): Likewise.
92b52c5
	(value_dynamic_cast): Expand TOP to LONGEST.
92b52c5
	(read_value_memory): Expand EMBEDDED_OFFSET to LONGEST.
92b52c5
	(value_assign): Expand CHANGED_LEN, OFFSET to LONGEST.
92b52c5
	(value_array): Expand TYPELENGTH to ULONGEST.
92b52c5
	(update_search_result): Expand parameters LAST_BOFFSET, BOFFSET
92b52c5
	to LONGEST.
92b52c5
	(do_search_struct_field): Expand parameter OFFSET, LAST_BOFFSET
92b52c5
	to LONGEST.  Expand NEW_OFFSET, BOFFSET to LONGEST.
92b52c5
	(search_struct_field): Expand parameter OFFSET to LONGEST.
92b52c5
	Expand BOFFSET to LONGEST.
92b52c5
	(search_struct_method): Expand parameter OFFSET to LONGEST.
92b52c5
	Expand BASE_OFFSET, THIS_OFFSET to LONGEST.
92b52c5
	(find_method_list): Expand parameters OFFSET, BOFFSET to
92b52c5
	LONGEST.  Expand BASE_OFFSET to LONGEST.
92b52c5
	(value_find_oload_method_list): Expand parameter BOFFSET to point
92b52c5
	to LONGEST.
92b52c5
	(find_overload_match): Expand BOFFSET to LONGEST.
92b52c5
	(value_struct_elt_for_reference): Expand parameter OFFSET to
92b52c5
	LONGEST.  Remove unneeded cast.  Expand BASE_OFFSET to LONGEST.
92b52c5
	(value_rtti_indirect_type): Expand parameter TOP to point to
92b52c5
	LONGEST.
92b52c5
	(value_full_object): Expand parameter XTOP to LONGEST.  Expand
92b52c5
	TOP to LONGEST.
92b52c5
	* valprint.c (valprint_check_validity): Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.
92b52c5
	(generic_val_print): Likewise.
92b52c5
	(val_print): Likewise.
92b52c5
	(val_print_scalar_formatted): Likewise.
92b52c5
	(print_hex_chars): Expand parameter LEN to ULONGEST.
92b52c5
	(val_print_array_elements): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST, I to ULONGEST.  Expand LEN, ELTLEN, REP1, REPS to
92b52c5
	ULONGEST.  Use pulongest to format print REPS.
92b52c5
	(generic_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	* valprint.h (val_print_array_elements): Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.
92b52c5
	(val_print_scalar_formatted): Likewise.
92b52c5
	(print_hex_chars): Expand parameter LEN to ULONGEST.
92b52c5
	(generic_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	(generic_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	* value.c (struct range): Expand members OFFSET, LENGTH to
92b52c5
	LONGEST.
92b52c5
	(ranges_overlap): Expand parameters OFFSET1, OFFSET2, LEN1 AND
92b52c5
	LEN2 to LONGEST.
92b52c5
	(range_contain): Expand parameter OFFSET, LENGTH to LONGEST.
92b52c5
	(struct value): Expand members OFFSET, EMBEDDED_OFFSET,
92b52c5
	POINTED_TO_OFFSET to LONGEST.
92b52c5
	(value_bytes_available): Expand parameters OFFSET, LENGTH to
92b52c5
	LONGEST.
92b52c5
	(mark_value_bytes_unavailable): Likewise.
92b52c5
	(find_first_range_overlap): Likewise.
92b52c5
	(value_available_contents_eq): Expand parameters OFFSET1, OFFSET2
92b52c5
	and LENGTH to LONGEST.
92b52c5
	(value_offset): Return LONGEST.
92b52c5
	(set_value_offset): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_contents_copy_raw): Expand parameters SRC_OFFSET,
92b52c5
	DST_OFFSET, LENGTH to ssize_t.
92b52c5
	(value_contents_copy): Likewise.
92b52c5
	(value_bits_valid): Expand parameters OFFSET, LENGTH to LONGEST.
92b52c5
	(value_bits_synthetic_pointer): Likewise.
92b52c5
	(value_embedded_offset): Return LONGEST.
92b52c5
	(set_value_embedded_offset): Expand parameter VAL to LONGEST.
92b52c5
	(value_pointed_to_offset): Return LONGEST.
92b52c5
	(set_value_pointed_to_offset): Expand parameter VAL to LONGEST.
92b52c5
	(set_internalvar_component): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_primitive_field): Likewise.  Expand BITPOS, BOFFSET,
92b52c5
	CONTAINER_BITSIZE to LONGEST.
92b52c5
	(value_fn_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(unpack_value_bits_as_long_1): Expand parameters EMBEDDED_OFFSET,
92b52c5
	BITPOS to LONGEST.  Expand READ_OFFSET to LONGEST.
92b52c5
	(unpack_value_bits_as_long): Expand parameter EMBEDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(unpack_value_field_as_long_1): Likewise.  Expand BITPOS to
92b52c5
	LONGEST.
92b52c5
	(unpack_value_field_as_long): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(value_field_bitfield): Likewise.
92b52c5
	(modify_field): Expand parameter BITPOS to LONGEST.  Expand
92b52c5
	BYTESIZE to LONGEST.
92b52c5
	* value.h (value_offset): Return LONGEST.
92b52c5
	(set_value_offset): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_pointed_to_offset): Return LONGEST.
92b52c5
	(set_value_pointed_to_offset): Expand parameter VAL to LONGEST.
92b52c5
	(value_embedded_offset): Return LONGEST.
92b52c5
	(set_value_embedded_offset): Expand parameter VAL to LONGEST.
92b52c5
	(struct lval_funcs): Expand parameters OFFSET and LENGTH to
92b52c5
	LONGEST for CHECK_VALIDITY.  Likewise for CHECK_SYNTHETIC_POINTER.
92b52c5
	(valprint_check_validity): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(value_bits_valid): Expand parameters OFFSET, LENGTH to LONGEST.
92b52c5
	(value_bits_synthetic_pointer): Likewise.
92b52c5
	(value_bytes_available): Likewise.
92b52c5
	(mark_value_bytes_unavailable): Likewise.
92b52c5
	(value_available_contents_eq): Fix comment.  Expand parameters
92b52c5
	OFFSET1, OFFSET2, LENGTH to LONGEST.
92b52c5
	(read_value_memory): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(unpack_value_bits_as_long): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(unpack_value_field_as_long): Likewise.
92b52c5
	(value_field_bitfield): Likewise.
92b52c5
	(value_contents_copy_raw): Expand parameters SRC_OFFSET,
92b52c5
	DST_OFFSET, LENGTH to LONGEST.
92b52c5
	(value_contents_copy): Likewise.
92b52c5
	(value_primitive_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_rtti_indirect_type): Expand parameter TOP to point to
92b52c5
	LONGEST.
92b52c5
	(value_full_object): Expand parameter XTOP to LONGEST.
92b52c5
	(set_internalvar_component): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_fn_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(modify_field): Expand parameter BITPOS to LONGEST.
92b52c5
	(val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	(value_allocate_space_in_inferior): Expand parameter LEN to
92b52c5
	LONGEST.
92b52c5
92b52c5
gdb/testsuite/ChangeLog:
92b52c5
92b52c5
2012-08-05  Siddhesh Poyarekar  <siddhesh@redhat.com>
92b52c5
92b52c5
	* gdb.base/longest-types.exp: Add test case to get offset of
92b52c5
	BUF2.
92b52c5
92b52c5
--MP_/yp5f+W_ED2JtUlSyBi8xujr
92b52c5
Content-Type: text/x-patch
92b52c5
Content-Transfer-Encoding: 7bit
92b52c5
Content-Disposition: attachment; filename=bitpos-main.patch
92b52c5
7306e88
Index: gdb-7.11.50.20160716/gdb/ada-lang.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/ada-lang.c	2016-07-16 14:33:42.053510117 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/ada-lang.c	2016-07-16 14:33:44.527530028 +0200
7306e88
@@ -75,7 +75,7 @@
92b52c5
 
92b52c5
 static struct value *desc_bounds (struct value *);
92b52c5
 
92b52c5
-static int fat_pntr_bounds_bitpos (struct type *);
92b52c5
+static LONGEST fat_pntr_bounds_bitpos (struct type *);
92b52c5
 
92b52c5
 static int fat_pntr_bounds_bitsize (struct type *);
92b52c5
 
7306e88
@@ -83,13 +83,13 @@
92b52c5
 
92b52c5
 static struct value *desc_data (struct value *);
92b52c5
 
92b52c5
-static int fat_pntr_data_bitpos (struct type *);
92b52c5
+static LONGEST fat_pntr_data_bitpos (struct type *);
92b52c5
 
92b52c5
 static int fat_pntr_data_bitsize (struct type *);
92b52c5
 
92b52c5
 static struct value *desc_one_bound (struct value *, int, int);
92b52c5
 
92b52c5
-static int desc_bound_bitpos (struct type *, int, int);
92b52c5
+static LONGEST desc_bound_bitpos (struct type *, int, int);
92b52c5
 
92b52c5
 static int desc_bound_bitsize (struct type *, int, int);
92b52c5
 
7306e88
@@ -172,7 +172,7 @@
92b52c5
 
92b52c5
 static struct value *unwrap_value (struct value *);
92b52c5
 
92b52c5
-static struct type *constrained_packed_array_type (struct type *, long *);
92b52c5
+static struct type *constrained_packed_array_type (struct type *, LONGEST *);
92b52c5
 
92b52c5
 static struct type *decode_constrained_packed_array_type (struct type *);
92b52c5
 
7306e88
@@ -187,7 +187,8 @@
92b52c5
 static struct value *value_subscript_packed (struct value *, int,
92b52c5
                                              struct value **);
92b52c5
 
92b52c5
-static void move_bits (gdb_byte *, int, const gdb_byte *, int, int, int);
92b52c5
+static void move_bits (gdb_byte *, int, const gdb_byte *, LONGEST, LONGEST,
92b52c5
+		       int);
92b52c5
 
92b52c5
 static struct value *coerce_unspec_val_to_type (struct value *,
92b52c5
                                                 struct type *);
7306e88
@@ -215,14 +216,14 @@
92b52c5
 static struct symbol *standard_lookup (const char *, const struct block *,
92b52c5
                                        domain_enum);
92b52c5
 
23f398e
-static struct value *ada_search_struct_field (const char *, struct value *, int,
23f398e
+static struct value *ada_search_struct_field (const char *, struct value *, LONGEST,
92b52c5
                                               struct type *);
92b52c5
 
92b52c5
-static struct value *ada_value_primitive_field (struct value *, int, int,
92b52c5
+static struct value *ada_value_primitive_field (struct value *, LONGEST, int,
92b52c5
                                                 struct type *);
92b52c5
 
92b52c5
-static int find_struct_field (const char *, struct type *, int,
92b52c5
-                              struct type **, int *, int *, int *, int *);
92b52c5
+static int find_struct_field (const char *, struct type *, LONGEST,
23f398e
+                              struct type **, LONGEST *, int *, int *, int *);
92b52c5
 
92b52c5
 static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR,
92b52c5
                                                 struct value *);
7306e88
@@ -236,7 +237,7 @@
2f7f533
 static void ada_language_arch_info (struct gdbarch *,
2f7f533
 				    struct language_arch_info *);
92b52c5
 
92b52c5
-static struct value *ada_index_struct_field (int, struct value *, int,
92b52c5
+static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST,
92b52c5
 					     struct type *);
92b52c5
 
92b52c5
 static struct value *assign_aggregate (struct value *, struct value *, 
7306e88
@@ -700,7 +701,7 @@
92b52c5
 }
92b52c5
 
92b52c5
 static const gdb_byte *
92b52c5
-cond_offset_host (const gdb_byte *valaddr, long offset)
92b52c5
+cond_offset_host (const gdb_byte *valaddr, LONGEST offset)
92b52c5
 {
92b52c5
   if (valaddr == NULL)
92b52c5
     return NULL;
7306e88
@@ -709,7 +710,7 @@
92b52c5
 }
92b52c5
 
92b52c5
 static CORE_ADDR
92b52c5
-cond_offset_target (CORE_ADDR address, long offset)
92b52c5
+cond_offset_target (CORE_ADDR address, LONGEST offset)
92b52c5
 {
92b52c5
   if (address == 0)
92b52c5
     return 0;
7306e88
@@ -1756,7 +1757,7 @@
92b52c5
 /* If TYPE is the type of an array-descriptor (fat pointer),  the bit
92b52c5
    position of the field containing the address of the bounds data.  */
92b52c5
 
92b52c5
-static int
92b52c5
+static LONGEST
92b52c5
 fat_pntr_bounds_bitpos (struct type *type)
92b52c5
 {
92b52c5
   return TYPE_FIELD_BITPOS (desc_base_type (type), 1);
7306e88
@@ -1822,7 +1823,7 @@
92b52c5
 /* If TYPE is the type of an array-descriptor (fat pointer), the bit
92b52c5
    position of the field containing the address of the data.  */
92b52c5
 
92b52c5
-static int
92b52c5
+static LONGEST
92b52c5
 fat_pntr_data_bitpos (struct type *type)
92b52c5
 {
92b52c5
   return TYPE_FIELD_BITPOS (desc_base_type (type), 0);
7306e88
@@ -1857,7 +1858,7 @@
92b52c5
    of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
92b52c5
    bound, if WHICH is 1.  The first bound is I=1.  */
92b52c5
 
92b52c5
-static int
92b52c5
+static LONGEST
92b52c5
 desc_bound_bitpos (struct type *type, int i, int which)
92b52c5
 {
92b52c5
   return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2);
7306e88
@@ -2047,7 +2048,7 @@
92b52c5
 	         zero, and does not need to be recomputed.  */
92b52c5
 	      if (lo < hi)
92b52c5
 		{
92b52c5
-		  int array_bitsize =
92b52c5
+		  LONGEST array_bitsize =
92b52c5
 		        (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0);
92b52c5
 
92b52c5
 		  TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8;
7306e88
@@ -2207,7 +2208,7 @@
2f7f533
    the length is arbitrary.  */
92b52c5
 
92b52c5
 static struct type *
92b52c5
-constrained_packed_array_type (struct type *type, long *elt_bits)
92b52c5
+constrained_packed_array_type (struct type *type, LONGEST *elt_bits)
92b52c5
 {
92b52c5
   struct type *new_elt_type;
92b52c5
   struct type *new_type;
7306e88
@@ -2261,7 +2262,7 @@
92b52c5
   char *name;
92b52c5
   const char *tail;
92b52c5
   struct type *shadow_type;
92b52c5
-  long bits;
92b52c5
+  LONGEST bits;
92b52c5
 
92b52c5
   if (!raw_name)
92b52c5
     raw_name = ada_type_name (desc_base_type (type));
7306e88
@@ -2332,7 +2333,8 @@
92b52c5
  	 array with no wrapper.  In order to interpret the value through
92b52c5
  	 the (left-justified) packed array type we just built, we must
92b52c5
  	 first left-justify it.  */
92b52c5
-      int bit_size, bit_pos;
92b52c5
+      int bit_size;
92b52c5
+      LONGEST bit_pos;
92b52c5
       ULONGEST mod;
92b52c5
 
92b52c5
       mod = ada_modulus (value_type (arr)) - 1;
7306e88
@@ -2560,7 +2562,7 @@
92b52c5
 
92b52c5
 struct value *
92b52c5
 ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
92b52c5
-				long offset, int bit_offset, int bit_size,
92b52c5
+				LONGEST offset, int bit_offset, int bit_size,
92b52c5
                                 struct type *type)
92b52c5
 {
92b52c5
   struct value *v;
7306e88
@@ -2633,7 +2635,7 @@
92b52c5
 
92b52c5
   if (obj != NULL)
92b52c5
     {
92b52c5
-      long new_offset = offset;
92b52c5
+      LONGEST new_offset = offset;
92b52c5
 
92b52c5
       set_value_component_location (v, obj);
92b52c5
       set_value_bitpos (v, bit_offset + value_bitpos (obj));
7306e88
@@ -2681,7 +2683,7 @@
92b52c5
    not overlap.  */
92b52c5
 static void
92b52c5
 move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source,
92b52c5
-	   int src_offset, int n, int bits_big_endian_p)
92b52c5
+	   LONGEST src_offset, LONGEST n, int bits_big_endian_p)
92b52c5
 {
92b52c5
   unsigned int accum, mask;
92b52c5
   int accum_bits, chunk_size;
7306e88
@@ -2771,7 +2773,7 @@
92b52c5
     {
92b52c5
       int len = (value_bitpos (toval)
92b52c5
 		 + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
92b52c5
-      int from_size;
92b52c5
+      LONGEST from_size;
23f398e
       gdb_byte *buffer = (gdb_byte *) alloca (len);
92b52c5
       struct value *val;
92b52c5
       CORE_ADDR to_addr = value_address (toval);
7306e88
@@ -2822,7 +2824,7 @@
92b52c5
     (LONGEST)  (value_address (component) - value_address (container));
32f92b2
   int bit_offset_in_container =
92b52c5
     value_bitpos (component) - value_bitpos (container);
92b52c5
-  int bits;
92b52c5
+  LONGEST bits;
32f92b2
 
92b52c5
   val = value_cast (value_type (component), val);
92b52c5
 
7306e88
@@ -4480,7 +4482,7 @@
92b52c5
   if (VALUE_LVAL (val) == not_lval
92b52c5
       || VALUE_LVAL (val) == lval_internalvar)
92b52c5
     {
92b52c5
-      int len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
92b52c5
+      LONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
92b52c5
       const CORE_ADDR addr =
92b52c5
         value_as_long (value_allocate_space_in_inferior (len));
92b52c5
 
7306e88
@@ -4564,7 +4566,7 @@
92b52c5
 value_pointer (struct value *value, struct type *type)
92b52c5
 {
92b52c5
   struct gdbarch *gdbarch = get_type_arch (type);
92b52c5
-  unsigned len = TYPE_LENGTH (type);
92b52c5
+  ULONGEST len = TYPE_LENGTH (type);
23f398e
   gdb_byte *buf = (gdb_byte *) alloca (len);
92b52c5
   CORE_ADDR addr;
92b52c5
 
7306e88
@@ -6799,7 +6801,7 @@
92b52c5
 				     const gdb_byte *valaddr,
92b52c5
                                      CORE_ADDR address)
92b52c5
 {
92b52c5
-  int tag_byte_offset;
92b52c5
+  LONGEST tag_byte_offset;
92b52c5
   struct type *tag_type;
92b52c5
 
92b52c5
   if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
7306e88
@@ -7280,7 +7282,7 @@
92b52c5
    only in that it can handle packed values of arbitrary type.  */
92b52c5
 
92b52c5
 static struct value *
92b52c5
-ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
92b52c5
+ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno,
92b52c5
                            struct type *arg_type)
92b52c5
 {
92b52c5
   struct type *type;
7306e88
@@ -7292,7 +7294,7 @@
92b52c5
 
92b52c5
   if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0)
92b52c5
     {
92b52c5
-      int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
92b52c5
+      LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
92b52c5
       int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
92b52c5
 
92b52c5
       return ada_value_primitive_packed_val (arg1, value_contents (arg1),
7306e88
@@ -7319,9 +7321,9 @@
92b52c5
    Returns 1 if found, 0 otherwise.  */
92b52c5
 
92b52c5
 static int
92b52c5
-find_struct_field (const char *name, struct type *type, int offset,
92b52c5
+find_struct_field (const char *name, struct type *type, LONGEST offset,
92b52c5
                    struct type **field_type_p,
92b52c5
-                   int *byte_offset_p, int *bit_offset_p, int *bit_size_p,
92b52c5
+		   LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p,
92b52c5
 		   int *index_p)
92b52c5
 {
92b52c5
   int i;
7306e88
@@ -7339,8 +7341,8 @@
92b52c5
 
92b52c5
   for (i = 0; i < TYPE_NFIELDS (type); i += 1)
92b52c5
     {
92b52c5
-      int bit_pos = TYPE_FIELD_BITPOS (type, i);
92b52c5
-      int fld_offset = offset + bit_pos / 8;
92b52c5
+      LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
92b52c5
+      LONGEST fld_offset = offset + bit_pos / 8;
92b52c5
       const char *t_field_name = TYPE_FIELD_NAME (type, i);
92b52c5
 
92b52c5
       if (t_field_name == NULL)
7306e88
@@ -7410,7 +7412,7 @@
92b52c5
    Searches recursively through wrapper fields (e.g., '_parent').  */
92b52c5
 
92b52c5
 static struct value *
23f398e
-ada_search_struct_field (const char *name, struct value *arg, int offset,
23f398e
+ada_search_struct_field (const char *name, struct value *arg, LONGEST offset,
92b52c5
                          struct type *type)
92b52c5
 {
92b52c5
   int i;
7306e88
@@ -7443,7 +7445,7 @@
92b52c5
           int j;
92b52c5
           struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type,
92b52c5
 									i));
92b52c5
-          int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
92b52c5
+	  LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
92b52c5
 
92b52c5
           for (j = 0; j < TYPE_NFIELDS (field_type); j += 1)
92b52c5
             {
7306e88
@@ -7461,8 +7463,8 @@
92b52c5
   return NULL;
92b52c5
 }
92b52c5
 
92b52c5
-static struct value *ada_index_struct_field_1 (int *, struct value *,
92b52c5
-					       int, struct type *);
92b52c5
+static struct value *ada_index_struct_field_1 (LONGEST *, struct value *,
92b52c5
+					       LONGEST, struct type *);
92b52c5
 
92b52c5
 
92b52c5
 /* Return field #INDEX in ARG, where the index is that returned by
7306e88
@@ -7471,7 +7473,7 @@
92b52c5
  * If found, return value, else return NULL.  */
92b52c5
 
92b52c5
 static struct value *
92b52c5
-ada_index_struct_field (int index, struct value *arg, int offset,
92b52c5
+ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset,
92b52c5
 			struct type *type)
92b52c5
 {
92b52c5
   return ada_index_struct_field_1 (&index, arg, offset, type);
7306e88
@@ -7483,7 +7485,7 @@
92b52c5
  * *INDEX_P.  */
92b52c5
 
92b52c5
 static struct value *
92b52c5
-ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
92b52c5
+ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset,
92b52c5
 			  struct type *type)
92b52c5
 {
92b52c5
   int i;
7306e88
@@ -7573,7 +7575,8 @@
92b52c5
     v = ada_search_struct_field (name, arg, 0, t);
92b52c5
   else
92b52c5
     {
92b52c5
-      int bit_offset, bit_size, byte_offset;
92b52c5
+      int bit_offset, bit_size;
92b52c5
+      LONGEST byte_offset;
92b52c5
       struct type *field_type;
92b52c5
       CORE_ADDR address;
92b52c5
 
7306e88
@@ -7904,8 +7907,8 @@
92b52c5
 /* Return OFF rounded upward if necessary to a multiple of
92b52c5
    ALIGNMENT (a power of 2).  */
92b52c5
 
92b52c5
-static unsigned int
92b52c5
-align_value (unsigned int off, unsigned int alignment)
92b52c5
+static ULONGEST
92b52c5
+align_value (ULONGEST off, ULONGEST alignment)
92b52c5
 {
92b52c5
   return (off + alignment - 1) & ~(alignment - 1);
92b52c5
 }
7306e88
@@ -8299,10 +8302,9 @@
92b52c5
   struct value *mark = value_mark ();
92b52c5
   struct value *dval;
92b52c5
   struct type *rtype;
92b52c5
-  int nfields, bit_len;
92b52c5
+  int nfields;
92b52c5
   int variant_field;
92b52c5
-  long off;
92b52c5
-  int fld_bit_len;
92b52c5
+  LONGEST off, bit_len, fld_bit_len;
92b52c5
   int f;
92b52c5
 
92b52c5
   /* Compute the number of fields in this record type that are going
7306e88
@@ -8380,7 +8382,7 @@
92b52c5
 	     that follow this one.  */
92b52c5
 	  if (ada_is_aligner_type (field_type))
92b52c5
 	    {
92b52c5
-	      long field_offset = TYPE_FIELD_BITPOS (field_type, f);
92b52c5
+	      LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f);
92b52c5
 
92b52c5
 	      field_valaddr = cond_offset_host (field_valaddr, field_offset);
92b52c5
 	      field_address = cond_offset_target (field_address, field_offset);
7306e88
@@ -8516,11 +8518,11 @@
92b52c5
   if (TYPE_LENGTH (type) <= 0)
92b52c5
     {
92b52c5
       if (TYPE_NAME (rtype))
92b52c5
-	warning (_("Invalid type size for `%s' detected: %d."),
92b52c5
-		 TYPE_NAME (rtype), TYPE_LENGTH (type));
92b52c5
+	warning (_("Invalid type size for `%s' detected: %s."),
92b52c5
+		 TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type)));
92b52c5
       else
92b52c5
-	warning (_("Invalid type size for <unnamed> detected: %d."),
92b52c5
-		 TYPE_LENGTH (type));
92b52c5
+	warning (_("Invalid type size for <unnamed> detected: %s."),
92b52c5
+		 pulongest (TYPE_LENGTH (type)));
92b52c5
     }
92b52c5
   else
92b52c5
     {
7306e88
@@ -8987,7 +8989,8 @@
92b52c5
 	 type was a regular (non-packed) array type.  As a result, the
92b52c5
 	 bitsize of the array elements needs to be set again, and the array
92b52c5
 	 length needs to be recomputed based on that bitsize.  */
92b52c5
-      int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result));
92b52c5
+      LONGEST len = (TYPE_LENGTH (result)
92b52c5
+		     / TYPE_LENGTH (TYPE_TARGET_TYPE (result)));
92b52c5
       int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0);
92b52c5
 
92b52c5
       TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0);
7306e88
Index: gdb-7.11.50.20160716/gdb/ada-lang.h
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/ada-lang.h	2016-07-16 14:33:42.054510125 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/ada-lang.h	2016-07-16 14:33:44.528530036 +0200
7306e88
@@ -168,7 +168,7 @@
92b52c5
 extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
92b52c5
 			       struct ui_file *stream);
92b52c5
 
92b52c5
-extern void ada_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
92b52c5
+extern void ada_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR,
92b52c5
 			   struct ui_file *, int,
92b52c5
 			   const struct value *,
92b52c5
 			   const struct value_print_options *);
7306e88
@@ -183,7 +183,7 @@
92b52c5
 extern void ada_printchar (int, struct type *, struct ui_file *);
92b52c5
 
92b52c5
 extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *,
92b52c5
-			  unsigned int, const char *, int,
92b52c5
+			  ULONGEST, const char *, int,
92b52c5
 			  const struct value_print_options *);
92b52c5
 
92b52c5
 struct value *ada_convert_actual (struct value *actual,
7306e88
@@ -255,7 +255,7 @@
92b52c5
 
92b52c5
 extern struct value *ada_value_primitive_packed_val (struct value *,
92b52c5
 						     const gdb_byte *,
92b52c5
-                                                     long, int, int,
92b52c5
+						     LONGEST, int, int,
92b52c5
                                                      struct type *);
92b52c5
 
92b52c5
 extern struct type *ada_coerce_to_simple_array_type (struct type *);
7306e88
Index: gdb-7.11.50.20160716/gdb/ada-typeprint.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/ada-typeprint.c	2016-07-16 14:33:42.055510133 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/ada-typeprint.c	2016-07-16 14:33:44.528530036 +0200
7306e88
@@ -891,8 +891,8 @@
92b52c5
 	    const char *name = ada_type_name (type);
92b52c5
 
92b52c5
 	    if (!ada_is_range_type_name (name))
92b52c5
-	      fprintf_filtered (stream, _("<%d-byte integer>"),
92b52c5
-				TYPE_LENGTH (type));
92b52c5
+	      fprintf_filtered (stream, _("<%s-byte integer>"),
92b52c5
+				pulongest (TYPE_LENGTH (type)));
92b52c5
 	    else
92b52c5
 	      {
92b52c5
 		fprintf_filtered (stream, "range ");
7306e88
@@ -913,7 +913,8 @@
92b52c5
 	  }
92b52c5
 	break;
92b52c5
       case TYPE_CODE_FLT:
92b52c5
-	fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type));
92b52c5
+	fprintf_filtered (stream, _("<%s-byte float>"),
92b52c5
+			  pulongest (TYPE_LENGTH (type)));
92b52c5
 	break;
92b52c5
       case TYPE_CODE_ENUM:
92b52c5
 	if (show < 0)
7306e88
Index: gdb-7.11.50.20160716/gdb/ada-valprint.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/ada-valprint.c	2016-07-16 14:33:42.056510141 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/ada-valprint.c	2016-07-16 14:33:44.528530036 +0200
2f7f533
@@ -33,11 +33,11 @@
2c55a54
 #include "objfiles.h"
92b52c5
 
92b52c5
 static int print_field_values (struct type *, const gdb_byte *,
92b52c5
-			       int,
92b52c5
+			       LONGEST,
92b52c5
 			       struct ui_file *, int,
92b52c5
 			       const struct value *,
92b52c5
 			       const struct value_print_options *,
2c55a54
-			       int, struct type *, int,
2c55a54
+			       int, struct type *, LONGEST,
2c55a54
 			       const struct language_defn *);
92b52c5
 
2c55a54
 
7306e88
@@ -279,7 +279,7 @@
92b52c5
    of a character.  */
92b52c5
 
92b52c5
 static int
92b52c5
-char_at (const gdb_byte *string, int i, int type_len,
92b52c5
+char_at (const gdb_byte *string, LONGEST i, int type_len,
92b52c5
 	 enum bfd_endian byte_order)
92b52c5
 {
92b52c5
   if (type_len == 1)
7306e88
@@ -441,11 +441,11 @@
92b52c5
 
92b52c5
 static void
92b52c5
 printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
92b52c5
-	  unsigned int length, int force_ellipses, int type_len,
92b52c5
+	  ULONGEST length, int force_ellipses, int type_len,
92b52c5
 	  const struct value_print_options *options)
92b52c5
 {
92b52c5
   enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype));
92b52c5
-  unsigned int i;
92b52c5
+  ULONGEST i;
92b52c5
   unsigned int things_printed = 0;
92b52c5
   int in_quotes = 0;
92b52c5
   int need_comma = 0;
7306e88
@@ -460,9 +460,9 @@
92b52c5
     {
92b52c5
       /* Position of the character we are examining
92b52c5
          to see whether it is repeated.  */
92b52c5
-      unsigned int rep1;
92b52c5
+      ULONGEST rep1;
92b52c5
       /* Number of repetitions we have detected so far.  */
92b52c5
-      unsigned int reps;
92b52c5
+      ULONGEST reps;
92b52c5
 
92b52c5
       QUIT;
92b52c5
 
7306e88
@@ -493,7 +493,8 @@
92b52c5
 	  ada_emit_char (char_at (string, i, type_len, byte_order),
92b52c5
 			 elttype, stream, '\'', type_len);
92b52c5
 	  fputs_filtered ("'", stream);
92b52c5
-	  fprintf_filtered (stream, _(" <repeats %u times>"), reps);
92b52c5
+	  fprintf_filtered (stream, _(" <repeats %s times>"),
92b52c5
+			    pulongest (reps));
92b52c5
 	  i = rep1 - 1;
92b52c5
 	  things_printed += options->repeat_count_threshold;
92b52c5
 	  need_comma = 1;
7306e88
@@ -521,7 +522,7 @@
92b52c5
 
92b52c5
 void
92b52c5
 ada_printstr (struct ui_file *stream, struct type *type,
92b52c5
-	      const gdb_byte *string, unsigned int length,
92b52c5
+	      const gdb_byte *string, ULONGEST length,
92b52c5
 	      const char *encoding, int force_ellipses,
92b52c5
 	      const struct value_print_options *options)
92b52c5
 {
7306e88
@@ -531,12 +532,12 @@
92b52c5
 
92b52c5
 static int
92b52c5
 print_variant_part (struct type *type, int field_num,
92b52c5
-		    const gdb_byte *valaddr, int offset,
92b52c5
+		    const gdb_byte *valaddr, LONGEST offset,
92b52c5
 		    struct ui_file *stream, int recurse,
92b52c5
 		    const struct value *val,
92b52c5
 		    const struct value_print_options *options,
92b52c5
 		    int comma_needed,
2c55a54
-		    struct type *outer_type, int outer_offset,
2c55a54
+		    struct type *outer_type, LONGEST outer_offset,
2c55a54
 		    const struct language_defn *language)
92b52c5
 {
92b52c5
   struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
7306e88
@@ -572,11 +573,11 @@
92b52c5
 
92b52c5
 static int
92b52c5
 print_field_values (struct type *type, const gdb_byte *valaddr,
92b52c5
-		    int offset, struct ui_file *stream, int recurse,
92b52c5
+		    LONGEST offset, struct ui_file *stream, int recurse,
92b52c5
 		    const struct value *val,
92b52c5
 		    const struct value_print_options *options,
92b52c5
 		    int comma_needed,
2c55a54
-		    struct type *outer_type, int outer_offset,
2c55a54
+		    struct type *outer_type, LONGEST outer_offset,
2c55a54
 		    const struct language_defn *language)
92b52c5
 {
92b52c5
   int i, len;
7306e88
@@ -643,7 +644,7 @@
92b52c5
 	    }
92b52c5
 	  else
92b52c5
 	    {
92b52c5
-	      int bit_pos = TYPE_FIELD_BITPOS (type, i);
92b52c5
+	      LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
92b52c5
 	      int bit_size = TYPE_FIELD_BITSIZE (type, i);
92b52c5
 	      struct value_print_options opts;
92b52c5
 
7306e88
@@ -689,8 +690,8 @@
2c55a54
 {
2c55a54
   enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
2c55a54
   struct type *elttype = TYPE_TARGET_TYPE (type);
2c55a54
-  unsigned int eltlen;
2c55a54
-  unsigned int len;
2c55a54
+  ULONGEST eltlen;
2c55a54
+  ULONGEST len;
2c55a54
 
2c55a54
   /* We know that ELTTYPE cannot possibly be null, because we assume
2c55a54
      that we're called only when TYPE is a string-like type.
7306e88
@@ -709,7 +710,7 @@
2c55a54
      elements up to it.  */
2c55a54
   if (options->stop_print_at_null)
2c55a54
     {
2c55a54
-      int temp_len;
2c55a54
+      LONGEST temp_len;
2c55a54
 
2c55a54
       /* Look for a NULL char.  */
2c55a54
       for (temp_len = 0;
7306e88
@@ -1074,7 +1075,7 @@
2c55a54
 
2c55a54
 static void
2c55a54
 ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
2c55a54
-		 int offset, CORE_ADDR address,
2c55a54
+		 LONGEST offset, CORE_ADDR address,
2c55a54
 		 struct ui_file *stream, int recurse,
2c55a54
 		 const struct value *original_value,
2c55a54
 		 const struct value_print_options *options,
7306e88
@@ -1157,7 +1158,7 @@
2c55a54
 
2c55a54
 void
2c55a54
 ada_val_print (struct type *type, const gdb_byte *valaddr,
2c55a54
-	       int embedded_offset, CORE_ADDR address,
2c55a54
+	       LONGEST embedded_offset, CORE_ADDR address,
2c55a54
 	       struct ui_file *stream, int recurse,
2c55a54
 	       const struct value *val,
2c55a54
 	       const struct value_print_options *options)
7306e88
Index: gdb-7.11.50.20160716/gdb/annotate.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/annotate.c	2016-07-16 14:33:42.057510149 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/annotate.c	2016-07-16 14:33:44.528530036 +0200
7306e88
@@ -533,21 +533,21 @@
92b52c5
 }
92b52c5
 
92b52c5
 void
92b52c5
-annotate_array_section_begin (int idx, struct type *elttype)
92b52c5
+annotate_array_section_begin (LONGEST idx, struct type *elttype)
92b52c5
 {
92b52c5
   if (annotation_level == 2)
92b52c5
     {
92b52c5
-      printf_filtered (("\n\032\032array-section-begin %d "), idx);
92b52c5
+      printf_filtered (("\n\032\032array-section-begin %s "), plongest (idx));
92b52c5
       print_value_flags (elttype);
92b52c5
       printf_filtered (("\n"));
92b52c5
     }
92b52c5
 }
92b52c5
 
92b52c5
 void
92b52c5
-annotate_elt_rep (unsigned int repcount)
92b52c5
+annotate_elt_rep (ULONGEST repcount)
92b52c5
 {
92b52c5
   if (annotation_level == 2)
92b52c5
-    printf_filtered (("\n\032\032elt-rep %u\n"), repcount);
92b52c5
+    printf_filtered (("\n\032\032elt-rep %s\n"), pulongest (repcount));
92b52c5
 }
92b52c5
 
92b52c5
 void
7306e88
Index: gdb-7.11.50.20160716/gdb/annotate.h
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/annotate.h	2016-07-16 14:33:42.057510149 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/annotate.h	2016-07-16 14:33:44.528530036 +0200
7306e88
@@ -92,8 +92,8 @@
92b52c5
 extern void annotate_frame_where (void);
92b52c5
 extern void annotate_frame_end (void);
92b52c5
 
92b52c5
-extern void annotate_array_section_begin (int, struct type *);
92b52c5
-extern void annotate_elt_rep (unsigned int);
92b52c5
+extern void annotate_array_section_begin (LONGEST, struct type *);
92b52c5
+extern void annotate_elt_rep (ULONGEST);
92b52c5
 extern void annotate_elt_rep_end (void);
92b52c5
 extern void annotate_elt (void);
92b52c5
 extern void annotate_array_section_end (void);
7306e88
Index: gdb-7.11.50.20160716/gdb/arm-linux-nat.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/arm-linux-nat.c	2016-07-16 14:33:42.057510149 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/arm-linux-nat.c	2016-07-16 14:33:44.529530044 +0200
7306e88
@@ -1063,7 +1063,7 @@
92b52c5
    ADDR?  */
92b52c5
 static int
eb6cb2d
 arm_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
eb6cb2d
-				       CORE_ADDR addr, int len)
eb6cb2d
+				       CORE_ADDR addr, LONGEST len)
92b52c5
 {
92b52c5
   const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap ();
92b52c5
   CORE_ADDR max_wp_length, aligned_addr;
7306e88
Index: gdb-7.11.50.20160716/gdb/ax-gdb.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/ax-gdb.c	2016-07-16 14:33:42.060510173 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/ax-gdb.c	2016-07-16 14:33:44.529530044 +0200
7306e88
@@ -83,12 +83,12 @@
92b52c5
 static void gen_sign_extend (struct agent_expr *, struct type *);
92b52c5
 static void gen_extend (struct agent_expr *, struct type *);
92b52c5
 static void gen_fetch (struct agent_expr *, struct type *);
92b52c5
-static void gen_left_shift (struct agent_expr *, int);
92b52c5
+static void gen_left_shift (struct agent_expr *, LONGEST);
92b52c5
 
92b52c5
 
92b52c5
 static void gen_frame_args_address (struct gdbarch *, struct agent_expr *);
92b52c5
 static void gen_frame_locals_address (struct gdbarch *, struct agent_expr *);
92b52c5
-static void gen_offset (struct agent_expr *ax, int offset);
92b52c5
+static void gen_offset (struct agent_expr *ax, LONGEST offset);
92b52c5
 static void gen_sym_offset (struct agent_expr *, struct symbol *);
92b52c5
 static void gen_var_ref (struct gdbarch *, struct agent_expr *ax,
92b52c5
 			 struct axs_value *value, struct symbol *var);
7306e88
@@ -136,15 +136,16 @@
92b52c5
 static void gen_address_of (struct agent_expr *, struct axs_value *);
92b52c5
 static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
92b52c5
 			      struct axs_value *value,
92b52c5
-			      struct type *type, int start, int end);
92b52c5
+			      struct type *type, LONGEST start, LONGEST end);
92b52c5
 static void gen_primitive_field (struct expression *exp,
92b52c5
 				 struct agent_expr *ax,
92b52c5
 				 struct axs_value *value,
92b52c5
-				 int offset, int fieldno, struct type *type);
92b52c5
+				 LONGEST offset, int fieldno,
92b52c5
+				 struct type *type);
92b52c5
 static int gen_struct_ref_recursive (struct expression *exp,
92b52c5
 				     struct agent_expr *ax,
92b52c5
 				     struct axs_value *value,
92b52c5
-				     char *field, int offset,
92b52c5
+				     char *field, LONGEST offset,
92b52c5
 				     struct type *type);
92b52c5
 static void gen_struct_ref (struct expression *exp, struct agent_expr *ax,
92b52c5
 			    struct axs_value *value,
7306e88
@@ -538,7 +539,7 @@
92b52c5
    right shift it by -DISTANCE bits if DISTANCE < 0.  This generates
92b52c5
    unsigned (logical) right shifts.  */
92b52c5
 static void
92b52c5
-gen_left_shift (struct agent_expr *ax, int distance)
92b52c5
+gen_left_shift (struct agent_expr *ax, LONGEST distance)
92b52c5
 {
92b52c5
   if (distance > 0)
92b52c5
     {
7306e88
@@ -592,7 +593,7 @@
92b52c5
    programming in ML, it would be clearer why these are the same
92b52c5
    thing.  */
92b52c5
 static void
92b52c5
-gen_offset (struct agent_expr *ax, int offset)
92b52c5
+gen_offset (struct agent_expr *ax, LONGEST offset)
92b52c5
 {
92b52c5
   /* It would suffice to simply push the offset and add it, but this
92b52c5
      makes it easier to read positive and negative offsets in the
7306e88
@@ -1248,7 +1249,7 @@
92b52c5
 static void
92b52c5
 gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
92b52c5
 		  struct axs_value *value, struct type *type,
92b52c5
-		  int start, int end)
92b52c5
+		  LONGEST start, LONGEST end)
92b52c5
 {
92b52c5
   /* Note that ops[i] fetches 8 << i bits.  */
92b52c5
   static enum agent_op ops[]
7306e88
@@ -1283,13 +1284,13 @@
92b52c5
 
92b52c5
   /* The first and one-after-last bits in the field, but rounded down
92b52c5
      and up to byte boundaries.  */
92b52c5
-  int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
92b52c5
-  int bound_end = (((end + TARGET_CHAR_BIT - 1)
92b52c5
-		    / TARGET_CHAR_BIT)
92b52c5
-		   * TARGET_CHAR_BIT);
92b52c5
+  LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
92b52c5
+  LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1)
92b52c5
+			/ TARGET_CHAR_BIT)
92b52c5
+		       * TARGET_CHAR_BIT);
92b52c5
 
92b52c5
   /* current bit offset within the structure */
92b52c5
-  int offset;
92b52c5
+  LONGEST offset;
92b52c5
 
92b52c5
   /* The index in ops of the opcode we're considering.  */
92b52c5
   int op;
7306e88
@@ -1408,7 +1409,7 @@
92b52c5
 static void
92b52c5
 gen_primitive_field (struct expression *exp,
92b52c5
 		     struct agent_expr *ax, struct axs_value *value,
92b52c5
-		     int offset, int fieldno, struct type *type)
92b52c5
+		     LONGEST offset, int fieldno, struct type *type)
92b52c5
 {
92b52c5
   /* Is this a bitfield?  */
92b52c5
   if (TYPE_FIELD_PACKED (type, fieldno))
7306e88
@@ -1433,7 +1434,7 @@
92b52c5
 static int
92b52c5
 gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax,
92b52c5
 			  struct axs_value *value,
92b52c5
-			  char *field, int offset, struct type *type)
92b52c5
+			  char *field, LONGEST offset, struct type *type)
92b52c5
 {
92b52c5
   int i, rslt;
92b52c5
   int nbases = TYPE_N_BASECLASSES (type);
7306e88
Index: gdb-7.11.50.20160716/gdb/ax-general.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/ax-general.c	2016-07-16 14:33:42.060510173 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/ax-general.c	2016-07-16 14:33:44.529530044 +0200
7306e88
@@ -199,7 +199,7 @@
92b52c5
 
92b52c5
 /* Append a trace_quick instruction to EXPR, to record N bytes.  */
92b52c5
 void
92b52c5
-ax_trace_quick (struct agent_expr *x, int n)
92b52c5
+ax_trace_quick (struct agent_expr *x, LONGEST n)
92b52c5
 {
92b52c5
   /* N must fit in a byte.  */
92b52c5
   if (n < 0 || n > 255)
7306e88
Index: gdb-7.11.50.20160716/gdb/ax.h
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/ax.h	2016-07-16 14:33:42.060510173 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/ax.h	2016-07-16 14:33:44.529530044 +0200
7306e88
@@ -210,7 +210,7 @@
92b52c5
 extern void ax_zero_ext (struct agent_expr *EXPR, int N);
92b52c5
 
92b52c5
 /* Append a trace_quick instruction to EXPR, to record N bytes.  */
92b52c5
-extern void ax_trace_quick (struct agent_expr *EXPR, int N);
92b52c5
+extern void ax_trace_quick (struct agent_expr *EXPR, LONGEST N);
92b52c5
 
92b52c5
 /* Append a goto op to EXPR.  OP is the actual op (must be aop_goto or
92b52c5
    aop_if_goto).  We assume we don't know the target offset yet,
7306e88
Index: gdb-7.11.50.20160716/gdb/breakpoint.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/breakpoint.c	2016-07-16 14:33:42.067510230 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/breakpoint.c	2016-07-16 14:33:44.531530060 +0200
7306e88
@@ -2251,9 +2251,9 @@
2f7f533
 	{
2f7f533
 	  fprintf_unfiltered (gdb_stdlog,
2f7f533
 			      "infrun: stepping past non-steppable watchpoint. "
2f7f533
-			      "skipping watchpoint at %s:%d\n",
2f7f533
+			      "skipping watchpoint at %s:%s\n",
2f7f533
 			      paddress (bl->gdbarch, bl->address),
2f7f533
-			      bl->length);
2f7f533
+			      plongest (bl->length));
2f7f533
 	}
2f7f533
       return 0;
2f7f533
     }
7306e88
@@ -7181,7 +7181,7 @@
92b52c5
 
92b52c5
 static int
92b52c5
 breakpoint_address_match_range (struct address_space *aspace1, CORE_ADDR addr1,
92b52c5
-				int len1, struct address_space *aspace2,
92b52c5
+				LONGEST len1, struct address_space *aspace2,
92b52c5
 				CORE_ADDR addr2)
92b52c5
 {
556378e
   return ((gdbarch_has_global_breakpoints (target_gdbarch ())
7306e88
@@ -11534,7 +11534,7 @@
92b52c5
 		      && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
92b52c5
 		{
92b52c5
 		  CORE_ADDR vaddr = value_address (v);
92b52c5
-		  int len;
92b52c5
+		  LONGEST len;
92b52c5
 		  int num_regs;
92b52c5
 
92b52c5
 		  len = (target_exact_watchpoints
7306e88
Index: gdb-7.11.50.20160716/gdb/breakpoint.h
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/breakpoint.h	2016-07-16 14:33:42.068510238 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/breakpoint.h	2016-07-16 14:33:44.532530068 +0200
7306e88
@@ -237,7 +237,7 @@
92b52c5
 
92b52c5
   /* If this is a ranged breakpoint, then this field contains the
92b52c5
      length of the range that will be watched for execution.  */
92b52c5
-  int length;
92b52c5
+  LONGEST length;
92b52c5
 
92b52c5
   /* If the breakpoint lives in memory and reading that memory would
92b52c5
      give back the breakpoint, instead of the original contents, then
7306e88
@@ -413,7 +413,7 @@
92b52c5
   /* For hardware watchpoints, the size of the memory region being
92b52c5
      watched.  For hardware ranged breakpoints, the size of the
92b52c5
      breakpoint range.  */
92b52c5
-  int length;
92b52c5
+  LONGEST length;
92b52c5
 
92b52c5
   /* Type of hardware watchpoint.  */
92b52c5
   enum target_hw_bp_type watchpoint_type;
7306e88
Index: gdb-7.11.50.20160716/gdb/c-lang.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/c-lang.c	2016-07-16 14:33:42.069510246 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/c-lang.c	2016-07-16 14:33:44.532530068 +0200
7306e88
@@ -186,7 +186,7 @@
92b52c5
 
92b52c5
 void
92b52c5
 c_printstr (struct ui_file *stream, struct type *type, 
92b52c5
-	    const gdb_byte *string, unsigned int length, 
92b52c5
+	    const gdb_byte *string, ULONGEST length,
92b52c5
 	    const char *user_encoding, int force_ellipses,
92b52c5
 	    const struct value_print_options *options)
92b52c5
 {
7306e88
@@ -675,7 +675,7 @@
92b52c5
 	  }
92b52c5
 	else
92b52c5
 	  {
92b52c5
-	    int i;
92b52c5
+	    LONGEST i;
92b52c5
 
92b52c5
 	    /* Write the terminating character.  */
92b52c5
 	    for (i = 0; i < TYPE_LENGTH (type); ++i)
7306e88
@@ -684,7 +684,7 @@
92b52c5
 	    if (satisfy_expected)
92b52c5
 	      {
92b52c5
 		LONGEST low_bound, high_bound;
92b52c5
-		int element_size = TYPE_LENGTH (type);
92b52c5
+		LONGEST element_size = TYPE_LENGTH (type);
92b52c5
 
92b52c5
 		if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type),
92b52c5
 					 &low_bound, &high_bound) < 0)
7306e88
Index: gdb-7.11.50.20160716/gdb/c-lang.h
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/c-lang.h	2016-07-16 14:33:42.069510246 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/c-lang.h	2016-07-16 14:33:44.532530068 +0200
7306e88
@@ -77,7 +77,7 @@
92b52c5
 			     struct ui_file *);
92b52c5
 
92b52c5
 extern void c_val_print (struct type *, const gdb_byte *,
92b52c5
-			 int, CORE_ADDR,
92b52c5
+			 LONGEST, CORE_ADDR,
92b52c5
 			 struct ui_file *, int,
92b52c5
 			 const struct value *,
92b52c5
 			 const struct value_print_options *);
7306e88
@@ -97,7 +97,7 @@
92b52c5
 extern void c_printstr (struct ui_file * stream,
92b52c5
 			struct type *elttype,
92b52c5
 			const gdb_byte *string,
92b52c5
-			unsigned int length,
92b52c5
+			ULONGEST length,
92b52c5
 			const char *user_encoding,
92b52c5
 			int force_ellipses,
92b52c5
 			const struct value_print_options *options);
7306e88
Index: gdb-7.11.50.20160716/gdb/c-valprint.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/c-valprint.c	2016-07-16 14:33:42.070510254 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/c-valprint.c	2016-07-16 14:33:44.532530068 +0200
7306e88
@@ -244,7 +244,7 @@
23f398e
   if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0)
23f398e
     {
23f398e
       LONGEST low_bound, high_bound;
23f398e
-      int eltlen, len;
23f398e
+      LONGEST eltlen, len;
23f398e
       struct gdbarch *gdbarch = get_type_arch (type);
23f398e
       enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
23f398e
       unsigned int i = 0;	/* Number of characters printed.  */
7306e88
@@ -318,8 +318,8 @@
23f398e
 	  if (cp_is_vtbl_ptr_type (elttype))
23f398e
 	    {
23f398e
 	      i = 1;
23f398e
-	      fprintf_filtered (stream, _("%d vtable entries"),
23f398e
-				len - 1);
23f398e
+	      fprintf_filtered (stream, _("%s vtable entries"),
23f398e
+				plongest (len - 1));
23f398e
 	    }
23f398e
 	  else
23f398e
 	    {
7306e88
@@ -396,7 +396,7 @@
23f398e
 	 -fvtable_thunks.  (Otherwise, look under
23f398e
 	 TYPE_CODE_PTR.)  */
23f398e
       struct gdbarch *gdbarch = get_type_arch (type);
23f398e
-      int offset = (embedded_offset
23f398e
+      LONGEST offset = (embedded_offset
23f398e
 		    + TYPE_FIELD_BITPOS (type,
23f398e
 					 VTBL_FNADDR_OFFSET) / 8);
23f398e
       struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET);
7306e88
@@ -495,7 +495,7 @@
92b52c5
 
92b52c5
 void
92b52c5
 c_val_print (struct type *type, const gdb_byte *valaddr,
92b52c5
-	     int embedded_offset, CORE_ADDR address,
92b52c5
+	     LONGEST embedded_offset, CORE_ADDR address,
92b52c5
 	     struct ui_file *stream, int recurse,
92b52c5
 	     const struct value *original_value,
92b52c5
 	     const struct value_print_options *options)
7306e88
Index: gdb-7.11.50.20160716/gdb/cp-abi.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/cp-abi.c	2016-07-16 14:33:42.070510254 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/cp-abi.c	2016-07-16 14:33:44.532530068 +0200
7306e88
@@ -64,12 +64,12 @@
92b52c5
   return (*current_cp_abi.is_operator_name) (name);
92b52c5
 }
92b52c5
 
92b52c5
-int
92b52c5
+LONGEST
92b52c5
 baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
7306e88
 		  LONGEST embedded_offset, CORE_ADDR address,
92b52c5
 		  const struct value *val)
92b52c5
 {
92b52c5
-  int res = 0;
92b52c5
+  LONGEST res = 0;
92b52c5
 
92b52c5
   gdb_assert (current_cp_abi.baseclass_offset != NULL);
92b52c5
 
7306e88
@@ -96,7 +96,7 @@
92b52c5
 struct value *
92b52c5
 value_virtual_fn_field (struct value **arg1p,
92b52c5
 			struct fn_field *f, int j,
92b52c5
-			struct type *type, int offset)
92b52c5
+			struct type *type, LONGEST offset)
92b52c5
 {
92b52c5
   if ((current_cp_abi.virtual_fn_field) == NULL)
92b52c5
     return NULL;
7306e88
Index: gdb-7.11.50.20160716/gdb/cp-abi.h
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/cp-abi.h	2016-07-16 14:33:42.070510254 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/cp-abi.h	2016-07-16 14:33:44.532530068 +0200
7306e88
@@ -108,7 +108,7 @@
92b52c5
 					     struct fn_field *f,
92b52c5
 					     int j,
92b52c5
 					     struct type *type,
92b52c5
-					     int offset);
92b52c5
+					     LONGEST offset);
92b52c5
 
92b52c5
 
92b52c5
 /* Try to find the run-time type of VALUE, using C++ run-time type
7306e88
@@ -144,11 +144,11 @@
92b52c5
    contents of VAL.  The result is the offset of the baseclass value
92b52c5
    relative to (the address of)(ARG) + OFFSET.  */
92b52c5
 
92b52c5
-extern int baseclass_offset (struct type *type,
92b52c5
-			     int index, const gdb_byte *valaddr,
7306e88
-			     LONGEST embedded_offset,
92b52c5
-			     CORE_ADDR address,
92b52c5
-			     const struct value *val);
92b52c5
+extern LONGEST baseclass_offset (struct type *type,
92b52c5
+				 int index, const gdb_byte *valaddr,
92b52c5
+				 LONGEST embedded_offset,
92b52c5
+				 CORE_ADDR address,
92b52c5
+				 const struct value *val);
92b52c5
 
92b52c5
 /* Describe the target of a pointer to method.  CONTENTS is the byte
92b52c5
    pattern representing the pointer to method.  TYPE is the pointer to
7306e88
@@ -227,12 +227,12 @@
92b52c5
   struct value *(*virtual_fn_field) (struct value **arg1p,
92b52c5
 				     struct fn_field * f,
92b52c5
 				     int j, struct type * type,
92b52c5
-				     int offset);
92b52c5
+				     LONGEST offset);
92b52c5
   struct type *(*rtti_type) (struct value *v, int *full,
7306e88
 			     LONGEST *top, int *using_enc);
92b52c5
-  int (*baseclass_offset) (struct type *type, int index,
7306e88
-			   const bfd_byte *valaddr, LONGEST embedded_offset,
92b52c5
-			   CORE_ADDR address, const struct value *val);
92b52c5
+  LONGEST (*baseclass_offset) (struct type *type, int index,
7306e88
+			       const bfd_byte *valaddr, LONGEST embedded_offset,
7306e88
+			       CORE_ADDR address, const struct value *val);
92b52c5
   void (*print_method_ptr) (const gdb_byte *contents,
92b52c5
 			    struct type *type,
92b52c5
 			    struct ui_file *stream);
7306e88
Index: gdb-7.11.50.20160716/gdb/cp-valprint.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/cp-valprint.c	2016-07-16 14:33:42.071510262 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/cp-valprint.c	2016-07-16 14:33:44.532530068 +0200
7306e88
@@ -334,7 +334,7 @@
92b52c5
 		}
92b52c5
 	      else if (i == vptr_fieldno && type == vptr_basetype)
92b52c5
 		{
92b52c5
-		  int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
92b52c5
+		  LONGEST i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
92b52c5
 		  struct type *i_type = TYPE_FIELD_TYPE (type, i);
92b52c5
 
92b52c5
 		  if (valprint_check_validity (stream, i_type, i_offset, val))
7306e88
Index: gdb-7.11.50.20160716/gdb/d-lang.h
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/d-lang.h	2016-07-16 14:33:42.071510262 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/d-lang.h	2016-07-16 14:33:44.533530076 +0200
7306e88
@@ -81,7 +81,7 @@
eb6cb2d
 /* Defined in d-valprint.c  */
92b52c5
 
92b52c5
 extern void d_val_print (struct type *type, const gdb_byte *valaddr,
92b52c5
-			 int embedded_offset, CORE_ADDR address,
92b52c5
+			 LONGEST embedded_offset, CORE_ADDR address,
92b52c5
 			 struct ui_file *stream, int recurse,
92b52c5
 			 const struct value *val,
92b52c5
 			 const struct value_print_options *options);
7306e88
Index: gdb-7.11.50.20160716/gdb/d-valprint.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/d-valprint.c	2016-07-16 14:33:42.071510262 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/d-valprint.c	2016-07-16 14:33:44.533530076 +0200
7306e88
@@ -73,9 +73,9 @@
92b52c5
 
92b52c5
 /* Implements the la_val_print routine for language D.  */
92b52c5
 void
92b52c5
-d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
92b52c5
-             CORE_ADDR address, struct ui_file *stream, int recurse,
92b52c5
-	     const struct value *val,
92b52c5
+d_val_print (struct type *type, const gdb_byte *valaddr,
92b52c5
+	     LONGEST embedded_offset, CORE_ADDR address,
92b52c5
+	     struct ui_file *stream, int recurse, const struct value *val,
92b52c5
              const struct value_print_options *options)
92b52c5
 {
92b52c5
   int ret;
7306e88
Index: gdb-7.11.50.20160716/gdb/doublest.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/doublest.c	2016-07-16 14:33:42.072510270 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/doublest.c	2016-07-16 14:33:44.533530076 +0200
7306e88
@@ -784,7 +784,7 @@
92b52c5
    but not passed on by GDB.  This should be fixed.  */
92b52c5
 
92b52c5
 static const struct floatformat *
92b52c5
-floatformat_from_length (struct gdbarch *gdbarch, int len)
92b52c5
+floatformat_from_length (struct gdbarch *gdbarch, LONGEST len)
92b52c5
 {
92b52c5
   const struct floatformat *format;
92b52c5
 
7306e88
@@ -812,8 +812,8 @@
92b52c5
   else
92b52c5
     format = NULL;
92b52c5
   if (format == NULL)
92b52c5
-    error (_("Unrecognized %d-bit floating-point type."),
92b52c5
-	   len * TARGET_CHAR_BIT);
92b52c5
+    error (_("Unrecognized %s-bit floating-point type."),
92b52c5
+	   plongest (len * TARGET_CHAR_BIT));
92b52c5
   return format;
92b52c5
 }
92b52c5
 
7306e88
Index: gdb-7.11.50.20160716/gdb/dwarf2loc.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/dwarf2loc.c	2016-07-16 14:33:42.076510302 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/dwarf2loc.c	2016-07-16 14:33:44.533530076 +0200
7306e88
@@ -1638,19 +1638,19 @@
92b52c5
    BITS_BIG_ENDIAN is taken directly from gdbarch.  */
92b52c5
 
92b52c5
 static void
92b52c5
-copy_bitwise (gdb_byte *dest, unsigned int dest_offset_bits,
92b52c5
-	      const gdb_byte *source, unsigned int source_offset_bits,
92b52c5
-	      unsigned int bit_count,
92b52c5
+copy_bitwise (gdb_byte *dest, ULONGEST dest_offset_bits,
92b52c5
+	      const gdb_byte *source, ULONGEST source_offset,
92b52c5
+	      ULONGEST bit_count,
92b52c5
 	      int bits_big_endian)
92b52c5
 {
92b52c5
-  unsigned int dest_avail;
92b52c5
+  unsigned int dest_avail, source_offset_bits;
92b52c5
   int datum;
92b52c5
 
92b52c5
   /* Reduce everything to byte-size pieces.  */
92b52c5
   dest += dest_offset_bits / 8;
92b52c5
   dest_offset_bits %= 8;
92b52c5
-  source += source_offset_bits / 8;
92b52c5
-  source_offset_bits %= 8;
92b52c5
+  source += source_offset / 8;
92b52c5
+  source_offset_bits = source_offset % 8;
92b52c5
 
92b52c5
   dest_avail = 8 - dest_offset_bits % 8;
92b52c5
 
7306e88
@@ -1688,13 +1688,13 @@
92b52c5
 read_pieced_value (struct value *v)
92b52c5
 {
92b52c5
   int i;
92b52c5
-  long offset = 0;
92b52c5
+  LONGEST offset = 0;
92b52c5
   ULONGEST bits_to_skip;
92b52c5
   gdb_byte *contents;
92b52c5
   struct piece_closure *c
92b52c5
     = (struct piece_closure *) value_computed_closure (v);
92b52c5
   struct frame_info *frame = frame_find_by_id (VALUE_FRAME_ID (v));
92b52c5
-  size_t type_len;
92b52c5
+  ULONGEST type_len;
92b52c5
   size_t buffer_size = 0;
872aab0
   gdb_byte *buffer = NULL;
92b52c5
   struct cleanup *cleanup;
7306e88
@@ -1721,8 +1721,8 @@
92b52c5
   for (i = 0; i < c->n_pieces && offset < type_len; i++)
92b52c5
     {
92b52c5
       struct dwarf_expr_piece *p = &c->pieces[i];
92b52c5
-      size_t this_size, this_size_bits;
92b52c5
-      long dest_offset_bits, source_offset_bits, source_offset;
92b52c5
+      ULONGEST this_size, this_size_bits;
92b52c5
+      LONGEST dest_offset_bits, source_offset_bits, source_offset;
92b52c5
       const gdb_byte *intermediate_buffer;
92b52c5
 
92b52c5
       /* Compute size, source, and destination offsets for copying, in
7306e88
@@ -1862,13 +1862,13 @@
92b52c5
 write_pieced_value (struct value *to, struct value *from)
92b52c5
 {
92b52c5
   int i;
92b52c5
-  long offset = 0;
92b52c5
+  LONGEST offset = 0;
92b52c5
   ULONGEST bits_to_skip;
92b52c5
   const gdb_byte *contents;
92b52c5
   struct piece_closure *c
92b52c5
     = (struct piece_closure *) value_computed_closure (to);
92b52c5
   struct frame_info *frame = frame_find_by_id (VALUE_FRAME_ID (to));
92b52c5
-  size_t type_len;
92b52c5
+  ULONGEST type_len;
92b52c5
   size_t buffer_size = 0;
872aab0
   gdb_byte *buffer = NULL;
92b52c5
   struct cleanup *cleanup;
7306e88
@@ -1896,8 +1896,8 @@
92b52c5
   for (i = 0; i < c->n_pieces && offset < type_len; i++)
92b52c5
     {
92b52c5
       struct dwarf_expr_piece *p = &c->pieces[i];
92b52c5
-      size_t this_size_bits, this_size;
92b52c5
-      long dest_offset_bits, source_offset_bits, dest_offset, source_offset;
92b52c5
+      ULONGEST this_size_bits, this_size;
92b52c5
+      LONGEST dest_offset_bits, source_offset_bits, dest_offset, source_offset;
92b52c5
       int need_bitwise;
92b52c5
       const gdb_byte *source_buffer;
92b52c5
 
7306e88
@@ -2017,7 +2017,7 @@
92b52c5
 
92b52c5
 static int
7306e88
 check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset,
2f7f533
-				int bit_length)
2f7f533
+				LONGEST bit_length)
92b52c5
 {
92b52c5
   struct piece_closure *c
2f7f533
     = (struct piece_closure *) value_computed_closure (value);
7306e88
@@ -2030,7 +2030,7 @@
92b52c5
   for (i = 0; i < c->n_pieces && bit_length > 0; i++)
92b52c5
     {
92b52c5
       struct dwarf_expr_piece *p = &c->pieces[i];
92b52c5
-      size_t this_size_bits = p->size;
92b52c5
+      ULONGEST this_size_bits = p->size;
92b52c5
 
92b52c5
       if (bit_offset > 0)
92b52c5
 	{
7306e88
@@ -2132,8 +2132,8 @@
92b52c5
   struct type *type;
92b52c5
   struct frame_info *frame;
92b52c5
   struct dwarf2_locexpr_baton baton;
7306e88
-  int i, bit_length;
7306e88
-  LONGEST bit_offset;
92b52c5
+  int i;
7306e88
+  LONGEST bit_length, bit_offset;
92b52c5
   struct dwarf_expr_piece *piece = NULL;
7306e88
   LONGEST byte_offset;
0728371
   enum bfd_endian byte_order;
7306e88
@@ -2150,7 +2150,7 @@
92b52c5
   for (i = 0; i < c->n_pieces && bit_length > 0; i++)
92b52c5
     {
92b52c5
       struct dwarf_expr_piece *p = &c->pieces[i];
92b52c5
-      size_t this_size_bits = p->size;
92b52c5
+      ULONGEST this_size_bits = p->size;
92b52c5
 
92b52c5
       if (bit_offset > 0)
92b52c5
 	{
7306e88
@@ -2444,7 +2444,7 @@
92b52c5
 	    struct value *value = dwarf_expr_fetch (ctx, 0);
92b52c5
 	    gdb_byte *contents;
92b52c5
 	    const gdb_byte *val_bytes;
92b52c5
-	    size_t n = TYPE_LENGTH (value_type (value));
92b52c5
+	    ULONGEST n = TYPE_LENGTH (value_type (value));
92b52c5
 
92b52c5
 	    if (byte_offset + TYPE_LENGTH (type) > n)
92b52c5
 	      invalid_synthetic_pointer ();
7306e88
Index: gdb-7.11.50.20160716/gdb/dwarf2read.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/dwarf2read.c	2016-07-16 14:33:42.083510358 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/dwarf2read.c	2016-07-16 14:33:44.536530100 +0200
7306e88
@@ -1935,12 +1935,12 @@
92b52c5
 }
92b52c5
 
92b52c5
 static void
92b52c5
-dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2,
92b52c5
-					      int arg3)
92b52c5
+dwarf2_const_value_length_mismatch_complaint (const char *arg1, LONGEST arg2,
92b52c5
+					      LONGEST arg3)
92b52c5
 {
92b52c5
   complaint (&symfile_complaints,
92b52c5
-	     _("const value length mismatch for '%s', got %d, expected %d"),
92b52c5
-	     arg1, arg2, arg3);
92b52c5
+	     _("const value length mismatch for '%s', got %s, expected %s"),
92b52c5
+	     arg1, plongest (arg2), plongest (arg3));
92b52c5
 }
92b52c5
 
92b52c5
 static void
7306e88
@@ -12573,8 +12573,8 @@
92b52c5
 	         object, and then subtract off the number of bits of
92b52c5
 	         the field itself.  The result is the bit offset of
92b52c5
 	         the LSB of the field.  */
92b52c5
-	      int anonymous_size;
92b52c5
-	      int bit_offset = DW_UNSND (attr);
92b52c5
+	      LONGEST anonymous_size;
92b52c5
+	      LONGEST bit_offset = DW_UNSND (attr);
92b52c5
 
92b52c5
 	      attr = dwarf2_attr (die, DW_AT_byte_size, cu);
92b52c5
 	      if (attr)
7306e88
Index: gdb-7.11.50.20160716/gdb/eval.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/eval.c	2016-07-16 14:33:42.086510383 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/eval.c	2016-07-16 14:33:44.537530108 +0200
7306e88
@@ -317,7 +317,8 @@
556378e
   while (--nargs >= 0)
556378e
     {
92b52c5
       struct value *val = NULL;
92b52c5
-      int bitpos, bitsize;
92b52c5
+      LONGEST bitpos;
556378e
+      int bitsize;
92b52c5
       bfd_byte *addr;
92b52c5
 
556378e
       fieldno++;
7306e88
@@ -378,7 +379,7 @@
92b52c5
 		    enum noside noside, LONGEST low_bound, LONGEST high_bound)
92b52c5
 {
92b52c5
   LONGEST index;
92b52c5
-  int element_size = TYPE_LENGTH (value_type (element));
92b52c5
+  LONGEST element_size = TYPE_LENGTH (value_type (element));
92b52c5
 
92b52c5
   if (exp->elts[*pos].opcode == BINOP_COMMA)
92b52c5
     {
7306e88
@@ -822,11 +823,11 @@
92b52c5
     /* FIXME: Also mixed integral/booleans, with result an integer.  */
92b52c5
     {
92b52c5
       const struct builtin_type *builtin = builtin_type (gdbarch);
92b52c5
-      unsigned int promoted_len1 = TYPE_LENGTH (type1);
92b52c5
-      unsigned int promoted_len2 = TYPE_LENGTH (type2);
92b52c5
+      ULONGEST promoted_len1 = TYPE_LENGTH (type1);
92b52c5
+      ULONGEST promoted_len2 = TYPE_LENGTH (type2);
92b52c5
       int is_unsigned1 = TYPE_UNSIGNED (type1);
92b52c5
       int is_unsigned2 = TYPE_UNSIGNED (type2);
92b52c5
-      unsigned int result_len;
92b52c5
+      ULONGEST result_len;
92b52c5
       int unsigned_operation;
92b52c5
 
92b52c5
       /* Determine type length and signedness after promotion for
7306e88
@@ -1008,7 +1009,7 @@
556378e
   struct value **argvec;
92b52c5
   int code;
92b52c5
   int ix;
92b52c5
-  long mem_offset;
92b52c5
+  LONGEST mem_offset;
92b52c5
   struct type **arg_types;
92b52c5
   int save_pos1;
92b52c5
   struct symbol *function = NULL;
7306e88
@@ -1187,7 +1188,7 @@
92b52c5
 	  struct type *range_type = TYPE_INDEX_TYPE (type);
92b52c5
 	  struct type *element_type = TYPE_TARGET_TYPE (type);
92b52c5
 	  struct value *array = allocate_value (expect_type);
92b52c5
-	  int element_size = TYPE_LENGTH (check_typedef (element_type));
92b52c5
+	  LONGEST element_size = TYPE_LENGTH (check_typedef (element_type));
92b52c5
 	  LONGEST low_bound, high_bound, index;
92b52c5
 
92b52c5
 	  if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
7306e88
Index: gdb-7.11.50.20160716/gdb/f-lang.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/f-lang.c	2016-07-16 14:33:42.087510391 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/f-lang.c	2016-07-16 14:33:44.537530108 +0200
7306e88
@@ -103,7 +103,7 @@
92b52c5
 
92b52c5
 static void
92b52c5
 f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
92b52c5
-	    unsigned int length, const char *encoding, int force_ellipses,
92b52c5
+	    ULONGEST length, const char *encoding, int force_ellipses,
92b52c5
 	    const struct value_print_options *options)
92b52c5
 {
92b52c5
   const char *type_encoding = f_get_encoding (type);
7306e88
Index: gdb-7.11.50.20160716/gdb/f-lang.h
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/f-lang.h	2016-07-16 14:33:42.087510391 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/f-lang.h	2016-07-16 14:33:44.537530108 +0200
7306e88
@@ -30,7 +30,7 @@
eb6cb2d
 extern void f_print_type (struct type *, const char *, struct ui_file *, int,
eb6cb2d
 			  int, const struct type_print_options *);
92b52c5
 
92b52c5
-extern void f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
92b52c5
+extern void f_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR,
92b52c5
 			 struct ui_file *, int,
92b52c5
 			 const struct value *,
92b52c5
 			 const struct value_print_options *);
7306e88
Index: gdb-7.11.50.20160716/gdb/f-valprint.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/f-valprint.c	2016-07-16 14:33:42.087510391 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/f-valprint.c	2016-07-16 14:33:44.537530108 +0200
7306e88
@@ -38,7 +38,7 @@
eb6cb2d
 static void info_common_command (char *, int);
92b52c5
 static void f77_get_dynamic_length_of_aggregate (struct type *);
92b52c5
 
92b52c5
-int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
92b52c5
+LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
92b52c5
 
92b52c5
 /* Array which holds offsets to be applied to get a row's elements
92b52c5
    for a given array.  Array also holds the size of each subarray.  */
7306e88
@@ -73,8 +73,8 @@
eb6cb2d
 static void
eb6cb2d
 f77_get_dynamic_length_of_aggregate (struct type *type)
92b52c5
 {
eb6cb2d
-  int upper_bound = -1;
eb6cb2d
-  int lower_bound = 1;
eb6cb2d
+  LONGEST upper_bound = -1;
eb6cb2d
+  LONGEST lower_bound = 1;
92b52c5
 
eb6cb2d
   /* Recursively go all the way down into a possibly multi-dimensional
eb6cb2d
      F77 array and get the bounds.  For simple arrays, this is pretty
7306e88
@@ -106,7 +106,7 @@
92b52c5
 static void
92b52c5
 f77_print_array_1 (int nss, int ndimensions, struct type *type,
92b52c5
 		   const gdb_byte *valaddr,
92b52c5
-		   int embedded_offset, CORE_ADDR address,
92b52c5
+		   LONGEST embedded_offset, CORE_ADDR address,
92b52c5
 		   struct ui_file *stream, int recurse,
92b52c5
 		   const struct value *val,
92b52c5
 		   const struct value_print_options *options,
7306e88
@@ -115,7 +115,7 @@
eb6cb2d
   struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type));
eb6cb2d
   CORE_ADDR addr = address + embedded_offset;
eb6cb2d
   LONGEST lowerbound, upperbound;
92b52c5
-  int i;
92b52c5
+  LONGEST i;
92b52c5
 
eb6cb2d
   get_discrete_bounds (range_type, &lowerbound, &upperbound);
eb6cb2d
 
7306e88
@@ -172,7 +172,7 @@
92b52c5
 
92b52c5
 static void
92b52c5
 f77_print_array (struct type *type, const gdb_byte *valaddr,
92b52c5
-		 int embedded_offset,
92b52c5
+		 LONGEST embedded_offset,
92b52c5
 		 CORE_ADDR address, struct ui_file *stream,
92b52c5
 		 int recurse,
92b52c5
 		 const struct value *val,
7306e88
@@ -211,8 +211,9 @@
92b52c5
    function; they are identical.  */
92b52c5
 
92b52c5
 void
92b52c5
-f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
92b52c5
-	     CORE_ADDR address, struct ui_file *stream, int recurse,
92b52c5
+f_val_print (struct type *type, const gdb_byte *valaddr,
92b52c5
+	     LONGEST embedded_offset, CORE_ADDR address,
92b52c5
+	     struct ui_file *stream, int recurse,
92b52c5
 	     const struct value *original_value,
92b52c5
 	     const struct value_print_options *options)
92b52c5
 {
7306e88
Index: gdb-7.11.50.20160716/gdb/findvar.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/findvar.c	2016-07-16 14:33:42.088510399 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/findvar.c	2016-07-16 14:33:44.537530108 +0200
7306e88
@@ -802,7 +802,7 @@
eb6cb2d
 default_value_from_register (struct gdbarch *gdbarch, struct type *type,
eb6cb2d
                              int regnum, struct frame_id frame_id)
92b52c5
 {
92b52c5
-  int len = TYPE_LENGTH (type);
92b52c5
+  LONGEST len = TYPE_LENGTH (type);
92b52c5
   struct value *value = allocate_value (type);
92b52c5
 
92b52c5
   VALUE_LVAL (value) = lval_register;
7306e88
@@ -838,7 +838,7 @@
7306e88
   LONGEST offset = 0;
7306e88
   LONGEST reg_offset = value_offset (value);
92b52c5
   int regnum = VALUE_REGNUM (value);
23f398e
-  int len = type_length_units (check_typedef (value_type (value)));
23f398e
+  LONGEST len = type_length_units (check_typedef (value_type (value)));
92b52c5
 
92b52c5
   gdb_assert (VALUE_LVAL (value) == lval_register);
92b52c5
 
7306e88
@@ -853,7 +853,7 @@
92b52c5
   while (len > 0)
92b52c5
     {
92b52c5
       struct value *regval = get_frame_register_value (frame, regnum);
23f398e
-      int reg_len = type_length_units (value_type (regval)) - reg_offset;
23f398e
+      LONGEST reg_len = type_length_units (value_type (regval)) - reg_offset;
92b52c5
 
2f7f533
       /* If the register length is larger than the number of bytes
2f7f533
          remaining to copy, then only copy the appropriate bytes.  */
7306e88
Index: gdb-7.11.50.20160716/gdb/frame.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/frame.c	2016-07-16 14:33:42.089510407 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/frame.c	2016-07-16 14:33:44.538530116 +0200
7306e88
@@ -1320,7 +1320,7 @@
92b52c5
 
92b52c5
 int
92b52c5
 get_frame_register_bytes (struct frame_info *frame, int regnum,
92b52c5
-			  CORE_ADDR offset, int len, gdb_byte *myaddr,
92b52c5
+			  CORE_ADDR offset, LONGEST len, gdb_byte *myaddr,
92b52c5
 			  int *optimizedp, int *unavailablep)
92b52c5
 {
92b52c5
   struct gdbarch *gdbarch = get_frame_arch (frame);
7306e88
@@ -1349,7 +1349,7 @@
92b52c5
     }
92b52c5
   if (len > maxsize)
92b52c5
     error (_("Bad debug information detected: "
92b52c5
-	     "Attempt to read %d bytes from registers."), len);
92b52c5
+	     "Attempt to read %s bytes from registers."), plongest (len));
92b52c5
 
92b52c5
   /* Copy the data.  */
92b52c5
   while (len > 0)
7306e88
Index: gdb-7.11.50.20160716/gdb/frame.h
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/frame.h	2016-07-16 14:33:42.090510415 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/frame.h	2016-07-16 14:33:44.538530116 +0200
7306e88
@@ -585,7 +585,7 @@
92b52c5
    contents are optimized out or unavailable, set *OPTIMIZEDP,
92b52c5
    *UNAVAILABLEP accordingly.  */
92b52c5
 extern int get_frame_register_bytes (struct frame_info *frame, int regnum,
92b52c5
-				     CORE_ADDR offset, int len,
92b52c5
+				     CORE_ADDR offset, LONGEST len,
92b52c5
 				     gdb_byte *myaddr,
92b52c5
 				     int *optimizedp, int *unavailablep);
92b52c5
 
7306e88
Index: gdb-7.11.50.20160716/gdb/gdbtypes.c
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/gdbtypes.c	2016-07-16 14:33:42.092510431 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/gdbtypes.c	2016-07-16 14:33:44.539530124 +0200
7306e88
@@ -2722,7 +2722,7 @@
ab333d9
    least as long as OBJFILE.  */
92b52c5
 
92b52c5
 struct type *
92b52c5
-init_type (enum type_code code, int length, int flags,
92b52c5
+init_type (enum type_code code, LONGEST length, int flags,
ab333d9
 	   const char *name, struct objfile *objfile)
92b52c5
 {
92b52c5
   struct type *type;
7306e88
@@ -2962,8 +2962,8 @@
92b52c5
 
92b52c5
 static int
92b52c5
 is_unique_ancestor_worker (struct type *base, struct type *dclass,
92b52c5
-			   int *offset,
92b52c5
-			   const gdb_byte *valaddr, int embedded_offset,
92b52c5
+			   LONGEST *offset,
92b52c5
+			   const gdb_byte *valaddr, LONGEST embedded_offset,
92b52c5
 			   CORE_ADDR address, struct value *val)
92b52c5
 {
92b52c5
   int i, count = 0;
7306e88
@@ -2974,7 +2974,7 @@
92b52c5
   for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i)
92b52c5
     {
92b52c5
       struct type *iter;
92b52c5
-      int this_offset;
92b52c5
+      LONGEST this_offset;
92b52c5
 
92b52c5
       iter = check_typedef (TYPE_BASECLASS (dclass, i));
92b52c5
 
7306e88
@@ -3015,7 +3015,7 @@
92b52c5
 int
92b52c5
 is_unique_ancestor (struct type *base, struct value *val)
92b52c5
 {
92b52c5
-  int offset = -1;
92b52c5
+  LONGEST offset = -1;
92b52c5
 
92b52c5
   return is_unique_ancestor_worker (base, value_type (val), &offset,
92b52c5
 				    value_contents_for_printing (val),
7306e88
@@ -4203,7 +4203,7 @@
92b52c5
       break;
92b52c5
     }
92b52c5
   puts_filtered ("\n");
92b52c5
-  printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
92b52c5
+  printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type)));
92b52c5
   if (TYPE_OBJFILE_OWNED (type))
92b52c5
     {
92b52c5
       printfi_filtered (spaces, "objfile ");
7306e88
@@ -4663,7 +4663,7 @@
556378e
 
92b52c5
 struct type *
92b52c5
 arch_type (struct gdbarch *gdbarch,
7306e88
-	   enum type_code code, int length, const char *name)
7306e88
+	   enum type_code code, LONGEST length, const char *name)
92b52c5
 {
92b52c5
   struct type *type;
92b52c5
 
7306e88
Index: gdb-7.11.50.20160716/gdb/gdbtypes.h
92b52c5
===================================================================
7306e88
--- gdb-7.11.50.20160716.orig/gdb/gdbtypes.h	2016-07-16 14:33:42.093510439 +0200
7306e88
+++ gdb-7.11.50.20160716/gdb/gdbtypes.h	2016-07-16 14:33:44.539530124 +0200
7306e88
@@ -806,7 +806,7 @@
23f398e
      type_length_units function should be used in order to get the length
23f398e
      expressed in target addressable memory units.  */
23f398e
 
23f398e
-  unsigned int length;
92b52c5
+  ULONGEST length;
92b52c5
 
eb6cb2d
   /* * Core type, shared by a group of qualified types.  */
eb6cb2d
 
7306e88
@@ -1677,11 +1677,11 @@
eb6cb2d
 
eb6cb2d
 /* * Helper function to construct objfile-owned types.  */
92b52c5
 
ab333d9
-extern struct type *init_type (enum type_code, int, int, const char *,
ab333d9
+extern struct type *init_type (enum type_code, LONGEST, int, const char *,
92b52c5
 			       struct objfile *);
92b52c5
 
92b52c5
 /* Helper functions to construct architecture-owned types.  */
7306e88
-extern struct type *arch_type (struct gdbarch *, enum type_code, int,
92b52c5
+extern struct type *arch_type (struct gdbarch *, enum type_code, LONGEST,