Blame SOURCES/gdb-rhbz795424-bitpos-20of25.patch

2f9ed3
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
2f9ed3
From: Fedora GDB patches <invalid@email.com>
2f9ed3
Date: Fri, 27 Oct 2017 21:07:50 +0200
2f9ed3
Subject: gdb-rhbz795424-bitpos-20of25.patch
2f9ed3
2f9ed3
;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
2f9ed3
;; (RH BZ 795424).
2f9ed3
;;=push
2f9ed3
2f9ed3
http://sourceware.org/ml/gdb-patches/2012-09/msg00631.html
2f9ed3
2f9ed3
--MP_/yp5f+W_ED2JtUlSyBi8xujr
2f9ed3
Content-Type: text/plain; charset=US-ASCII
2f9ed3
Content-Transfer-Encoding: 7bit
2f9ed3
Content-Disposition: inline
2f9ed3
2f9ed3
Hi,
2f9ed3
2f9ed3
This is patch 1/4, which implements the bulk of the changes in type
2f9ed3
length and bitpos/type offset. I have verified that there are no
2f9ed3
regressions resulting from this patch by running the testsuite on
2f9ed3
Fedora 16 x86_64.  Patch and changelog attached.
2f9ed3
2f9ed3
Regards,
2f9ed3
Siddhesh
2f9ed3
2f9ed3
--MP_/yp5f+W_ED2JtUlSyBi8xujr
2f9ed3
Content-Type: text/plain
2f9ed3
Content-Transfer-Encoding: quoted-printable
2f9ed3
Content-Disposition: attachment; filename=ChangeLog-main
2f9ed3
2f9ed3
gdb/ChangeLog
2f9ed3
2f9ed3
2012-08-05  Siddhesh Poyarekar  <siddhesh@redhat.com>
2f9ed3
2f9ed3
	* ada-lang.c (fat_pntr_bounds_bitpos): Return LONGEST.
2f9ed3
	(fat_pntr_data_bitpos): Likewise.
2f9ed3
	(desc_bound_bitpos): Likewise.
2f9ed3
	(constrained_packed_array_type): Expand ELT_BITS parameter to
2f9ed3
	LONGEST.
2f9ed3
	(move_bits): Expand parameters SRC_OFFSET and N to LONGEST.
2f9ed3
	(cond_offset_host): Expand parameter OFFSET to LONGEST.
2f9ed3
	(cond_offset_target): Likewise.
2f9ed3
	(ada_type_of_array): Expand ARRAY_BITSIZE to LONGEST.
2f9ed3
	(decode_constrained_packed_array_type): Expand BITS to LONGEST.
2f9ed3
	(decode_constrained_packed_array): Expand BIT_POS to LONGEST.
2f9ed3
	(ada_value_primitive_packed_val): Expand parameter OFFSET to
2f9ed3
	LONGEST.  Expand TARG, NTARG and NEW_OFFSET to LONGEST.
2f9ed3
	(ada_value_assign): Expand FROM_SIZE to LONGEST.
2f9ed3
	(value_assign_to_component): Expand BITS to LONGEST.
2f9ed3
	(ensure_lval): Expand LEN to LONGEST.
2f9ed3
	(value_pointer): Expand LEN to ULONGEST.
2f9ed3
	(value_tag_from_contents_and_address): Expand TAG_BYTE_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(ada_value_primitive_field): Expand parameter OFFSET to LONGEST.
2f9ed3
	Expand bit_pos to LONGEST.
2f9ed3
	(find_struct_field): Expand parameters OFFSET and BYTE_OFFSET_P to
2f9ed3
	LONGEST.  Expand BIT_POS and FLD_OFFSET to LONGEST.
2f9ed3
	(ada_search_struct_field): Expand parameter OFFSET to LONGEST.
2f9ed3
	Expand VAR_OFFSET to LONGEST.
2f9ed3
	(ada_index_struct_field): Expand parameters INDEX and OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(ada_index_struct_field_1): Expand parameters INDEX_P and OFFSET
2f9ed3
	to LONGEST.
2f9ed3
	(ada_value_struct_elt): Expand BYTE_OFFSET to LONGEST.
2f9ed3
	(align_value): Return ULONGEST.  Expand parameter OFF and
2f9ed3
	ALIGNMENT to ULONGEST.
2f9ed3
	(ada_template_to_fixed_record_type_1): Expand OFF, BIT_LEN and
2f9ed3
	fld_bit_len to LONGEST.  Expand FIELD_OFFSET to LONGEST.  Use
2f9ed3
	pulongest function to print TYPE_LENGTH.
2f9ed3
	(to_fixed_array_type): Expand LEN to LONGEST.
2f9ed3
	* ada-lang.h (ada_val_print): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(ada_printstr): Expand parameter LENGTH to ULONGEST.
2f9ed3
	(ada_value_primitive_packed_val): Expand parameter OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	* ada-typeprint.c (ada_print_type): Use pulongest to print
2f9ed3
	TYPE_LENGTH.
2f9ed3
	* ada-valprint.c (val_print_packed_array_elements): Expand ELTLEN
2f9ed3
	to ULONGEST.
2f9ed3
	(char_at): Expand parameter I to LONGEST.
2f9ed3
	(printstr): Expand parameter LENGTH, I, REP1, REPS to ULONGEST.
2f9ed3
	Use pulongest to format print REPS.
2f9ed3
	(ada_printstr): Expand parameter LENGTH to LONGEST.
2f9ed3
	(ada_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
2f9ed3
	(ada_val_print_array): Expand ELTLEN, LEN to ULONGEST and TEMP_LEN
2f9ed3
	to LONGEST.
2f9ed3
	(ada_val_print_1): Expand parameter OFFSET to LONGEST.
2f9ed3
	(print_variant_part): Expand parameters OFFSET and OUTER_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(print_field_values): Likewise.  Expand BIT_POS to LONGEST.
2f9ed3
	* annotate.c (annotate_array_section_begin): Expand parameter
2f9ed3
	IDX to LONGEST.  Use plongest to format-print IDX.
2f9ed3
	(annotate_elt_rep): Expand parameter REPCOUNT to ULONGEST.  Use
2f9ed3
	plongest to format-print REPCOUNT.
2f9ed3
	* annotate.h: Likewise.
2f9ed3
	* arm-linux-nat.c (arm_linux_region_ok_for_hw_watchpoint):
2f9ed3
	Expand parameter parameter LEN to LONGEST.
2f9ed3
	* ax-gdb.c (gen_left_shift): Expand parameter DISTANCE to LONGEST.
2f9ed3
	(gen_offset): Expand parameter OFFSET to LONGEST.
2f9ed3
	(gen_bitfield_ref): Expand parameters START, END to LONGEST.
2f9ed3
	Expand BOUND_START, BOUND_END, OFFSET to LONGEST.
2f9ed3
	(gen_primitive_field): Expand parameter OFFSET to LONGEST.
2f9ed3
	(gen_struct_ref_recursive): Likewise.
2f9ed3
	* ax-general.c (ax_trace_quick): Expand parameter N to LONGEST.
2f9ed3
	* ax.h (ax_trace_quick): Likewise.
2f9ed3
	* breakpoint.c (breakpoint_address_match_range): Expand parameter
2f9ed3
	LEN1 to LONGEST.
2f9ed3
	(can_use_hardware_watchpoint): Expand LEN to LONGEST.
2f9ed3
	* breakpoint.h (struct bp_target_info): Expand member LENGTH to
2f9ed3
	LONGEST.
2f9ed3
	(struct bp_location): Likewise.
2f9ed3
	* c-lang.c (c_printstr): Expand parameter LENGTH to ULONGEST.
2f9ed3
	(evaluate_subexp_c): Expand ELEMENT_SIZE, I to LONGEST.
2f9ed3
	* c-lang.h (c_val_print): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(c_printstr): Expand parameter LENGTH to ULONGEST.
2f9ed3
	(cp_print_value_fields): Expand parameter OFFSET to LONGEST.
2f9ed3
	(cp_print_value_fields_rtti): Likewise.
2f9ed3
	* c-typeprint.c (c_type_print_varspec_suffix): Remove cast down to
2f9ed3
	int and use plongest to print LONGEST.
2f9ed3
	* c-valprint.c (c_val_print): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.  Expand OFFSET to LONGEST, ELTLEN to ULONGEST.
2f9ed3
	(c_value_print): Expand TOP to LONGEST.
2f9ed3
	* cp-abi.c (baseclass_offset): Return LONGEST.  Expand parameter
2f9ed3
	EMBEDDED_OFFSET to LONGEST.  Expand RES to LONGEST.
2f9ed3
	(value_virtual_fn_field): Expand parameter OFFSET to LONGEST.
2f9ed3
	(value_rtti_type): Expand parameter TOP to point to LONGEST.
2f9ed3
	* cp-abi.h (value_virtual_fn_field): Expand OFFSET to LONGEST.
2f9ed3
	(value_rtti_type): Expand TOP to point to LONGEST.
2f9ed3
	(baseclass_offset): Return LONGEST.  Expand parameter
2f9ed3
	EMBEDDED_OFFSET to LONGEST.
2f9ed3
	(struct cp_abi_ops): Expand parameter OFFSET for VIRTUAL_FN_FIELD
2f9ed3
	to LONGEST.  Expand parameter TOP to point to LONGEST in
2f9ed3
	VALUE_RTTI_TYPE.  Return LONGEST from BASECLASS_OFFSET and expand
2f9ed3
	parameter EMBEDDED_OFFSET to LONGEST.
2f9ed3
	* cp-valprint.c (cp_print_value_fields): Expand parameter OFFSET
2f9ed3
	to LONGEST.  Expand I_OFFSET to LONGEST.
2f9ed3
	(cp_print_value_fields_rtti): Expand parameter OFFSET to
2f9ed3
	LONGEST.  Expand TOP to LONGEST.
2f9ed3
	(cp_print_value): Expand parameter OFFSET to LONGEST.  Expand
2f9ed3
	THISOFFSET, BOFFSET to LONGEST.
2f9ed3
	* d-lang.h (d_val_print): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	* d-valprint.c (dynamic_array_type): Likewise.
2f9ed3
	(d_val_print): Likewise.
2f9ed3
	* doublest.c (floatformat_from_length): Expand parameter LEN to
2f9ed3
	LONGEST.  Use plongest to format string for LONGEST.
2f9ed3
	* dwarf2loc.c (copy_bitwise): Expand parameters DEST_OFFSET_BITS,
2f9ed3
	BIT_COUNT to ULONGEST.  Rename parameter SOURCE_OFFSET_BITS to
2f9ed3
	SOURCE_OFFSET and expand to ULONGEST.  New variable
2f9ed3
	SOURCE_OFFSET_BITS.
2f9ed3
	(read_pieced_value): Expand OFFSET, DEST_OFFSET_BITS,
2f9ed3
	SOURCE_OFFSET_BITS, SOURCE_OFFSET to LONGEST.  Expand TYPE_LEN,
2f9ed3
	THIS_SIZE, THIS_SIZE_BITS to ULONGEST.
2f9ed3
	(write_pieced_value): Likewise.
2f9ed3
	(check_pieced_value_bits): Expand parameters BIT_OFFSET and
2f9ed3
	BIT_LENGTH to LONGEST.  Expand THIS_SIZE_BITS to ULONGEST.
2f9ed3
	(check_pieced_value_validity): Expand parameters BIT_OFFSET and
2f9ed3
	BIT_LENGTH to LONGEST.
2f9ed3
	(check_pieced_synthetic_pointer): Likewise.
2f9ed3
	(indirect_pieced_value): Expand BIT_LENGTH, BYTE_OFFSET and
2f9ed3
	BIT_OFFSET to LONGEST.
2f9ed3
	(dwarf2_evaluate_loc_desc_full): Expand N to ULONGEST.
2f9ed3
	* dwarf2read.c (dwarf2_const_value_length_mismatch_complaint):
2f9ed3
	Expand parameters ARG2 and ARG3 to LONGEST.  Use plongest to
2f9ed3
	print ARG2 and ARG3.
2f9ed3
	(dwarf2_add_field): Expand ANONYMOUS_SIZE, BIT_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	* eval.c (evaluate_struct_tuple): Expand BITPOS to LONGEST.
2f9ed3
	(init_array_element): Expand ELEMENT_SIZE to LONGEST.
2f9ed3
	(binop_promote): Expand PROMOTED_LEN1, PROMOTED_LEN2, RESULT_LEN
2f9ed3
	to ULONGEST.
2f9ed3
	(evaluate_subexp_standard): Expand MEM_OFFSET, TOP, ELEMENT_SIZE
2f9ed3
	to LONGEST.
2f9ed3
	* f-lang.c (f_printstr): Expand parameter LENGTH to ULONGEST.
2f9ed3
	* f-lang.h (f_val_print): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	* f-valprint.c (f77_array_offset_tbl): Make LONGEST.
2f9ed3
	(f77_create_arrayprint_offset_tbl): Expand ELTLEN to LONGEST.
2f9ed3
	(f77_print_array_1): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.  Expand I to LONGEST.
2f9ed3
	(f77_print_array): Expand parameter EMBEDDED_OFFSET to LONGEST.
2f9ed3
	(f_val_print): Likewise.  Expand OFFSET to LONGEST.
2f9ed3
	* findvar.c (default_value_from_register): Expand LEN to LONGEST.
2f9ed3
	(read_frame_register_value): Expand OFFSET, REG_OFFSET, LEN,
2f9ed3
	REG_LEN to LONGEST.
2f9ed3
	* frame.c (get_frame_register_bytes): Expand parameter LEN to
2f9ed3
	LONGEST.
2f9ed3
	* frame.h (get_frame_register_bytes): Likewise.
2f9ed3
	* gdbtypes.c (init_type): Expand parameter LENGTH to LONGEST.
2f9ed3
	(is_unique_ancestor_worker): Expand parameters OFFSET,
2f9ed3
	EMBEDDED_OFFSET to LONGEST.  Expand THIS_OFFSET to LONGEST.
2f9ed3
	(is_unique_ancestor): Expand OFFSET to LONGEST.
2f9ed3
	(recursive_dump_type): Use pulongest to format print TYPE_LENGTH.
2f9ed3
	Use plongest to format print TYPE_FIELD_BITPOS.
2f9ed3
	(arch_type): Expand parameter LENGTH to LONGEST.
2f9ed3
	* gdbtypes.h (struct type.main_type.fld_bnds.fields): Expand
2f9ed3
	member BITPOS to LONGEST.
2f9ed3
	(struct type): Expand member LENGTH to ULONGEST.
2f9ed3
	(init_type): Expand parameter LENGTH to LONGEST.
2f9ed3
	(arch_type): Likewise.
2f9ed3
	* gnu-v2-abi.c (gnuv2_virtual_fn_field): Expand parameter OFFSET
2f9ed3
	to LONGEST.
2f9ed3
	(gnuv2_value_rtti_type): Expand parameter TOP to point to LONGEST.
2f9ed3
	(gnuv2_baseclass_offset): Return LONGEST.  Expand parameter
2f9ed3
	EMBEDDED_OFFSET to LONGEST.  Expand FIELD_OFFSET, BOFFSET,
2f9ed3
	FIELD_LENGTH to LONGEST.
2f9ed3
	* gnu-v3-abi.c (build_gdb_vtable_type): Expand OFFSET to LONGEST.
2f9ed3
	(vtable_address_point_offset): Return LONGEST.
2f9ed3
	(gnuv3_rtti_type): Expand parameter TOP_P to point to LONGEST.
2f9ed3
	(gnuv3_virtual_fn_field): Expand parameter OFFSET to LONGEST.
2f9ed3
	(gnuv3_baseclass_offset): Return LONGEST.  Expand parameter
2f9ed3
	EMBEDDED_OFSET to LONGEST.  Expand CUR_BASE_OFFSET, BASE_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(gnuv3_find_method_in): Expand POS to LONGEST.
2f9ed3
	* go-lang.h (go_val_print): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	* go-valprint.c (print_go_string): Likewise.
2f9ed3
	(go_val_print): Likewise.
2f9ed3
	* i386-nat.c (i386_handle_nonaligned_watchpoint): Expand
2f9ed3
	parameter LEN to LONGEST.
2f9ed3
	(i386_region_ok_for_watchpoint): Likewise.
2f9ed3
	* inf-ttrace.c (inf_ttrace_region_ok_for_hw_watchpoint): Expand
2f9ed3
	parameter LEN to LONGEST.
2f9ed3
	* jv-lang.c (java_link_class_type): Expand BOFFSET to LONGEST.
2f9ed3
	(java_printstr): Expand parameter LENGTH to ULONGEST.
2f9ed3
	* jv-lang.h (java_val_print): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	* jv-valprint.c (java_print_value_fields): Expand parameter OFFSET
2f9ed3
	to LONGEST.
2f9ed3
	(java_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
2f9ed3
	* language.c (unk_lang_printstr): Expand parameter LENGTH to
2f9ed3
	ULONGEST.
2f9ed3
	(unk_lang_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
2f9ed3
	* language.h (language_defn): Expand parameter LENGTH of
2f9ed3
	LA_PRINTSTR to ULONGEST.  Expand parameter EMBEDDED_OFFSET of
2f9ed3
	LA_VAL_PRINT to LONGEST.
2f9ed3
	* m2-lang.c (m2_printstr): Expand parameter LENGTH to ULONGEST.
2f9ed3
	Expand I, REP1, REPS to ULONGEST.  Use pulongest to format print
2f9ed3
	REPS.
2f9ed3
	* m2-lang.h (m2_val_print): Expand parameter embedded_offset to
2f9ed3
	LONGEST.
2f9ed3
	* m2-typeprint.c (m2_array): New variable VAL.  Use pulongest to
2f9ed3
	* format print VAL.
2f9ed3
	(m2_enum): expand LASTVAL to LONGEST.
2f9ed3
	* m2-valprint.c (m2_print_long_set): Expand parameter
2f9ed3
	EMBEDDED_OFFSET to LONGEST.
2f9ed3
	(m2_print_unbounded_array): Likewise.
2f9ed3
	(m2_print_array_contents): Likewise.
2f9ed3
	(m2_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
2f9ed3
	Expand I, LEN, TEMP_LEN to ULONGEST.
2f9ed3
	* memrange.c (mem_ranges_overlap): Expand parameters LEN1, LEN2 to
2f9ed3
	LONGEST.
2f9ed3
	* memrange.h (struct mem_range): Expand member LENGTH to LONGEST.
2f9ed3
	(mem_ranges_overlap): Expand parameters LEN1, LEN2 to LONGEST.
2f9ed3
	* mips-linux-nat.c (mips_linux_region_ok_for_hw_watchpoint):
2f9ed3
	Expand parameter LEN to LONGEST.
2f9ed3
	* objc-lang.c (objc_printstr): Expand parameter LENGTH to
2f9ed3
	ULONGEST.  Expand I, REP1, REPS to ULONGEST.  use pulongest to
2f9ed3
	format print REPS.
2f9ed3
	* opencl-lang.c (lookup_opencl_vector_type): Expand parameter
2f9ed3
	EL_LENGTH to ULONGEST.  Expand LENGTH to ULONGEST.
2f9ed3
	(lval_func_read): Expand OFFSET, N, I, J and ELSIZE to LONGEST.
2f9ed3
	(lval_func_write): Likewise.
2f9ed3
	(lval_func_check_validity): Expand parameter LENGTH to LONGEST.
2f9ed3
	Expand ELSIZE, START, END, I, STARTREST, ENDREST, COMP_OFFSET,
2f9ed3
	COMP_LENGTH to LONGEST.
2f9ed3
	(lval_func_check_any_valid): Expand ELSIZE to LONGEST.
2f9ed3
	(lval_func_check_synthetic_pointer): Expand parameters OFFSET and
2f9ed3
	LENGTH to LONGEST.  Expand ELSIZE, START, END, I, STARTREST,
2f9ed3
	ENDREST, COMP_LENGTH, COMP_OFFSET to LONGEST.
2f9ed3
	* p-lang.c (is_pascal_string_type): Expand parameters LENGTH_POS,
2f9ed3
	STRING_POS, LENGTH_SIZE to point to LONGEST.
2f9ed3
	(pascal_printstr): Expand parameter LENGTH to ULONGEST.  Expand
2f9ed3
	I, REP1, REPS to ULONGEST.  Use pulongest to format print REPS.
2f9ed3
	* p-lang.h (pascal_val_print): Expand parameter EMBEDDED_OFFSET
2f9ed3
	to LONGEST.
2f9ed3
	(is_pascal_string_type): Expand parameters LENGTH_POS, STRING_POS,
2f9ed3
	LENGTH_SIZE to point to LONGEST.
2f9ed3
	(pascal_printstr): Expand parameter LENGTH to ULONGEST.
2f9ed3
	(pascal_object_print_value_fields): Expand parameter OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	* p-valprint.c (pascal_val_print): Expand parameter
2f9ed3
	EMBEDDED_OFFSET to LONGEST.  Expand ELTLEN to ULONGEST.  Expand
2f9ed3
	LENGTH_SIZE, LENGTH_POS, STRING_POS to LONGEST.
2f9ed3
	(pascal_object_print_value_fields): Expand parameter OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(pascal_object_print_value): Likewise.  Expand BOFFSET,
2f9ed3
	THISOFFSET to LONGEST.
2f9ed3
	* ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint):
2f9ed3
	Expand parameter LEN to point to LONGEST.
2f9ed3
	* printcmd.c (print_formatted): Expand LEN to LONGEST.
2f9ed3
	(print_scalar_formatted): Likewise.
2f9ed3
	* procfs.c (procfs_region_ok_for_hw_watchpoint): Expand
2f9ed3
	parameter LEN to LONGEST.
2f9ed3
	* python/py-prettyprint.c (apply_val_pretty_printer): Expand
2f9ed3
	parameter EMBEDDED_OFFSET to LONGEST.
2f9ed3
	* python/python.h (apply_val_pretty_printer): Likewise.
2f9ed3
	* regcache.c (regcache_xfer_part): Expand parameter OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(regcache_raw_read_part): Likewise.
2f9ed3
	(regcache_raw_write_part): Likewise.
2f9ed3
	(regcache_cooked_read_part): Likewise.
2f9ed3
	(regcache_cooked_write_part): Likewise.
2f9ed3
	* regcache.h (regcache_raw_read_part): Likewise.
2f9ed3
	(regcache_raw_write_part): Likewise.
2f9ed3
	(regcache_cooked_read_part): Likewise.
2f9ed3
	(regcache_cooked_write_part): Likewise.
2f9ed3
	* remote.c (remote_region_ok_for_hw_watchpoint): Expand
2f9ed3
	parameter LEN to LONGEST.
2f9ed3
	* s390-nat.c (s390_region_ok_for_hw_watchpoint): Expand
2f9ed3
	parameter LEN to LONGEST.
2f9ed3
	* spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Expand
2f9ed3
	parameter len to LONGEST.
2f9ed3
	* stack.c (print_frame_nameless_args): Expand parameter START to
2f9ed3
	LONGEST.
2f9ed3
	(print_frame_args): Expand HIGHEST_OFFSET, CURRENT_OFFSET,
2f9ed3
	ARG_SIZE, START to LONGEST.
2f9ed3
	* symmisc.c (print_symbol): Expand I to ULONGEST.  Use pulongest
2f9ed3
	to format print TYPE_LENGTH.
2f9ed3
	* target.c (default_region_ok_for_hw_watchpoint): Expand parameter
2f9ed3
	LEN to LONGEST.
2f9ed3
	(debug_to_region_ok_for_hw_watchpoint): Likewise.
2f9ed3
	* target.h (struct target_ops): Expand parameter LEN to LONGEST
2f9ed3
	for TO_REGION_OK_FOR_HW_WATCHPOINT.
2f9ed3
	* tracepoint.c (add_memrange): Expand parameter LEN to LONGEST.
2f9ed3
	Use plongest to format print LEN.
2f9ed3
	(collect_symbol): Expand LEN to ULONGEST.  Use pulongest to
2f9ed3
	format print LEN.
2f9ed3
	(scope_info): Expand J to LONGEST.  Use pulongest to format
2f9ed3
	print TYPE_LENGTH.
2f9ed3
	* typeprint.c (whatis_exp): Expand TOP to LONGEST.
2f9ed3
	* valarith.c (value_subscripted_rvalue): Expand parameters INDEX
2f9ed3
	and LOWERBOUND to LONGEST.  Expand ELT_SIZE, ELT_OFFS to ULONGEST.
2f9ed3
	(value_concat): expand INVAL1LEN and INVAL2LEN to ssize_t.
2f9ed3
	(value_logical_not): Expand LEN to LONGEST.
2f9ed3
	(value_strcmp): Expand LEN1, LEN2, I, LEN to LONGEST.
2f9ed3
	* valops.c (value_allocate_space_in_inferior): Expand parameter
2f9ed3
	LEN to LONGEST.
2f9ed3
	(value_cast_structs): Expand TOP to LONGEST.
2f9ed3
	(value_cast): Expand ELEMENT_LENGTH to ULONGEST.  Expand
2f9ed3
	VAL_LENGTH to LONGEST.
2f9ed3
	(dynamic_cast_check_1): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.  Expand OFFSET to LONGEST.
2f9ed3
	(dynamic_cast_check_2): Likewise.
2f9ed3
	(value_dynamic_cast): Expand TOP to LONGEST.
2f9ed3
	(read_value_memory): Expand EMBEDDED_OFFSET to LONGEST.
2f9ed3
	(value_assign): Expand CHANGED_LEN, OFFSET to LONGEST.
2f9ed3
	(value_array): Expand TYPELENGTH to ULONGEST.
2f9ed3
	(update_search_result): Expand parameters LAST_BOFFSET, BOFFSET
2f9ed3
	to LONGEST.
2f9ed3
	(do_search_struct_field): Expand parameter OFFSET, LAST_BOFFSET
2f9ed3
	to LONGEST.  Expand NEW_OFFSET, BOFFSET to LONGEST.
2f9ed3
	(search_struct_field): Expand parameter OFFSET to LONGEST.
2f9ed3
	Expand BOFFSET to LONGEST.
2f9ed3
	(search_struct_method): Expand parameter OFFSET to LONGEST.
2f9ed3
	Expand BASE_OFFSET, THIS_OFFSET to LONGEST.
2f9ed3
	(find_method_list): Expand parameters OFFSET, BOFFSET to
2f9ed3
	LONGEST.  Expand BASE_OFFSET to LONGEST.
2f9ed3
	(value_find_oload_method_list): Expand parameter BOFFSET to point
2f9ed3
	to LONGEST.
2f9ed3
	(find_overload_match): Expand BOFFSET to LONGEST.
2f9ed3
	(value_struct_elt_for_reference): Expand parameter OFFSET to
2f9ed3
	LONGEST.  Remove unneeded cast.  Expand BASE_OFFSET to LONGEST.
2f9ed3
	(value_rtti_indirect_type): Expand parameter TOP to point to
2f9ed3
	LONGEST.
2f9ed3
	(value_full_object): Expand parameter XTOP to LONGEST.  Expand
2f9ed3
	TOP to LONGEST.
2f9ed3
	* valprint.c (valprint_check_validity): Expand parameter
2f9ed3
	EMBEDDED_OFFSET to LONGEST.
2f9ed3
	(generic_val_print): Likewise.
2f9ed3
	(val_print): Likewise.
2f9ed3
	(val_print_scalar_formatted): Likewise.
2f9ed3
	(print_hex_chars): Expand parameter LEN to ULONGEST.
2f9ed3
	(val_print_array_elements): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST, I to ULONGEST.  Expand LEN, ELTLEN, REP1, REPS to
2f9ed3
	ULONGEST.  Use pulongest to format print REPS.
2f9ed3
	(generic_printstr): Expand parameter LENGTH to ULONGEST.
2f9ed3
	* valprint.h (val_print_array_elements): Expand parameter
2f9ed3
	EMBEDDED_OFFSET to LONGEST.
2f9ed3
	(val_print_scalar_formatted): Likewise.
2f9ed3
	(print_hex_chars): Expand parameter LEN to ULONGEST.
2f9ed3
	(generic_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
2f9ed3
	(generic_printstr): Expand parameter LENGTH to ULONGEST.
2f9ed3
	* value.c (struct range): Expand members OFFSET, LENGTH to
2f9ed3
	LONGEST.
2f9ed3
	(ranges_overlap): Expand parameters OFFSET1, OFFSET2, LEN1 AND
2f9ed3
	LEN2 to LONGEST.
2f9ed3
	(range_contain): Expand parameter OFFSET, LENGTH to LONGEST.
2f9ed3
	(struct value): Expand members OFFSET, EMBEDDED_OFFSET,
2f9ed3
	POINTED_TO_OFFSET to LONGEST.
2f9ed3
	(value_bytes_available): Expand parameters OFFSET, LENGTH to
2f9ed3
	LONGEST.
2f9ed3
	(mark_value_bytes_unavailable): Likewise.
2f9ed3
	(find_first_range_overlap): Likewise.
2f9ed3
	(value_available_contents_eq): Expand parameters OFFSET1, OFFSET2
2f9ed3
	and LENGTH to LONGEST.
2f9ed3
	(value_offset): Return LONGEST.
2f9ed3
	(set_value_offset): Expand parameter OFFSET to LONGEST.
2f9ed3
	(value_contents_copy_raw): Expand parameters SRC_OFFSET,
2f9ed3
	DST_OFFSET, LENGTH to ssize_t.
2f9ed3
	(value_contents_copy): Likewise.
2f9ed3
	(value_bits_valid): Expand parameters OFFSET, LENGTH to LONGEST.
2f9ed3
	(value_bits_synthetic_pointer): Likewise.
2f9ed3
	(value_embedded_offset): Return LONGEST.
2f9ed3
	(set_value_embedded_offset): Expand parameter VAL to LONGEST.
2f9ed3
	(value_pointed_to_offset): Return LONGEST.
2f9ed3
	(set_value_pointed_to_offset): Expand parameter VAL to LONGEST.
2f9ed3
	(set_internalvar_component): Expand parameter OFFSET to LONGEST.
2f9ed3
	(value_primitive_field): Likewise.  Expand BITPOS, BOFFSET,
2f9ed3
	CONTAINER_BITSIZE to LONGEST.
2f9ed3
	(value_fn_field): Expand parameter OFFSET to LONGEST.
2f9ed3
	(unpack_value_bits_as_long_1): Expand parameters EMBEDDED_OFFSET,
2f9ed3
	BITPOS to LONGEST.  Expand READ_OFFSET to LONGEST.
2f9ed3
	(unpack_value_bits_as_long): Expand parameter EMBEDED_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(unpack_value_field_as_long_1): Likewise.  Expand BITPOS to
2f9ed3
	LONGEST.
2f9ed3
	(unpack_value_field_as_long): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(value_field_bitfield): Likewise.
2f9ed3
	(modify_field): Expand parameter BITPOS to LONGEST.  Expand
2f9ed3
	BYTESIZE to LONGEST.
2f9ed3
	* value.h (value_offset): Return LONGEST.
2f9ed3
	(set_value_offset): Expand parameter OFFSET to LONGEST.
2f9ed3
	(value_pointed_to_offset): Return LONGEST.
2f9ed3
	(set_value_pointed_to_offset): Expand parameter VAL to LONGEST.
2f9ed3
	(value_embedded_offset): Return LONGEST.
2f9ed3
	(set_value_embedded_offset): Expand parameter VAL to LONGEST.
2f9ed3
	(struct lval_funcs): Expand parameters OFFSET and LENGTH to
2f9ed3
	LONGEST for CHECK_VALIDITY.  Likewise for CHECK_SYNTHETIC_POINTER.
2f9ed3
	(valprint_check_validity): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(value_bits_valid): Expand parameters OFFSET, LENGTH to LONGEST.
2f9ed3
	(value_bits_synthetic_pointer): Likewise.
2f9ed3
	(value_bytes_available): Likewise.
2f9ed3
	(mark_value_bytes_unavailable): Likewise.
2f9ed3
	(value_available_contents_eq): Fix comment.  Expand parameters
2f9ed3
	OFFSET1, OFFSET2, LENGTH to LONGEST.
2f9ed3
	(read_value_memory): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(unpack_value_bits_as_long): Expand parameter EMBEDDED_OFFSET to
2f9ed3
	LONGEST.
2f9ed3
	(unpack_value_field_as_long): Likewise.
2f9ed3
	(value_field_bitfield): Likewise.
2f9ed3
	(value_contents_copy_raw): Expand parameters SRC_OFFSET,
2f9ed3
	DST_OFFSET, LENGTH to LONGEST.
2f9ed3
	(value_contents_copy): Likewise.
2f9ed3
	(value_primitive_field): Expand parameter OFFSET to LONGEST.
2f9ed3
	(value_rtti_indirect_type): Expand parameter TOP to point to
2f9ed3
	LONGEST.
2f9ed3
	(value_full_object): Expand parameter XTOP to LONGEST.
2f9ed3
	(set_internalvar_component): Expand parameter OFFSET to LONGEST.
2f9ed3
	(value_fn_field): Expand parameter OFFSET to LONGEST.
2f9ed3
	(modify_field): Expand parameter BITPOS to LONGEST.
2f9ed3
	(val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
2f9ed3
	(value_allocate_space_in_inferior): Expand parameter LEN to
2f9ed3
	LONGEST.
2f9ed3
2f9ed3
gdb/testsuite/ChangeLog:
2f9ed3
2f9ed3
2012-08-05  Siddhesh Poyarekar  <siddhesh@redhat.com>
2f9ed3
2f9ed3
	* gdb.base/longest-types.exp: Add test case to get offset of
2f9ed3
	BUF2.
2f9ed3
2f9ed3
--MP_/yp5f+W_ED2JtUlSyBi8xujr
2f9ed3
Content-Type: text/x-patch
2f9ed3
Content-Transfer-Encoding: 7bit
2f9ed3
Content-Disposition: attachment; filename=bitpos-main.patch
2f9ed3
2f9ed3
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
2f9ed3
--- a/gdb/aarch64-linux-nat.c
2f9ed3
+++ b/gdb/aarch64-linux-nat.c
2f9ed3
@@ -808,7 +808,7 @@ aarch64_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len,
2f9ed3
 /* Implement the "region_ok_for_hw_watchpoint" target_ops method.  */
2f9ed3
 
2f9ed3
 int
2f9ed3
-aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
2f9ed3
+aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
2f9ed3
 {
2f9ed3
   return aarch64_linux_region_ok_for_watchpoint (addr, len);
2f9ed3
 }
2f9ed3
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
2f9ed3
--- a/gdb/ada-lang.c
2f9ed3
+++ b/gdb/ada-lang.c
2f9ed3
@@ -78,7 +78,7 @@ static struct type *desc_bounds_type (struct type *);
2f9ed3
 
2f9ed3
 static struct value *desc_bounds (struct value *);
2f9ed3
 
2f9ed3
-static int fat_pntr_bounds_bitpos (struct type *);
2f9ed3
+static LONGEST fat_pntr_bounds_bitpos (struct type *);
2f9ed3
 
2f9ed3
 static int fat_pntr_bounds_bitsize (struct type *);
2f9ed3
 
2f9ed3
@@ -86,13 +86,13 @@ static struct type *desc_data_target_type (struct type *);
2f9ed3
 
2f9ed3
 static struct value *desc_data (struct value *);
2f9ed3
 
2f9ed3
-static int fat_pntr_data_bitpos (struct type *);
2f9ed3
+static LONGEST fat_pntr_data_bitpos (struct type *);
2f9ed3
 
2f9ed3
 static int fat_pntr_data_bitsize (struct type *);
2f9ed3
 
2f9ed3
 static struct value *desc_one_bound (struct value *, int, int);
2f9ed3
 
2f9ed3
-static int desc_bound_bitpos (struct type *, int, int);
2f9ed3
+static LONGEST desc_bound_bitpos (struct type *, int, int);
2f9ed3
 
2f9ed3
 static int desc_bound_bitsize (struct type *, int, int);
2f9ed3
 
2f9ed3
@@ -175,7 +175,7 @@ static struct type *static_unwrap_type (struct type *type);
2f9ed3
 
2f9ed3
 static struct value *unwrap_value (struct value *);
2f9ed3
 
2f9ed3
-static struct type *constrained_packed_array_type (struct type *, long *);
2f9ed3
+static struct type *constrained_packed_array_type (struct type *, LONGEST *);
2f9ed3
 
2f9ed3
 static struct type *decode_constrained_packed_array_type (struct type *);
2f9ed3
 
2f9ed3
@@ -214,14 +214,14 @@ static struct value *value_val_atr (struct type *, struct value *);
2f9ed3
 static struct symbol *standard_lookup (const char *, const struct block *,
2f9ed3
                                        domain_enum);
2f9ed3
 
2f9ed3
-static struct value *ada_search_struct_field (const char *, struct value *, int,
2f9ed3
+static struct value *ada_search_struct_field (const char *, struct value *, LONGEST,
2f9ed3
                                               struct type *);
2f9ed3
 
2f9ed3
-static struct value *ada_value_primitive_field (struct value *, int, int,
2f9ed3
+static struct value *ada_value_primitive_field (struct value *, LONGEST, int,
2f9ed3
                                                 struct type *);
2f9ed3
 
2f9ed3
-static int find_struct_field (const char *, struct type *, int,
2f9ed3
-                              struct type **, int *, int *, int *, int *);
2f9ed3
+static int find_struct_field (const char *, struct type *, LONGEST,
2f9ed3
+                              struct type **, LONGEST *, int *, int *, int *);
2f9ed3
 
2f9ed3
 static int ada_resolve_function (struct block_symbol *, int,
2f9ed3
                                  struct value **, int, const char *,
2f9ed3
@@ -232,7 +232,7 @@ static int ada_is_direct_array_type (struct type *);
2f9ed3
 static void ada_language_arch_info (struct gdbarch *,
2f9ed3
 				    struct language_arch_info *);
2f9ed3
 
2f9ed3
-static struct value *ada_index_struct_field (int, struct value *, int,
2f9ed3
+static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST,
2f9ed3
 					     struct type *);
2f9ed3
 
2f9ed3
 static struct value *assign_aggregate (struct value *, struct value *, 
2f9ed3
@@ -701,7 +701,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type)
2f9ed3
 }
2f9ed3
 
2f9ed3
 static const gdb_byte *
2f9ed3
-cond_offset_host (const gdb_byte *valaddr, long offset)
2f9ed3
+cond_offset_host (const gdb_byte *valaddr, LONGEST offset)
2f9ed3
 {
2f9ed3
   if (valaddr == NULL)
2f9ed3
     return NULL;
2f9ed3
@@ -710,7 +710,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset)
2f9ed3
 }
2f9ed3
 
2f9ed3
 static CORE_ADDR
2f9ed3
-cond_offset_target (CORE_ADDR address, long offset)
2f9ed3
+cond_offset_target (CORE_ADDR address, LONGEST offset)
2f9ed3
 {
2f9ed3
   if (address == 0)
2f9ed3
     return 0;
2f9ed3
@@ -1752,7 +1752,7 @@ desc_bounds (struct value *arr)
2f9ed3
 /* If TYPE is the type of an array-descriptor (fat pointer),  the bit
2f9ed3
    position of the field containing the address of the bounds data.  */
2f9ed3
 
2f9ed3
-static int
2f9ed3
+static LONGEST
2f9ed3
 fat_pntr_bounds_bitpos (struct type *type)
2f9ed3
 {
2f9ed3
   return TYPE_FIELD_BITPOS (desc_base_type (type), 1);
2f9ed3
@@ -1818,7 +1818,7 @@ desc_data (struct value *arr)
2f9ed3
 /* If TYPE is the type of an array-descriptor (fat pointer), the bit
2f9ed3
    position of the field containing the address of the data.  */
2f9ed3
 
2f9ed3
-static int
2f9ed3
+static LONGEST
2f9ed3
 fat_pntr_data_bitpos (struct type *type)
2f9ed3
 {
2f9ed3
   return TYPE_FIELD_BITPOS (desc_base_type (type), 0);
2f9ed3
@@ -1853,7 +1853,7 @@ desc_one_bound (struct value *bounds, int i, int which)
2f9ed3
    of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
2f9ed3
    bound, if WHICH is 1.  The first bound is I=1.  */
2f9ed3
 
2f9ed3
-static int
2f9ed3
+static LONGEST
2f9ed3
 desc_bound_bitpos (struct type *type, int i, int which)
2f9ed3
 {
2f9ed3
   return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2);
2f9ed3
@@ -2043,7 +2043,7 @@ ada_type_of_array (struct value *arr, int bounds)
2f9ed3
 	         zero, and does not need to be recomputed.  */
2f9ed3
 	      if (lo < hi)
2f9ed3
 		{
2f9ed3
-		  int array_bitsize =
2f9ed3
+		  LONGEST array_bitsize =
2f9ed3
 		        (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0);
2f9ed3
 
2f9ed3
 		  TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8;
2f9ed3
@@ -2203,7 +2203,7 @@ decode_packed_array_bitsize (struct type *type)
2f9ed3
    the length is arbitrary.  */
2f9ed3
 
2f9ed3
 static struct type *
2f9ed3
-constrained_packed_array_type (struct type *type, long *elt_bits)
2f9ed3
+constrained_packed_array_type (struct type *type, LONGEST *elt_bits)
2f9ed3
 {
2f9ed3
   struct type *new_elt_type;
2f9ed3
   struct type *new_type;
2f9ed3
@@ -2257,7 +2257,7 @@ decode_constrained_packed_array_type (struct type *type)
2f9ed3
   char *name;
2f9ed3
   const char *tail;
2f9ed3
   struct type *shadow_type;
2f9ed3
-  long bits;
2f9ed3
+  LONGEST bits;
2f9ed3
 
2f9ed3
   if (!raw_name)
2f9ed3
     raw_name = ada_type_name (desc_base_type (type));
2f9ed3
@@ -2328,7 +2328,8 @@ decode_constrained_packed_array (struct value *arr)
2f9ed3
  	 array with no wrapper.  In order to interpret the value through
2f9ed3
  	 the (left-justified) packed array type we just built, we must
2f9ed3
  	 first left-justify it.  */
2f9ed3
-      int bit_size, bit_pos;
2f9ed3
+      int bit_size;
2f9ed3
+      LONGEST bit_pos;
2f9ed3
       ULONGEST mod;
2f9ed3
 
2f9ed3
       mod = ada_modulus (value_type (arr)) - 1;
2f9ed3
@@ -2556,7 +2557,7 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size,
2f9ed3
 
2f9ed3
 struct value *
2f9ed3
 ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
2f9ed3
-				long offset, int bit_offset, int bit_size,
2f9ed3
+				LONGEST offset, int bit_offset, int bit_size,
2f9ed3
                                 struct type *type)
2f9ed3
 {
2f9ed3
   struct value *v;
2f9ed3
@@ -2626,7 +2627,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
2f9ed3
 
2f9ed3
   if (obj != NULL)
2f9ed3
     {
2f9ed3
-      long new_offset = offset;
2f9ed3
+      LONGEST new_offset = offset;
2f9ed3
 
2f9ed3
       set_value_component_location (v, obj);
2f9ed3
       set_value_bitpos (v, bit_offset + value_bitpos (obj));
2f9ed3
@@ -2696,7 +2697,7 @@ ada_value_assign (struct value *toval, struct value *fromval)
2f9ed3
     {
2f9ed3
       int len = (value_bitpos (toval)
2f9ed3
 		 + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
2f9ed3
-      int from_size;
2f9ed3
+      LONGEST from_size;
2f9ed3
       gdb_byte *buffer = (gdb_byte *) alloca (len);
2f9ed3
       struct value *val;
2f9ed3
       CORE_ADDR to_addr = value_address (toval);
2f9ed3
@@ -2747,7 +2748,7 @@ value_assign_to_component (struct value *container, struct value *component,
2f9ed3
     (LONGEST)  (value_address (component) - value_address (container));
2f9ed3
   int bit_offset_in_container =
2f9ed3
     value_bitpos (component) - value_bitpos (container);
2f9ed3
-  int bits;
2f9ed3
+  LONGEST bits;
2f9ed3
 
2f9ed3
   val = value_cast (value_type (component), val);
2f9ed3
 
2f9ed3
@@ -4445,7 +4446,7 @@ ensure_lval (struct value *val)
2f9ed3
   if (VALUE_LVAL (val) == not_lval
2f9ed3
       || VALUE_LVAL (val) == lval_internalvar)
2f9ed3
     {
2f9ed3
-      int len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
2f9ed3
+      LONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
2f9ed3
       const CORE_ADDR addr =
2f9ed3
         value_as_long (value_allocate_space_in_inferior (len));
2f9ed3
 
2f9ed3
@@ -4529,7 +4530,7 @@ static CORE_ADDR
2f9ed3
 value_pointer (struct value *value, struct type *type)
2f9ed3
 {
2f9ed3
   struct gdbarch *gdbarch = get_type_arch (type);
2f9ed3
-  unsigned len = TYPE_LENGTH (type);
2f9ed3
+  ULONGEST len = TYPE_LENGTH (type);
2f9ed3
   gdb_byte *buf = (gdb_byte *) alloca (len);
2f9ed3
   CORE_ADDR addr;
2f9ed3
 
2f9ed3
@@ -6642,7 +6643,7 @@ value_tag_from_contents_and_address (struct type *type,
2f9ed3
 				     const gdb_byte *valaddr,
2f9ed3
                                      CORE_ADDR address)
2f9ed3
 {
2f9ed3
-  int tag_byte_offset;
2f9ed3
+  LONGEST tag_byte_offset;
2f9ed3
   struct type *tag_type;
2f9ed3
 
2f9ed3
   if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
2f9ed3
@@ -7135,7 +7136,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num)
2f9ed3
    only in that it can handle packed values of arbitrary type.  */
2f9ed3
 
2f9ed3
 static struct value *
2f9ed3
-ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
2f9ed3
+ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno,
2f9ed3
                            struct type *arg_type)
2f9ed3
 {
2f9ed3
   struct type *type;
2f9ed3
@@ -7147,7 +7148,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
2f9ed3
 
2f9ed3
   if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0)
2f9ed3
     {
2f9ed3
-      int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
2f9ed3
+      LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
2f9ed3
       int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
2f9ed3
 
2f9ed3
       return ada_value_primitive_packed_val (arg1, value_contents (arg1),
2f9ed3
@@ -7224,9 +7225,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
2f9ed3
    Returns 1 if found, 0 otherwise.  */
2f9ed3
 
2f9ed3
 static int
2f9ed3
-find_struct_field (const char *name, struct type *type, int offset,
2f9ed3
+find_struct_field (const char *name, struct type *type, LONGEST offset,
2f9ed3
                    struct type **field_type_p,
2f9ed3
-                   int *byte_offset_p, int *bit_offset_p, int *bit_size_p,
2f9ed3
+		   LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p,
2f9ed3
 		   int *index_p)
2f9ed3
 {
2f9ed3
   int i;
2f9ed3
@@ -7245,8 +7246,8 @@ find_struct_field (const char *name, struct type *type, int offset,
2f9ed3
 
2f9ed3
   for (i = 0; i < TYPE_NFIELDS (type); i += 1)
2f9ed3
     {
2f9ed3
-      int bit_pos = TYPE_FIELD_BITPOS (type, i);
2f9ed3
-      int fld_offset = offset + bit_pos / 8;
2f9ed3
+      LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
2f9ed3
+      LONGEST fld_offset = offset + bit_pos / 8;
2f9ed3
       const char *t_field_name = TYPE_FIELD_NAME (type, i);
2f9ed3
 
2f9ed3
       if (t_field_name == NULL)
2f9ed3
@@ -7348,7 +7349,7 @@ num_visible_fields (struct type *type)
2f9ed3
    long explanation in find_struct_field's function documentation.  */
2f9ed3
 
2f9ed3
 static struct value *
2f9ed3
-ada_search_struct_field (const char *name, struct value *arg, int offset,
2f9ed3
+ada_search_struct_field (const char *name, struct value *arg, LONGEST offset,
2f9ed3
                          struct type *type)
2f9ed3
 {
2f9ed3
   int i;
2f9ed3
@@ -7396,7 +7397,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset,
2f9ed3
           int j;
2f9ed3
           struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type,
2f9ed3
 									i));
2f9ed3
-          int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
2f9ed3
+	  LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
2f9ed3
 
2f9ed3
           for (j = 0; j < TYPE_NFIELDS (field_type); j += 1)
2f9ed3
             {
2f9ed3
@@ -7428,8 +7429,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset,
2f9ed3
   return NULL;
2f9ed3
 }
2f9ed3
 
2f9ed3
-static struct value *ada_index_struct_field_1 (int *, struct value *,
2f9ed3
-					       int, struct type *);
2f9ed3
+static struct value *ada_index_struct_field_1 (LONGEST *, struct value *,
2f9ed3
+					       LONGEST, struct type *);
2f9ed3
 
2f9ed3
 
2f9ed3
 /* Return field #INDEX in ARG, where the index is that returned by
2f9ed3
@@ -7438,7 +7439,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *,
2f9ed3
  * If found, return value, else return NULL.  */
2f9ed3
 
2f9ed3
 static struct value *
2f9ed3
-ada_index_struct_field (int index, struct value *arg, int offset,
2f9ed3
+ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset,
2f9ed3
 			struct type *type)
2f9ed3
 {
2f9ed3
   return ada_index_struct_field_1 (&index, arg, offset, type);
2f9ed3
@@ -7450,7 +7451,7 @@ ada_index_struct_field (int index, struct value *arg, int offset,
2f9ed3
  * *INDEX_P.  */
2f9ed3
 
2f9ed3
 static struct value *
2f9ed3
-ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
2f9ed3
+ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset,
2f9ed3
 			  struct type *type)
2f9ed3
 {
2f9ed3
   int i;
2f9ed3
@@ -7541,7 +7542,8 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err)
2f9ed3
     v = ada_search_struct_field (name, arg, 0, t);
2f9ed3
   else
2f9ed3
     {
2f9ed3
-      int bit_offset, bit_size, byte_offset;
2f9ed3
+      int bit_offset, bit_size;
2f9ed3
+      LONGEST byte_offset;
2f9ed3
       struct type *field_type;
2f9ed3
       CORE_ADDR address;
2f9ed3
 
2f9ed3
@@ -7890,8 +7892,8 @@ ada_coerce_ref (struct value *val0)
2f9ed3
 /* Return OFF rounded upward if necessary to a multiple of
2f9ed3
    ALIGNMENT (a power of 2).  */
2f9ed3
 
2f9ed3
-static unsigned int
2f9ed3
-align_value (unsigned int off, unsigned int alignment)
2f9ed3
+static ULONGEST
2f9ed3
+align_value (ULONGEST off, ULONGEST alignment)
2f9ed3
 {
2f9ed3
   return (off + alignment - 1) & ~(alignment - 1);
2f9ed3
 }
2f9ed3
@@ -8281,10 +8283,9 @@ ada_template_to_fixed_record_type_1 (struct type *type,
2f9ed3
   struct value *mark = value_mark ();
2f9ed3
   struct value *dval;
2f9ed3
   struct type *rtype;
2f9ed3
-  int nfields, bit_len;
2f9ed3
+  int nfields;
2f9ed3
   int variant_field;
2f9ed3
-  long off;
2f9ed3
-  int fld_bit_len;
2f9ed3
+  LONGEST off, bit_len, fld_bit_len;
2f9ed3
   int f;
2f9ed3
 
2f9ed3
   /* Compute the number of fields in this record type that are going
2f9ed3
@@ -8361,7 +8362,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
2f9ed3
 	     that follow this one.  */
2f9ed3
 	  if (ada_is_aligner_type (field_type))
2f9ed3
 	    {
2f9ed3
-	      long field_offset = TYPE_FIELD_BITPOS (field_type, f);
2f9ed3
+	      LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f);
2f9ed3
 
2f9ed3
 	      field_valaddr = cond_offset_host (field_valaddr, field_offset);
2f9ed3
 	      field_address = cond_offset_target (field_address, field_offset);
2f9ed3
@@ -8497,11 +8498,11 @@ ada_template_to_fixed_record_type_1 (struct type *type,
2f9ed3
   if (TYPE_LENGTH (type) <= 0)
2f9ed3
     {
2f9ed3
       if (TYPE_NAME (rtype))
2f9ed3
-	warning (_("Invalid type size for `%s' detected: %d."),
2f9ed3
-		 TYPE_NAME (rtype), TYPE_LENGTH (type));
2f9ed3
+	warning (_("Invalid type size for `%s' detected: %s."),
2f9ed3
+		 TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type)));
2f9ed3
       else
2f9ed3
-	warning (_("Invalid type size for <unnamed> detected: %d."),
2f9ed3
-		 TYPE_LENGTH (type));
2f9ed3
+	warning (_("Invalid type size for <unnamed> detected: %s."),
2f9ed3
+		 pulongest (TYPE_LENGTH (type)));
2f9ed3
     }
2f9ed3
   else
2f9ed3
     {
2f9ed3
@@ -8965,7 +8966,8 @@ to_fixed_array_type (struct type *type0, struct value *dval,
2f9ed3
 	 type was a regular (non-packed) array type.  As a result, the
2f9ed3
 	 bitsize of the array elements needs to be set again, and the array
2f9ed3
 	 length needs to be recomputed based on that bitsize.  */
2f9ed3
-      int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result));
2f9ed3
+      LONGEST len = (TYPE_LENGTH (result)
2f9ed3
+		     / TYPE_LENGTH (TYPE_TARGET_TYPE (result)));
2f9ed3
       int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0);
2f9ed3
 
2f9ed3
       TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0);
2f9ed3
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
2f9ed3
--- a/gdb/ada-lang.h
2f9ed3
+++ b/gdb/ada-lang.h
2f9ed3
@@ -173,7 +173,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int,
2f9ed3
 extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
2f9ed3
 			       struct ui_file *stream);
2f9ed3
 
2f9ed3
-extern void ada_val_print (struct type *, int, CORE_ADDR,
2f9ed3
+extern void ada_val_print (struct type *, LONGEST, CORE_ADDR,
2f9ed3
 			   struct ui_file *, int,
2f9ed3
 			   struct value *,
2f9ed3
 			   const struct value_print_options *);
2f9ed3
@@ -188,7 +188,7 @@ extern void ada_emit_char (int, struct type *, struct ui_file *, int, int);
2f9ed3
 extern void ada_printchar (int, struct type *, struct ui_file *);
2f9ed3
 
2f9ed3
 extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *,
2f9ed3
-			  unsigned int, const char *, int,
2f9ed3
+			  ULONGEST, const char *, int,
2f9ed3
 			  const struct value_print_options *);
2f9ed3
 
2f9ed3
 struct value *ada_convert_actual (struct value *actual,
2f9ed3
@@ -263,7 +263,7 @@ extern int ada_is_constrained_packed_array_type (struct type *);
2f9ed3
 
2f9ed3
 extern struct value *ada_value_primitive_packed_val (struct value *,
2f9ed3
 						     const gdb_byte *,
2f9ed3
-                                                     long, int, int,
2f9ed3
+						     LONGEST, int, int,
2f9ed3
                                                      struct type *);
2f9ed3
 
2f9ed3
 extern struct type *ada_coerce_to_simple_array_type (struct type *);
2f9ed3
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
2f9ed3
--- a/gdb/ada-typeprint.c
2f9ed3
+++ b/gdb/ada-typeprint.c
2f9ed3
@@ -895,8 +895,8 @@ ada_print_type (struct type *type0, const char *varstring,
2f9ed3
 	    const char *name = ada_type_name (type);
2f9ed3
 
2f9ed3
 	    if (!ada_is_range_type_name (name))
2f9ed3
-	      fprintf_filtered (stream, _("<%d-byte integer>"),
2f9ed3
-				TYPE_LENGTH (type));
2f9ed3
+	      fprintf_filtered (stream, _("<%s-byte integer>"),
2f9ed3
+				pulongest (TYPE_LENGTH (type)));
2f9ed3
 	    else
2f9ed3
 	      {
2f9ed3
 		fprintf_filtered (stream, "range ");
2f9ed3
@@ -917,7 +917,8 @@ ada_print_type (struct type *type0, const char *varstring,
2f9ed3
 	  }
2f9ed3
 	break;
2f9ed3
       case TYPE_CODE_FLT:
2f9ed3
-	fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type));
2f9ed3
+	fprintf_filtered (stream, _("<%s-byte float>"),
2f9ed3
+			  pulongest (TYPE_LENGTH (type)));
2f9ed3
 	break;
2f9ed3
       case TYPE_CODE_ENUM:
2f9ed3
 	if (show < 0)
2f9ed3
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
2f9ed3
--- a/gdb/ada-valprint.c
2f9ed3
+++ b/gdb/ada-valprint.c
2f9ed3
@@ -34,11 +34,11 @@
2f9ed3
 #include "target-float.h"
2f9ed3
 
2f9ed3
 static int print_field_values (struct type *, const gdb_byte *,
2f9ed3
-			       int,
2f9ed3
+			       LONGEST,
2f9ed3
 			       struct ui_file *, int,
2f9ed3
 			       struct value *,
2f9ed3
 			       const struct value_print_options *,
2f9ed3
-			       int, struct type *, int,
2f9ed3
+			       int, struct type *, LONGEST,
2f9ed3
 			       const struct language_defn *);
2f9ed3
 
2f9ed3
 
2f9ed3
@@ -316,7 +316,7 @@ ada_emit_char (int c, struct type *type, struct ui_file *stream,
2f9ed3
    of a character.  */
2f9ed3
 
2f9ed3
 static int
2f9ed3
-char_at (const gdb_byte *string, int i, int type_len,
2f9ed3
+char_at (const gdb_byte *string, LONGEST i, int type_len,
2f9ed3
 	 enum bfd_endian byte_order)
2f9ed3
 {
2f9ed3
   if (type_len == 1)
2f9ed3
@@ -476,11 +476,11 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
2f9ed3
 
2f9ed3
 static void
2f9ed3
 printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
2f9ed3
-	  unsigned int length, int force_ellipses, int type_len,
2f9ed3
+	  ULONGEST length, int force_ellipses, int type_len,
2f9ed3
 	  const struct value_print_options *options)
2f9ed3
 {
2f9ed3
   enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype));
2f9ed3
-  unsigned int i;
2f9ed3
+  ULONGEST i;
2f9ed3
   unsigned int things_printed = 0;
2f9ed3
   int in_quotes = 0;
2f9ed3
   int need_comma = 0;
2f9ed3
@@ -495,9 +495,9 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
2f9ed3
     {
2f9ed3
       /* Position of the character we are examining
2f9ed3
          to see whether it is repeated.  */
2f9ed3
-      unsigned int rep1;
2f9ed3
+      ULONGEST rep1;
2f9ed3
       /* Number of repetitions we have detected so far.  */
2f9ed3
-      unsigned int reps;
2f9ed3
+      ULONGEST reps;
2f9ed3
 
2f9ed3
       QUIT;
2f9ed3
 
2f9ed3
@@ -528,7 +528,8 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
2f9ed3
 	  ada_emit_char (char_at (string, i, type_len, byte_order),
2f9ed3
 			 elttype, stream, '\'', type_len);
2f9ed3
 	  fputs_filtered ("'", stream);
2f9ed3
-	  fprintf_filtered (stream, _(" <repeats %u times>"), reps);
2f9ed3
+	  fprintf_filtered (stream, _(" <repeats %s times>"),
2f9ed3
+			    pulongest (reps));
2f9ed3
 	  i = rep1 - 1;
2f9ed3
 	  things_printed += options->repeat_count_threshold;
2f9ed3
 	  need_comma = 1;
2f9ed3
@@ -556,7 +557,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
2f9ed3
 
2f9ed3
 void
2f9ed3
 ada_printstr (struct ui_file *stream, struct type *type,
2f9ed3
-	      const gdb_byte *string, unsigned int length,
2f9ed3
+	      const gdb_byte *string, ULONGEST length,
2f9ed3
 	      const char *encoding, int force_ellipses,
2f9ed3
 	      const struct value_print_options *options)
2f9ed3
 {
2f9ed3
@@ -566,12 +567,12 @@ ada_printstr (struct ui_file *stream, struct type *type,
2f9ed3
 
2f9ed3
 static int
2f9ed3
 print_variant_part (struct type *type, int field_num,
2f9ed3
-		    const gdb_byte *valaddr, int offset,
2f9ed3
+		    const gdb_byte *valaddr, LONGEST offset,
2f9ed3
 		    struct ui_file *stream, int recurse,
2f9ed3
 		    struct value *val,
2f9ed3
 		    const struct value_print_options *options,
2f9ed3
 		    int comma_needed,
2f9ed3
-		    struct type *outer_type, int outer_offset,
2f9ed3
+		    struct type *outer_type, LONGEST outer_offset,
2f9ed3
 		    const struct language_defn *language)
2f9ed3
 {
2f9ed3
   struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
2f9ed3
@@ -607,11 +608,11 @@ print_variant_part (struct type *type, int field_num,
2f9ed3
 
2f9ed3
 static int
2f9ed3
 print_field_values (struct type *type, const gdb_byte *valaddr,
2f9ed3
-		    int offset, struct ui_file *stream, int recurse,
2f9ed3
+		    LONGEST offset, struct ui_file *stream, int recurse,
2f9ed3
 		    struct value *val,
2f9ed3
 		    const struct value_print_options *options,
2f9ed3
 		    int comma_needed,
2f9ed3
-		    struct type *outer_type, int outer_offset,
2f9ed3
+		    struct type *outer_type, LONGEST outer_offset,
2f9ed3
 		    const struct language_defn *language)
2f9ed3
 {
2f9ed3
   int i, len;
2f9ed3
@@ -677,7 +678,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
2f9ed3
 	  else
2f9ed3
 	    {
2f9ed3
 	      struct value *v;
2f9ed3
-	      int bit_pos = TYPE_FIELD_BITPOS (type, i);
2f9ed3
+	      LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
2f9ed3
 	      int bit_size = TYPE_FIELD_BITSIZE (type, i);
2f9ed3
 	      struct value_print_options opts;
2f9ed3
 
2f9ed3
@@ -722,8 +723,8 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr,
2f9ed3
 {
2f9ed3
   enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
2f9ed3
   struct type *elttype = TYPE_TARGET_TYPE (type);
2f9ed3
-  unsigned int eltlen;
2f9ed3
-  unsigned int len;
2f9ed3
+  ULONGEST eltlen;
2f9ed3
+  ULONGEST len;
2f9ed3
 
2f9ed3
   /* We know that ELTTYPE cannot possibly be null, because we assume
2f9ed3
      that we're called only when TYPE is a string-like type.
2f9ed3
@@ -742,7 +743,7 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr,
2f9ed3
      elements up to it.  */
2f9ed3
   if (options->stop_print_at_null)
2f9ed3
     {
2f9ed3
-      int temp_len;
2f9ed3
+      LONGEST temp_len;
2f9ed3
 
2f9ed3
       /* Look for a NULL char.  */
2f9ed3
       for (temp_len = 0;
2f9ed3
@@ -1115,7 +1116,7 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr,
2f9ed3
 
2f9ed3
 static void
2f9ed3
 ada_val_print_1 (struct type *type,
2f9ed3
-		 int offset, CORE_ADDR address,
2f9ed3
+		 LONGEST offset, CORE_ADDR address,
2f9ed3
 		 struct ui_file *stream, int recurse,
2f9ed3
 		 struct value *original_value,
2f9ed3
 		 const struct value_print_options *options,
2f9ed3
@@ -1199,7 +1200,7 @@ ada_val_print_1 (struct type *type,
2f9ed3
 
2f9ed3
 void
2f9ed3
 ada_val_print (struct type *type,
2f9ed3
-	       int embedded_offset, CORE_ADDR address,
2f9ed3
+	       LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 	       struct ui_file *stream, int recurse,
2f9ed3
 	       struct value *val,
2f9ed3
 	       const struct value_print_options *options)
2f9ed3
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
2f9ed3
--- a/gdb/amd64-tdep.c
2f9ed3
+++ b/gdb/amd64-tdep.c
2f9ed3
@@ -732,7 +732,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
2f9ed3
 		    gdb_byte *readbuf, const gdb_byte *writebuf)
2f9ed3
 {
2f9ed3
   enum amd64_reg_class theclass[2];
2f9ed3
-  int len = TYPE_LENGTH (type);
2f9ed3
+  LONGEST len = TYPE_LENGTH (type);
2f9ed3
   static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
2f9ed3
   static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM };
2f9ed3
   int integer_reg = 0;
2f9ed3
@@ -849,10 +849,10 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
2f9ed3
       gdb_assert (regnum != -1);
2f9ed3
 
2f9ed3
       if (readbuf)
2f9ed3
-	regcache->raw_read_part (regnum, offset, std::min (len, 8),
2f9ed3
+	regcache->raw_read_part (regnum, offset, std::min (len, (LONGEST) 8),
2f9ed3
 				 readbuf + i * 8);
2f9ed3
       if (writebuf)
2f9ed3
-	regcache->raw_write_part (regnum, offset, std::min (len, 8),
2f9ed3
+	regcache->raw_write_part (regnum, offset, std::min (len, (LONGEST) 8),
2f9ed3
 				  writebuf + i * 8);
2f9ed3
     }
2f9ed3
 
2f9ed3
diff --git a/gdb/annotate.c b/gdb/annotate.c
2f9ed3
--- a/gdb/annotate.c
2f9ed3
+++ b/gdb/annotate.c
2f9ed3
@@ -531,21 +531,21 @@ annotate_frame_end (void)
2f9ed3
 }
2f9ed3
 
2f9ed3
 void
2f9ed3
-annotate_array_section_begin (int idx, struct type *elttype)
2f9ed3
+annotate_array_section_begin (LONGEST idx, struct type *elttype)
2f9ed3
 {
2f9ed3
   if (annotation_level == 2)
2f9ed3
     {
2f9ed3
-      printf_filtered (("\n\032\032array-section-begin %d "), idx);
2f9ed3
+      printf_filtered (("\n\032\032array-section-begin %s "), plongest (idx));
2f9ed3
       print_value_flags (elttype);
2f9ed3
       printf_filtered (("\n"));
2f9ed3
     }
2f9ed3
 }
2f9ed3
 
2f9ed3
 void
2f9ed3
-annotate_elt_rep (unsigned int repcount)
2f9ed3
+annotate_elt_rep (ULONGEST repcount)
2f9ed3
 {
2f9ed3
   if (annotation_level == 2)
2f9ed3
-    printf_filtered (("\n\032\032elt-rep %u\n"), repcount);
2f9ed3
+    printf_filtered (("\n\032\032elt-rep %s\n"), pulongest (repcount));
2f9ed3
 }
2f9ed3
 
2f9ed3
 void
2f9ed3
diff --git a/gdb/annotate.h b/gdb/annotate.h
2f9ed3
--- a/gdb/annotate.h
2f9ed3
+++ b/gdb/annotate.h
2f9ed3
@@ -105,8 +105,8 @@ extern void annotate_frame_source_end (void);
2f9ed3
 extern void annotate_frame_where (void);
2f9ed3
 extern void annotate_frame_end (void);
2f9ed3
 
2f9ed3
-extern void annotate_array_section_begin (int, struct type *);
2f9ed3
-extern void annotate_elt_rep (unsigned int);
2f9ed3
+extern void annotate_array_section_begin (LONGEST, struct type *);
2f9ed3
+extern void annotate_elt_rep (ULONGEST);
2f9ed3
 extern void annotate_elt_rep_end (void);
2f9ed3
 extern void annotate_elt (void);
2f9ed3
 extern void annotate_array_section_end (void);
2f9ed3
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
2f9ed3
--- a/gdb/arch-utils.c
2f9ed3
+++ b/gdb/arch-utils.c
2f9ed3
@@ -227,7 +227,7 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch,
2f9ed3
 
2f9ed3
 const struct floatformat **
2f9ed3
 default_floatformat_for_type (struct gdbarch *gdbarch,
2f9ed3
-			      const char *name, int len)
2f9ed3
+			      const char *name, LONGEST len)
2f9ed3
 {
2f9ed3
   const struct floatformat **format = NULL;
2f9ed3
 
2f9ed3
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
2f9ed3
--- a/gdb/arch-utils.h
2f9ed3
+++ b/gdb/arch-utils.h
2f9ed3
@@ -131,7 +131,7 @@ extern gdbarch_virtual_frame_pointer_ftype legacy_virtual_frame_pointer;
2f9ed3
 /* Default implementation of gdbarch_floatformat_for_type.  */
2f9ed3
 extern const struct floatformat **
2f9ed3
   default_floatformat_for_type (struct gdbarch *gdbarch,
2f9ed3
-				const char *name, int len);
2f9ed3
+				const char *name, LONGEST len);
2f9ed3
 
2f9ed3
 extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame,
2f9ed3
 					       CORE_ADDR pc);
2f9ed3
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
2f9ed3
--- a/gdb/arm-linux-nat.c
2f9ed3
+++ b/gdb/arm-linux-nat.c
2f9ed3
@@ -1096,7 +1096,7 @@ arm_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch,
2f9ed3
 /* Are we able to use a hardware watchpoint for the LEN bytes starting at 
2f9ed3
    ADDR?  */
2f9ed3
 int
2f9ed3
-arm_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
2f9ed3
+arm_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
2f9ed3
 {
2f9ed3
   const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap ();
2f9ed3
   CORE_ADDR max_wp_length, aligned_addr;
2f9ed3
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
2f9ed3
--- a/gdb/ax-gdb.c
2f9ed3
+++ b/gdb/ax-gdb.c
2f9ed3
@@ -82,12 +82,12 @@ static void gen_traced_pop (struct agent_expr *, struct axs_value *);
2f9ed3
 static void gen_sign_extend (struct agent_expr *, struct type *);
2f9ed3
 static void gen_extend (struct agent_expr *, struct type *);
2f9ed3
 static void gen_fetch (struct agent_expr *, struct type *);
2f9ed3
-static void gen_left_shift (struct agent_expr *, int);
2f9ed3
+static void gen_left_shift (struct agent_expr *, LONGEST);
2f9ed3
 
2f9ed3
 
2f9ed3
 static void gen_frame_args_address (struct agent_expr *);
2f9ed3
 static void gen_frame_locals_address (struct agent_expr *);
2f9ed3
-static void gen_offset (struct agent_expr *ax, int offset);
2f9ed3
+static void gen_offset (struct agent_expr *ax, LONGEST offset);
2f9ed3
 static void gen_sym_offset (struct agent_expr *, struct symbol *);
2f9ed3
 static void gen_var_ref (struct agent_expr *ax, struct axs_value *value,
2f9ed3
 			 struct symbol *var);
2f9ed3
@@ -132,13 +132,13 @@ static void gen_complement (struct agent_expr *ax, struct axs_value *value);
2f9ed3
 static void gen_deref (struct axs_value *);
2f9ed3
 static void gen_address_of (struct axs_value *);
2f9ed3
 static void gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
2f9ed3
-			      struct type *type, int start, int end);
2f9ed3
+			      struct type *type, LONGEST start, LONGEST end);
2f9ed3
 static void gen_primitive_field (struct agent_expr *ax,
2f9ed3
 				 struct axs_value *value,
2f9ed3
-				 int offset, int fieldno, struct type *type);
2f9ed3
+				 LONGEST offset, int fieldno, struct type *type);
2f9ed3
 static int gen_struct_ref_recursive (struct agent_expr *ax,
2f9ed3
 				     struct axs_value *value,
2f9ed3
-				     const char *field, int offset,
2f9ed3
+				     const char *field, LONGEST offset,
2f9ed3
 				     struct type *type);
2f9ed3
 static void gen_struct_ref (struct agent_expr *ax,
2f9ed3
 			    struct axs_value *value,
2f9ed3
@@ -529,7 +529,7 @@ gen_fetch (struct agent_expr *ax, struct type *type)
2f9ed3
    right shift it by -DISTANCE bits if DISTANCE < 0.  This generates
2f9ed3
    unsigned (logical) right shifts.  */
2f9ed3
 static void
2f9ed3
-gen_left_shift (struct agent_expr *ax, int distance)
2f9ed3
+gen_left_shift (struct agent_expr *ax, LONGEST distance)
2f9ed3
 {
2f9ed3
   if (distance > 0)
2f9ed3
     {
2f9ed3
@@ -583,7 +583,7 @@ gen_frame_locals_address (struct agent_expr *ax)
2f9ed3
    programming in ML, it would be clearer why these are the same
2f9ed3
    thing.  */
2f9ed3
 static void
2f9ed3
-gen_offset (struct agent_expr *ax, int offset)
2f9ed3
+gen_offset (struct agent_expr *ax, LONGEST offset)
2f9ed3
 {
2f9ed3
   /* It would suffice to simply push the offset and add it, but this
2f9ed3
      makes it easier to read positive and negative offsets in the
2f9ed3
@@ -1254,7 +1254,7 @@ gen_address_of (struct axs_value *value)
2f9ed3
    structure.  */
2f9ed3
 static void
2f9ed3
 gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
2f9ed3
-		  struct type *type, int start, int end)
2f9ed3
+		  struct type *type, LONGEST start, LONGEST  end)
2f9ed3
 {
2f9ed3
   /* Note that ops[i] fetches 8 << i bits.  */
2f9ed3
   static enum agent_op ops[]
2f9ed3
@@ -1289,13 +1289,13 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
2f9ed3
 
2f9ed3
   /* The first and one-after-last bits in the field, but rounded down
2f9ed3
      and up to byte boundaries.  */
2f9ed3
-  int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
2f9ed3
-  int bound_end = (((end + TARGET_CHAR_BIT - 1)
2f9ed3
-		    / TARGET_CHAR_BIT)
2f9ed3
-		   * TARGET_CHAR_BIT);
2f9ed3
+  LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
2f9ed3
+  LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1)
2f9ed3
+			/ TARGET_CHAR_BIT)
2f9ed3
+		       * TARGET_CHAR_BIT);
2f9ed3
 
2f9ed3
   /* current bit offset within the structure */
2f9ed3
-  int offset;
2f9ed3
+  LONGEST offset;
2f9ed3
 
2f9ed3
   /* The index in ops of the opcode we're considering.  */
2f9ed3
   int op;
2f9ed3
@@ -1413,7 +1413,7 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
2f9ed3
 
2f9ed3
 static void
2f9ed3
 gen_primitive_field (struct agent_expr *ax, struct axs_value *value,
2f9ed3
-		     int offset, int fieldno, struct type *type)
2f9ed3
+		     LONGEST offset, int fieldno, struct type *type)
2f9ed3
 {
2f9ed3
   /* Is this a bitfield?  */
2f9ed3
   if (TYPE_FIELD_PACKED (type, fieldno))
2f9ed3
@@ -1437,7 +1437,7 @@ gen_primitive_field (struct agent_expr *ax, struct axs_value *value,
2f9ed3
 
2f9ed3
 static int
2f9ed3
 gen_struct_ref_recursive (struct agent_expr *ax, struct axs_value *value,
2f9ed3
-			  const char *field, int offset, struct type *type)
2f9ed3
+			  const char *field, LONGEST offset, struct type *type)
2f9ed3
 {
2f9ed3
   int i, rslt;
2f9ed3
   int nbases = TYPE_N_BASECLASSES (type);
2f9ed3
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
2f9ed3
--- a/gdb/ax-general.c
2f9ed3
+++ b/gdb/ax-general.c
2f9ed3
@@ -177,7 +177,7 @@ ax_zero_ext (struct agent_expr *x, int n)
2f9ed3
 
2f9ed3
 /* Append a trace_quick instruction to EXPR, to record N bytes.  */
2f9ed3
 void
2f9ed3
-ax_trace_quick (struct agent_expr *x, int n)
2f9ed3
+ax_trace_quick (struct agent_expr *x, LONGEST n)
2f9ed3
 {
2f9ed3
   /* N must fit in a byte.  */
2f9ed3
   if (n < 0 || n > 255)
2f9ed3
diff --git a/gdb/ax.h b/gdb/ax.h
2f9ed3
--- a/gdb/ax.h
2f9ed3
+++ b/gdb/ax.h
2f9ed3
@@ -193,7 +193,7 @@ extern void ax_ext (struct agent_expr *EXPR, int N);
2f9ed3
 extern void ax_zero_ext (struct agent_expr *EXPR, int N);
2f9ed3
 
2f9ed3
 /* Append a trace_quick instruction to EXPR, to record N bytes.  */
2f9ed3
-extern void ax_trace_quick (struct agent_expr *EXPR, int N);
2f9ed3
+extern void ax_trace_quick (struct agent_expr *EXPR, LONGEST N);
2f9ed3
 
2f9ed3
 /* Append a goto op to EXPR.  OP is the actual op (must be aop_goto or
2f9ed3
    aop_if_goto).  We assume we don't know the target offset yet,
2f9ed3
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
2f9ed3
--- a/gdb/breakpoint.c
2f9ed3
+++ b/gdb/breakpoint.c
2f9ed3
@@ -2056,9 +2056,9 @@ should_be_inserted (struct bp_location *bl)
2f9ed3
 	{
2f9ed3
 	  fprintf_unfiltered (gdb_stdlog,
2f9ed3
 			      "infrun: stepping past non-steppable watchpoint. "
2f9ed3
-			      "skipping watchpoint at %s:%d\n",
2f9ed3
+			      "skipping watchpoint at %s:%s\n",
2f9ed3
 			      paddress (bl->gdbarch, bl->address),
2f9ed3
-			      bl->length);
2f9ed3
+			      plongest (bl->length));
2f9ed3
 	}
2f9ed3
       return 0;
2f9ed3
     }
2f9ed3
@@ -6793,7 +6793,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1,
2f9ed3
 static int
2f9ed3
 breakpoint_address_match_range (const address_space *aspace1,
2f9ed3
 				CORE_ADDR addr1,
2f9ed3
-				int len1, const address_space *aspace2,
2f9ed3
+				LONGEST len1, const address_space *aspace2,
2f9ed3
 				CORE_ADDR addr2)
2f9ed3
 {
2f9ed3
   return ((gdbarch_has_global_breakpoints (target_gdbarch ())
2f9ed3
@@ -10859,7 +10859,7 @@ can_use_hardware_watchpoint (const std::vector<value_ref_ptr> &vals)
2f9ed3
 		      && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
2f9ed3
 		{
2f9ed3
 		  CORE_ADDR vaddr = value_address (v);
2f9ed3
-		  int len;
2f9ed3
+		  LONGEST len;
2f9ed3
 		  int num_regs;
2f9ed3
 
2f9ed3
 		  len = (target_exact_watchpoints
2f9ed3
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
2f9ed3
--- a/gdb/breakpoint.h
2f9ed3
+++ b/gdb/breakpoint.h
2f9ed3
@@ -252,7 +252,7 @@ struct bp_target_info
2f9ed3
 
2f9ed3
   /* If this is a ranged breakpoint, then this field contains the
2f9ed3
      length of the range that will be watched for execution.  */
2f9ed3
-  int length;
2f9ed3
+  LONGEST length;
2f9ed3
 
2f9ed3
   /* If the breakpoint lives in memory and reading that memory would
2f9ed3
      give back the breakpoint, instead of the original contents, then
2f9ed3
@@ -417,7 +417,7 @@ public:
2f9ed3
   /* For hardware watchpoints, the size of the memory region being
2f9ed3
      watched.  For hardware ranged breakpoints, the size of the
2f9ed3
      breakpoint range.  */
2f9ed3
-  int length = 0;
2f9ed3
+  LONGEST length = 0;
2f9ed3
 
2f9ed3
   /* Type of hardware watchpoint.  */
2f9ed3
   target_hw_bp_type watchpoint_type {};
2f9ed3
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
2f9ed3
--- a/gdb/c-lang.c
2f9ed3
+++ b/gdb/c-lang.c
2f9ed3
@@ -185,7 +185,7 @@ c_printchar (int c, struct type *type, struct ui_file *stream)
2f9ed3
 
2f9ed3
 void
2f9ed3
 c_printstr (struct ui_file *stream, struct type *type, 
2f9ed3
-	    const gdb_byte *string, unsigned int length, 
2f9ed3
+	    const gdb_byte *string, ULONGEST length,
2f9ed3
 	    const char *user_encoding, int force_ellipses,
2f9ed3
 	    const struct value_print_options *options)
2f9ed3
 {
2f9ed3
@@ -664,7 +664,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
2f9ed3
 	  }
2f9ed3
 	else
2f9ed3
 	  {
2f9ed3
-	    int i;
2f9ed3
+	    LONGEST i;
2f9ed3
 
2f9ed3
 	    /* Write the terminating character.  */
2f9ed3
 	    for (i = 0; i < TYPE_LENGTH (type); ++i)
2f9ed3
@@ -673,7 +673,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
2f9ed3
 	    if (satisfy_expected)
2f9ed3
 	      {
2f9ed3
 		LONGEST low_bound, high_bound;
2f9ed3
-		int element_size = TYPE_LENGTH (type);
2f9ed3
+		LONGEST element_size = TYPE_LENGTH (type);
2f9ed3
 
2f9ed3
 		if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type),
2f9ed3
 					 &low_bound, &high_bound) < 0)
2f9ed3
diff --git a/gdb/c-lang.h b/gdb/c-lang.h
2f9ed3
--- a/gdb/c-lang.h
2f9ed3
+++ b/gdb/c-lang.h
2f9ed3
@@ -82,7 +82,7 @@ extern void c_print_typedef (struct type *,
2f9ed3
 			     struct ui_file *);
2f9ed3
 
2f9ed3
 extern void c_val_print (struct type *,
2f9ed3
-			 int, CORE_ADDR,
2f9ed3
+			 LONGEST, CORE_ADDR,
2f9ed3
 			 struct ui_file *, int,
2f9ed3
 			 struct value *,
2f9ed3
 			 const struct value_print_options *);
2f9ed3
@@ -102,7 +102,7 @@ extern void c_printchar (int, struct type *, struct ui_file *);
2f9ed3
 extern void c_printstr (struct ui_file * stream,
2f9ed3
 			struct type *elttype,
2f9ed3
 			const gdb_byte *string,
2f9ed3
-			unsigned int length,
2f9ed3
+			ULONGEST length,
2f9ed3
 			const char *user_encoding,
2f9ed3
 			int force_ellipses,
2f9ed3
 			const struct value_print_options *options);
2f9ed3
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
2f9ed3
--- a/gdb/c-valprint.c
2f9ed3
+++ b/gdb/c-valprint.c
2f9ed3
@@ -247,7 +247,7 @@ c_val_print_array (struct type *type, const gdb_byte *valaddr,
2f9ed3
   if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0)
2f9ed3
     {
2f9ed3
       LONGEST low_bound, high_bound;
2f9ed3
-      int eltlen, len;
2f9ed3
+      LONGEST eltlen, len;
2f9ed3
       struct gdbarch *gdbarch = get_type_arch (type);
2f9ed3
       enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
2f9ed3
       unsigned int i = 0;	/* Number of characters printed.  */
2f9ed3
@@ -321,8 +321,8 @@ c_val_print_array (struct type *type, const gdb_byte *valaddr,
2f9ed3
 	  if (cp_is_vtbl_ptr_type (elttype))
2f9ed3
 	    {
2f9ed3
 	      i = 1;
2f9ed3
-	      fprintf_filtered (stream, _("%d vtable entries"),
2f9ed3
-				len - 1);
2f9ed3
+	      fprintf_filtered (stream, _("%s vtable entries"),
2f9ed3
+				plongest (len - 1));
2f9ed3
 	    }
2f9ed3
 	  else
2f9ed3
 	    {
2f9ed3
@@ -399,7 +399,7 @@ c_val_print_struct (struct type *type, const gdb_byte *valaddr,
2f9ed3
 	 -fvtable_thunks.  (Otherwise, look under
2f9ed3
 	 TYPE_CODE_PTR.)  */
2f9ed3
       struct gdbarch *gdbarch = get_type_arch (type);
2f9ed3
-      int offset = (embedded_offset
2f9ed3
+      LONGEST offset = (embedded_offset
2f9ed3
 		    + TYPE_FIELD_BITPOS (type,
2f9ed3
 					 VTBL_FNADDR_OFFSET) / 8);
2f9ed3
       struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET);
2f9ed3
@@ -498,7 +498,7 @@ c_val_print_memberptr (struct type *type, const gdb_byte *valaddr,
2f9ed3
 
2f9ed3
 void
2f9ed3
 c_val_print (struct type *type,
2f9ed3
-	     int embedded_offset, CORE_ADDR address,
2f9ed3
+	     LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 	     struct ui_file *stream, int recurse,
2f9ed3
 	     struct value *original_value,
2f9ed3
 	     const struct value_print_options *options)
2f9ed3
diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c
2f9ed3
--- a/gdb/compile/compile-c-support.c
2f9ed3
+++ b/gdb/compile/compile-c-support.c
2f9ed3
@@ -270,11 +270,11 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
2f9ed3
 
2f9ed3
 	      default:
2f9ed3
 		fprintf_unfiltered (stream,
2f9ed3
-				    "  unsigned char %s[%d]"
2f9ed3
+				    "  unsigned char %s[%s]"
2f9ed3
 				    " __attribute__((__aligned__("
2f9ed3
 				    "__BIGGEST_ALIGNMENT__)))",
2f9ed3
 				    regname.c_str (),
2f9ed3
-				    TYPE_LENGTH (regtype));
2f9ed3
+				    pulongest (TYPE_LENGTH (regtype)));
2f9ed3
 	      }
2f9ed3
 	    fputs_unfiltered (";\n", stream);
2f9ed3
 	  }
2f9ed3
diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c
2f9ed3
--- a/gdb/cp-abi.c
2f9ed3
+++ b/gdb/cp-abi.c
2f9ed3
@@ -64,12 +64,12 @@ is_operator_name (const char *name)
2f9ed3
   return (*current_cp_abi.is_operator_name) (name);
2f9ed3
 }
2f9ed3
 
2f9ed3
-int
2f9ed3
+LONGEST
2f9ed3
 baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
2f9ed3
 		  LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 		  const struct value *val)
2f9ed3
 {
2f9ed3
-  int res = 0;
2f9ed3
+  LONGEST res = 0;
2f9ed3
 
2f9ed3
   gdb_assert (current_cp_abi.baseclass_offset != NULL);
2f9ed3
 
2f9ed3
@@ -96,7 +96,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
2f9ed3
 struct value *
2f9ed3
 value_virtual_fn_field (struct value **arg1p,
2f9ed3
 			struct fn_field *f, int j,
2f9ed3
-			struct type *type, int offset)
2f9ed3
+			struct type *type, LONGEST offset)
2f9ed3
 {
2f9ed3
   if ((current_cp_abi.virtual_fn_field) == NULL)
2f9ed3
     return NULL;
2f9ed3
diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h
2f9ed3
--- a/gdb/cp-abi.h
2f9ed3
+++ b/gdb/cp-abi.h
2f9ed3
@@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep,
2f9ed3
 					     struct fn_field *f,
2f9ed3
 					     int j,
2f9ed3
 					     struct type *type,
2f9ed3
-					     int offset);
2f9ed3
+					     LONGEST offset);
2f9ed3
 
2f9ed3
 
2f9ed3
 /* Try to find the run-time type of VALUE, using C++ run-time type
2f9ed3
@@ -144,11 +144,11 @@ extern struct type *value_rtti_type (struct value *value,
2f9ed3
    contents of VAL.  The result is the offset of the baseclass value
2f9ed3
    relative to (the address of)(ARG) + OFFSET.  */
2f9ed3
 
2f9ed3
-extern int baseclass_offset (struct type *type,
2f9ed3
-			     int index, const gdb_byte *valaddr,
2f9ed3
-			     LONGEST embedded_offset,
2f9ed3
-			     CORE_ADDR address,
2f9ed3
-			     const struct value *val);
2f9ed3
+extern LONGEST baseclass_offset (struct type *type,
2f9ed3
+				 int index, const gdb_byte *valaddr,
2f9ed3
+				 LONGEST embedded_offset,
2f9ed3
+				 CORE_ADDR address,
2f9ed3
+				 const struct value *val);
2f9ed3
 
2f9ed3
 /* Describe the target of a pointer to method.  CONTENTS is the byte
2f9ed3
    pattern representing the pointer to method.  TYPE is the pointer to
2f9ed3
@@ -226,12 +226,12 @@ struct cp_abi_ops
2f9ed3
   struct value *(*virtual_fn_field) (struct value **arg1p,
2f9ed3
 				     struct fn_field * f,
2f9ed3
 				     int j, struct type * type,
2f9ed3
-				     int offset);
2f9ed3
+				     LONGEST offset);
2f9ed3
   struct type *(*rtti_type) (struct value *v, int *full,
2f9ed3
 			     LONGEST *top, int *using_enc);
2f9ed3
-  int (*baseclass_offset) (struct type *type, int index,
2f9ed3
-			   const bfd_byte *valaddr, LONGEST embedded_offset,
2f9ed3
-			   CORE_ADDR address, const struct value *val);
2f9ed3
+  LONGEST (*baseclass_offset) (struct type *type, int index,
2f9ed3
+			       const bfd_byte *valaddr, LONGEST embedded_offset,
2f9ed3
+			       CORE_ADDR address, const struct value *val);
2f9ed3
   void (*print_method_ptr) (const gdb_byte *contents,
2f9ed3
 			    struct type *type,
2f9ed3
 			    struct ui_file *stream);
2f9ed3
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
2f9ed3
--- a/gdb/cp-valprint.c
2f9ed3
+++ b/gdb/cp-valprint.c
2f9ed3
@@ -335,7 +335,7 @@ cp_print_value_fields (struct type *type, struct type *real_type,
2f9ed3
 		}
2f9ed3
 	      else if (i == vptr_fieldno && type == vptr_basetype)
2f9ed3
 		{
2f9ed3
-		  int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
2f9ed3
+		  LONGEST i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
2f9ed3
 		  struct type *i_type = TYPE_FIELD_TYPE (type, i);
2f9ed3
 
2f9ed3
 		  if (valprint_check_validity (stream, i_type, i_offset, val))
2f9ed3
diff --git a/gdb/d-lang.h b/gdb/d-lang.h
2f9ed3
--- a/gdb/d-lang.h
2f9ed3
+++ b/gdb/d-lang.h
2f9ed3
@@ -79,7 +79,7 @@ extern struct block_symbol d_lookup_nested_symbol (struct type *, const char *,
2f9ed3
 /* Defined in d-valprint.c  */
2f9ed3
 
2f9ed3
 extern void d_val_print (struct type *type,
2f9ed3
-			 int embedded_offset, CORE_ADDR address,
2f9ed3
+			 LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 			 struct ui_file *stream, int recurse,
2f9ed3
 			 struct value *val,
2f9ed3
 			 const struct value_print_options *options);
2f9ed3
diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c
2f9ed3
--- a/gdb/d-valprint.c
2f9ed3
+++ b/gdb/d-valprint.c
2f9ed3
@@ -73,7 +73,7 @@ dynamic_array_type (struct type *type,
2f9ed3
 
2f9ed3
 /* Implements the la_val_print routine for language D.  */
2f9ed3
 void
2f9ed3
-d_val_print (struct type *type, int embedded_offset,
2f9ed3
+d_val_print (struct type *type, LONGEST embedded_offset,
2f9ed3
              CORE_ADDR address, struct ui_file *stream, int recurse,
2f9ed3
 	     struct value *val,
2f9ed3
              const struct value_print_options *options)
2f9ed3
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
2f9ed3
--- a/gdb/dwarf2loc.c
2f9ed3
+++ b/gdb/dwarf2loc.c
2f9ed3
@@ -1625,7 +1625,7 @@ rw_pieced_value (struct value *v, struct value *from)
2f9ed3
   for (; i < c->pieces.size () && offset < max_offset; i++)
2f9ed3
     {
2f9ed3
       struct dwarf_expr_piece *p = &c->pieces[i];
2f9ed3
-      size_t this_size_bits, this_size;
2f9ed3
+      ULONGEST this_size_bits, this_size;
2f9ed3
 
2f9ed3
       this_size_bits = p->size - bits_to_skip;
2f9ed3
       if (this_size_bits > max_offset - offset)
2f9ed3
@@ -1872,7 +1872,7 @@ write_pieced_value (struct value *to, struct value *from)
2f9ed3
 
2f9ed3
 static int
2f9ed3
 check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset,
2f9ed3
-				int bit_length)
2f9ed3
+				LONGEST bit_length)
2f9ed3
 {
2f9ed3
   struct piece_closure *c
2f9ed3
     = (struct piece_closure *) value_computed_closure (value);
2f9ed3
@@ -1885,7 +1885,7 @@ check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset,
2f9ed3
   for (i = 0; i < c->pieces.size () && bit_length > 0; i++)
2f9ed3
     {
2f9ed3
       struct dwarf_expr_piece *p = &c->pieces[i];
2f9ed3
-      size_t this_size_bits = p->size;
2f9ed3
+      ULONGEST this_size_bits = p->size;
2f9ed3
 
2f9ed3
       if (bit_offset > 0)
2f9ed3
 	{
2f9ed3
@@ -1989,8 +1989,8 @@ indirect_pieced_value (struct value *value)
2f9ed3
     = (struct piece_closure *) value_computed_closure (value);
2f9ed3
   struct type *type;
2f9ed3
   struct frame_info *frame;
2f9ed3
-  int i, bit_length;
2f9ed3
-  LONGEST bit_offset;
2f9ed3
+  int i;
2f9ed3
+  LONGEST bit_length, bit_offset;
2f9ed3
   struct dwarf_expr_piece *piece = NULL;
2f9ed3
   LONGEST byte_offset;
2f9ed3
   enum bfd_endian byte_order;
2f9ed3
@@ -2007,7 +2007,7 @@ indirect_pieced_value (struct value *value)
2f9ed3
   for (i = 0; i < c->pieces.size () && bit_length > 0; i++)
2f9ed3
     {
2f9ed3
       struct dwarf_expr_piece *p = &c->pieces[i];
2f9ed3
-      size_t this_size_bits = p->size;
2f9ed3
+      ULONGEST this_size_bits = p->size;
2f9ed3
 
2f9ed3
       if (bit_offset > 0)
2f9ed3
 	{
2f9ed3
@@ -2296,9 +2296,9 @@ if (frame != NULL) select_frame (frame);
2f9ed3
 	case DWARF_VALUE_STACK:
2f9ed3
 	  {
2f9ed3
 	    struct value *value = ctx.fetch (0);
2f9ed3
-	    size_t n = TYPE_LENGTH (value_type (value));
2f9ed3
-	    size_t len = TYPE_LENGTH (subobj_type);
2f9ed3
-	    size_t max = TYPE_LENGTH (type);
2f9ed3
+	    ULONGEST n = TYPE_LENGTH (value_type (value));
2f9ed3
+	    ULONGEST len = TYPE_LENGTH (subobj_type);
2f9ed3
+	    ULONGEST max = TYPE_LENGTH (type);
2f9ed3
 	    struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
2f9ed3
 
2f9ed3
 	    if (subobj_byte_offset + len > max)
2f9ed3
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
2f9ed3
--- a/gdb/dwarf2read.c
2f9ed3
+++ b/gdb/dwarf2read.c
2f9ed3
@@ -2065,11 +2065,11 @@ dwarf2_complex_location_expr_complaint (void)
2f9ed3
 }
2f9ed3
 
2f9ed3
 static void
2f9ed3
-dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2,
2f9ed3
-					      int arg3)
2f9ed3
+dwarf2_const_value_length_mismatch_complaint (const char *arg1, LONGEST arg2,
2f9ed3
+					      LONGEST arg3)
2f9ed3
 {
2f9ed3
-  complaint (_("const value length mismatch for '%s', got %d, expected %d"),
2f9ed3
-	     arg1, arg2, arg3);
2f9ed3
+  complaint (_("const value length mismatch for '%s', got %s, expected %s"),
2f9ed3
+	     arg1, plongest (arg2), plongest (arg3));
2f9ed3
 }
2f9ed3
 
2f9ed3
 static void
2f9ed3
@@ -15104,8 +15104,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
2f9ed3
 	         object, and then subtract off the number of bits of
2f9ed3
 	         the field itself.  The result is the bit offset of
2f9ed3
 	         the LSB of the field.  */
2f9ed3
-	      int anonymous_size;
2f9ed3
-	      int bit_offset = DW_UNSND (attr);
2f9ed3
+	      LONGEST anonymous_size;
2f9ed3
+	      LONGEST bit_offset = DW_UNSND (attr);
2f9ed3
 
2f9ed3
 	      attr = dwarf2_attr (die, DW_AT_byte_size, cu);
2f9ed3
 	      if (attr)
2f9ed3
diff --git a/gdb/eval.c b/gdb/eval.c
2f9ed3
--- a/gdb/eval.c
2f9ed3
+++ b/gdb/eval.c
2f9ed3
@@ -295,7 +295,8 @@ evaluate_struct_tuple (struct value *struct_val,
2f9ed3
   while (--nargs >= 0)
2f9ed3
     {
2f9ed3
       struct value *val = NULL;
2f9ed3
-      int bitpos, bitsize;
2f9ed3
+      LONGEST bitpos;
2f9ed3
+      int bitsize;
2f9ed3
       bfd_byte *addr;
2f9ed3
 
2f9ed3
       fieldno++;
2f9ed3
@@ -356,7 +357,7 @@ init_array_element (struct value *array, struct value *element,
2f9ed3
 		    enum noside noside, LONGEST low_bound, LONGEST high_bound)
2f9ed3
 {
2f9ed3
   LONGEST index;
2f9ed3
-  int element_size = TYPE_LENGTH (value_type (element));
2f9ed3
+  LONGEST element_size = TYPE_LENGTH (value_type (element));
2f9ed3
 
2f9ed3
   if (exp->elts[*pos].opcode == BINOP_COMMA)
2f9ed3
     {
2f9ed3
@@ -799,11 +800,11 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch,
2f9ed3
     /* FIXME: Also mixed integral/booleans, with result an integer.  */
2f9ed3
     {
2f9ed3
       const struct builtin_type *builtin = builtin_type (gdbarch);
2f9ed3
-      unsigned int promoted_len1 = TYPE_LENGTH (type1);
2f9ed3
-      unsigned int promoted_len2 = TYPE_LENGTH (type2);
2f9ed3
+      ULONGEST promoted_len1 = TYPE_LENGTH (type1);
2f9ed3
+      ULONGEST promoted_len2 = TYPE_LENGTH (type2);
2f9ed3
       int is_unsigned1 = TYPE_UNSIGNED (type1);
2f9ed3
       int is_unsigned2 = TYPE_UNSIGNED (type2);
2f9ed3
-      unsigned int result_len;
2f9ed3
+      ULONGEST result_len;
2f9ed3
       int unsigned_operation;
2f9ed3
 
2f9ed3
       /* Determine type length and signedness after promotion for
2f9ed3
@@ -1553,7 +1554,7 @@ evaluate_subexp_standard (struct type *expect_type,
2f9ed3
   struct value **argvec;
2f9ed3
   int code;
2f9ed3
   int ix;
2f9ed3
-  long mem_offset;
2f9ed3
+  LONGEST mem_offset;
2f9ed3
   struct type **arg_types;
2f9ed3
 
2f9ed3
   pc = (*pos)++;
2f9ed3
@@ -1738,7 +1739,7 @@ evaluate_subexp_standard (struct type *expect_type,
2f9ed3
 	  struct type *range_type = TYPE_INDEX_TYPE (type);
2f9ed3
 	  struct type *element_type = TYPE_TARGET_TYPE (type);
2f9ed3
 	  struct value *array = allocate_value (expect_type);
2f9ed3
-	  int element_size = TYPE_LENGTH (check_typedef (element_type));
2f9ed3
+	  LONGEST element_size = TYPE_LENGTH (check_typedef (element_type));
2f9ed3
 	  LONGEST low_bound, high_bound, index;
2f9ed3
 
2f9ed3
 	  if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
2f9ed3
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
2f9ed3
--- a/gdb/f-lang.c
2f9ed3
+++ b/gdb/f-lang.c
2f9ed3
@@ -101,7 +101,7 @@ f_printchar (int c, struct type *type, struct ui_file *stream)
2f9ed3
 
2f9ed3
 static void
2f9ed3
 f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
2f9ed3
-	    unsigned int length, const char *encoding, int force_ellipses,
2f9ed3
+	    ULONGEST length, const char *encoding, int force_ellipses,
2f9ed3
 	    const struct value_print_options *options)
2f9ed3
 {
2f9ed3
   const char *type_encoding = f_get_encoding (type);
2f9ed3
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
2f9ed3
--- a/gdb/f-lang.h
2f9ed3
+++ b/gdb/f-lang.h
2f9ed3
@@ -31,7 +31,7 @@ extern int f_parse (struct parser_state *);
2f9ed3
 extern void f_print_type (struct type *, const char *, struct ui_file *, int,
2f9ed3
 			  int, const struct type_print_options *);
2f9ed3
 
2f9ed3
-extern void f_val_print (struct type *, int, CORE_ADDR,
2f9ed3
+extern void f_val_print (struct type *, LONGEST, CORE_ADDR,
2f9ed3
 			 struct ui_file *, int,
2f9ed3
 			 struct value *,
2f9ed3
 			 const struct value_print_options *);
2f9ed3
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
2f9ed3
--- a/gdb/f-valprint.c
2f9ed3
+++ b/gdb/f-valprint.c
2f9ed3
@@ -36,7 +36,7 @@
2f9ed3
 
2f9ed3
 static void f77_get_dynamic_length_of_aggregate (struct type *);
2f9ed3
 
2f9ed3
-int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
2f9ed3
+LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
2f9ed3
 
2f9ed3
 /* Array which holds offsets to be applied to get a row's elements
2f9ed3
    for a given array.  Array also holds the size of each subarray.  */
2f9ed3
@@ -71,8 +71,8 @@ f77_get_upperbound (struct type *type)
2f9ed3
 static void
2f9ed3
 f77_get_dynamic_length_of_aggregate (struct type *type)
2f9ed3
 {
2f9ed3
-  int upper_bound = -1;
2f9ed3
-  int lower_bound = 1;
2f9ed3
+  LONGEST upper_bound = -1;
2f9ed3
+  LONGEST lower_bound = 1;
2f9ed3
 
2f9ed3
   /* Recursively go all the way down into a possibly multi-dimensional
2f9ed3
      F77 array and get the bounds.  For simple arrays, this is pretty
2f9ed3
@@ -104,7 +104,7 @@ f77_get_dynamic_length_of_aggregate (struct type *type)
2f9ed3
 static void
2f9ed3
 f77_print_array_1 (int nss, int ndimensions, struct type *type,
2f9ed3
 		   const gdb_byte *valaddr,
2f9ed3
-		   int embedded_offset, CORE_ADDR address,
2f9ed3
+		   LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 		   struct ui_file *stream, int recurse,
2f9ed3
 		   const struct value *val,
2f9ed3
 		   const struct value_print_options *options,
2f9ed3
@@ -113,7 +113,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
2f9ed3
   struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type));
2f9ed3
   CORE_ADDR addr = address + embedded_offset;
2f9ed3
   LONGEST lowerbound, upperbound;
2f9ed3
-  int i;
2f9ed3
+  LONGEST i;
2f9ed3
 
2f9ed3
   get_discrete_bounds (range_type, &lowerbound, &upperbound);
2f9ed3
 
2f9ed3
@@ -175,7 +175,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
2f9ed3
 
2f9ed3
 static void
2f9ed3
 f77_print_array (struct type *type, const gdb_byte *valaddr,
2f9ed3
-		 int embedded_offset,
2f9ed3
+		 LONGEST embedded_offset,
2f9ed3
 		 CORE_ADDR address, struct ui_file *stream,
2f9ed3
 		 int recurse,
2f9ed3
 		 const struct value *val,
2f9ed3
@@ -214,7 +214,7 @@ static const struct generic_val_print_decorations f_decorations =
2f9ed3
    function; they are identical.  */
2f9ed3
 
2f9ed3
 void
2f9ed3
-f_val_print (struct type *type, int embedded_offset,
2f9ed3
+f_val_print (struct type *type, LONGEST embedded_offset,
2f9ed3
 	     CORE_ADDR address, struct ui_file *stream, int recurse,
2f9ed3
 	     struct value *original_value,
2f9ed3
 	     const struct value_print_options *options)
2f9ed3
diff --git a/gdb/findvar.c b/gdb/findvar.c
2f9ed3
--- a/gdb/findvar.c
2f9ed3
+++ b/gdb/findvar.c
2f9ed3
@@ -821,7 +821,7 @@ struct value *
2f9ed3
 default_value_from_register (struct gdbarch *gdbarch, struct type *type,
2f9ed3
                              int regnum, struct frame_id frame_id)
2f9ed3
 {
2f9ed3
-  int len = TYPE_LENGTH (type);
2f9ed3
+  LONGEST len = TYPE_LENGTH (type);
2f9ed3
   struct value *value = allocate_value (type);
2f9ed3
   struct frame_info *frame;
2f9ed3
 
2f9ed3
@@ -865,7 +865,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame)
2f9ed3
   LONGEST offset = 0;
2f9ed3
   LONGEST reg_offset = value_offset (value);
2f9ed3
   int regnum = VALUE_REGNUM (value);
2f9ed3
-  int len = type_length_units (check_typedef (value_type (value)));
2f9ed3
+  LONGEST len = type_length_units (check_typedef (value_type (value)));
2f9ed3
 
2f9ed3
   gdb_assert (VALUE_LVAL (value) == lval_register);
2f9ed3
 
2f9ed3
@@ -880,7 +880,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame)
2f9ed3
   while (len > 0)
2f9ed3
     {
2f9ed3
       struct value *regval = get_frame_register_value (frame, regnum);
2f9ed3
-      int reg_len = type_length_units (value_type (regval)) - reg_offset;
2f9ed3
+      LONGEST reg_len = type_length_units (value_type (regval)) - reg_offset;
2f9ed3
 
2f9ed3
       /* If the register length is larger than the number of bytes
2f9ed3
          remaining to copy, then only copy the appropriate bytes.  */
2f9ed3
diff --git a/gdb/frame.c b/gdb/frame.c
2f9ed3
--- a/gdb/frame.c
2f9ed3
+++ b/gdb/frame.c
2f9ed3
@@ -1393,7 +1393,7 @@ deprecated_frame_register_read (struct frame_info *frame, int regnum,
2f9ed3
 
2f9ed3
 int
2f9ed3
 get_frame_register_bytes (struct frame_info *frame, int regnum,
2f9ed3
-			  CORE_ADDR offset, int len, gdb_byte *myaddr,
2f9ed3
+			  CORE_ADDR offset, LONGEST len, gdb_byte *myaddr,
2f9ed3
 			  int *optimizedp, int *unavailablep)
2f9ed3
 {
2f9ed3
   struct gdbarch *gdbarch = get_frame_arch (frame);
2f9ed3
@@ -1422,7 +1422,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum,
2f9ed3
     }
2f9ed3
   if (len > maxsize)
2f9ed3
     error (_("Bad debug information detected: "
2f9ed3
-	     "Attempt to read %d bytes from registers."), len);
2f9ed3
+	     "Attempt to read %s bytes from registers."), plongest (len));
2f9ed3
 
2f9ed3
   /* Copy the data.  */
2f9ed3
   while (len > 0)
2f9ed3
diff --git a/gdb/frame.h b/gdb/frame.h
2f9ed3
--- a/gdb/frame.h
2f9ed3
+++ b/gdb/frame.h
2f9ed3
@@ -620,7 +620,7 @@ extern void put_frame_register (struct frame_info *frame, int regnum,
2f9ed3
    contents are optimized out or unavailable, set *OPTIMIZEDP,
2f9ed3
    *UNAVAILABLEP accordingly.  */
2f9ed3
 extern int get_frame_register_bytes (struct frame_info *frame, int regnum,
2f9ed3
-				     CORE_ADDR offset, int len,
2f9ed3
+				     CORE_ADDR offset, LONGEST len,
2f9ed3
 				     gdb_byte *myaddr,
2f9ed3
 				     int *optimizedp, int *unavailablep);
2f9ed3
 
2f9ed3
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
2f9ed3
--- a/gdb/gdbarch.c
2f9ed3
+++ b/gdb/gdbarch.c
2f9ed3
@@ -1795,7 +1795,7 @@ set_gdbarch_wchar_signed (struct gdbarch *gdbarch,
2f9ed3
 }
2f9ed3
 
2f9ed3
 const struct floatformat **
2f9ed3
-gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length)
2f9ed3
+gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length)
2f9ed3
 {
2f9ed3
   gdb_assert (gdbarch != NULL);
2f9ed3
   gdb_assert (gdbarch->floatformat_for_type != NULL);
2f9ed3
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
2f9ed3
--- a/gdb/gdbarch.h
2f9ed3
+++ b/gdb/gdbarch.h
2f9ed3
@@ -218,8 +218,8 @@ extern void set_gdbarch_wchar_signed (struct gdbarch *gdbarch, int wchar_signed)
2f9ed3
    NAME, if non-NULL, is the type name, which may be used to distinguish
2f9ed3
    different target formats of the same length. */
2f9ed3
 
2f9ed3
-typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, int length);
2f9ed3
-extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length);
2f9ed3
+typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, LONGEST length);
2f9ed3
+extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length);
2f9ed3
 extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type);
2f9ed3
 
2f9ed3
 /* For most targets, a pointer on the target and its representation as an
2f9ed3
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
2f9ed3
--- a/gdb/gdbarch.sh
2f9ed3
+++ b/gdb/gdbarch.sh
2f9ed3
@@ -385,7 +385,7 @@ v;int;wchar_signed;;;1;-1;1
2f9ed3
 # Returns the floating-point format to be used for values of length LENGTH.
2f9ed3
 # NAME, if non-NULL, is the type name, which may be used to distinguish
2f9ed3
 # different target formats of the same length.
2f9ed3
-m;const struct floatformat **;floatformat_for_type;const char *name, int length;name, length;0;default_floatformat_for_type;;0
2f9ed3
+m;const struct floatformat **;floatformat_for_type;const char *name, LONGEST length;name, length;0;default_floatformat_for_type;;0
2f9ed3
 
2f9ed3
 # For most targets, a pointer on the target and its representation as an
2f9ed3
 # address in GDB have the same size and "look the same".  For such a
2f9ed3
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
2f9ed3
--- a/gdb/gdbtypes.c
2f9ed3
+++ b/gdb/gdbtypes.c
2f9ed3
@@ -2889,7 +2889,7 @@ floatformat_from_type (const struct type *type)
2f9ed3
    least as long as OBJFILE.  */
2f9ed3
 
2f9ed3
 struct type *
2f9ed3
-init_type (struct objfile *objfile, enum type_code code, int bit,
2f9ed3
+init_type (struct objfile *objfile, enum type_code code, LONGEST bit,
2f9ed3
 	   const char *name)
2f9ed3
 {
2f9ed3
   struct type *type;
2f9ed3
@@ -3340,8 +3340,8 @@ is_public_ancestor (struct type *base, struct type *dclass)
2f9ed3
 
2f9ed3
 static int
2f9ed3
 is_unique_ancestor_worker (struct type *base, struct type *dclass,
2f9ed3
-			   int *offset,
2f9ed3
-			   const gdb_byte *valaddr, int embedded_offset,
2f9ed3
+			   LONGEST *offset,
2f9ed3
+			   const gdb_byte *valaddr, LONGEST embedded_offset,
2f9ed3
 			   CORE_ADDR address, struct value *val)
2f9ed3
 {
2f9ed3
   int i, count = 0;
2f9ed3
@@ -3352,7 +3352,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass,
2f9ed3
   for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i)
2f9ed3
     {
2f9ed3
       struct type *iter;
2f9ed3
-      int this_offset;
2f9ed3
+      LONGEST this_offset;
2f9ed3
 
2f9ed3
       iter = check_typedef (TYPE_BASECLASS (dclass, i));
2f9ed3
 
2f9ed3
@@ -3393,7 +3393,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass,
2f9ed3
 int
2f9ed3
 is_unique_ancestor (struct type *base, struct value *val)
2f9ed3
 {
2f9ed3
-  int offset = -1;
2f9ed3
+  LONGEST offset = -1;
2f9ed3
 
2f9ed3
   return is_unique_ancestor_worker (base, value_type (val), &offset,
2f9ed3
 				    value_contents_for_printing (val),
2f9ed3
@@ -4620,7 +4620,7 @@ recursive_dump_type (struct type *type, int spaces)
2f9ed3
       break;
2f9ed3
     }
2f9ed3
   puts_filtered ("\n");
2f9ed3
-  printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
2f9ed3
+  printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type)));
2f9ed3
   if (TYPE_OBJFILE_OWNED (type))
2f9ed3
     {
2f9ed3
       printfi_filtered (spaces, "objfile ");
2f9ed3
@@ -5065,7 +5065,7 @@ copy_type (const struct type *type)
2f9ed3
 
2f9ed3
 struct type *
2f9ed3
 arch_type (struct gdbarch *gdbarch,
2f9ed3
-	   enum type_code code, int bit, const char *name)
2f9ed3
+	   enum type_code code, LONGEST bit, const char *name)
2f9ed3
 {
2f9ed3
   struct type *type;
2f9ed3
 
2f9ed3
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
2f9ed3
--- a/gdb/gdbtypes.h
2f9ed3
+++ b/gdb/gdbtypes.h
2f9ed3
@@ -864,7 +864,7 @@ struct type
2f9ed3
      type_length_units function should be used in order to get the length
2f9ed3
      expressed in target addressable memory units.  */
2f9ed3
 
2f9ed3
-  unsigned int length;
2f9ed3
+  ULONGEST length;
2f9ed3
 
2f9ed3
   /* * Core type, shared by a group of qualified types.  */
2f9ed3
 
2f9ed3
@@ -1787,7 +1787,7 @@ extern unsigned int type_length_units (struct type *type);
2f9ed3
 
2f9ed3
 /* * Helper function to construct objfile-owned types.  */
2f9ed3
 
2f9ed3
-extern struct type *init_type (struct objfile *, enum type_code, int,
2f9ed3
+extern struct type *init_type (struct objfile *, enum type_code, LONGEST,
2f9ed3
 			       const char *);
2f9ed3
 extern struct type *init_integer_type (struct objfile *, int, int,
2f9ed3
 				       const char *);
2f9ed3
@@ -1804,7 +1804,7 @@ extern struct type *init_pointer_type (struct objfile *, int, const char *,
2f9ed3
 				       struct type *);
2f9ed3
 
2f9ed3
 /* Helper functions to construct architecture-owned types.  */
2f9ed3
-extern struct type *arch_type (struct gdbarch *, enum type_code, int,
2f9ed3
+extern struct type *arch_type (struct gdbarch *, enum type_code, LONGEST,
2f9ed3
 			       const char *);
2f9ed3
 extern struct type *arch_integer_type (struct gdbarch *, int, int,
2f9ed3
 				       const char *);
2f9ed3
diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
2f9ed3
--- a/gdb/gnu-v2-abi.c
2f9ed3
+++ b/gdb/gnu-v2-abi.c
2f9ed3
@@ -82,7 +82,7 @@ gnuv2_is_operator_name (const char *name)
2f9ed3
    TYPE is the type in which F is located.  */
2f9ed3
 static struct value *
2f9ed3
 gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
2f9ed3
-			struct type * type, int offset)
2f9ed3
+			struct type *type, LONGEST offset)
2f9ed3
 {
2f9ed3
   struct value *arg1 = *arg1p;
2f9ed3
   struct type *type1 = check_typedef (value_type (arg1));
2f9ed3
@@ -338,7 +338,7 @@ vb_match (struct type *type, int index, struct type *basetype)
2f9ed3
    target).  The result is the offset of the baseclass value relative
2f9ed3
    to (the address of)(ARG) + OFFSET.  */
2f9ed3
 
2f9ed3
-static int
2f9ed3
+static LONGEST
2f9ed3
 gnuv2_baseclass_offset (struct type *type, int index,
2f9ed3
 			const bfd_byte *valaddr, LONGEST embedded_offset,
2f9ed3
 			CORE_ADDR address, const struct value *val)
2f9ed3
@@ -358,8 +358,7 @@ gnuv2_baseclass_offset (struct type *type, int index,
2f9ed3
 	  if (vb_match (type, i, basetype))
2f9ed3
 	    {
2f9ed3
 	      struct type *field_type;
2f9ed3
-	      LONGEST field_offset;
2f9ed3
-	      int field_length;
2f9ed3
+	      LONGEST field_offset, field_length;
2f9ed3
 	      CORE_ADDR addr;
2f9ed3
 
2f9ed3
 	      field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
2f9ed3
@@ -383,7 +382,7 @@ gnuv2_baseclass_offset (struct type *type, int index,
2f9ed3
 	  /* Don't go through baseclass_offset, as that wraps
2f9ed3
 	     exceptions, thus, inner exceptions would be wrapped more
2f9ed3
 	     than once.  */
2f9ed3
-	  int boffset =
2f9ed3
+	  LONGEST boffset =
2f9ed3
 	    gnuv2_baseclass_offset (type, i, valaddr,
2f9ed3
 				    embedded_offset, address, val);
2f9ed3
 
2f9ed3
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
2f9ed3
--- a/gdb/gnu-v3-abi.c
2f9ed3
+++ b/gdb/gnu-v3-abi.c
2f9ed3
@@ -109,7 +109,7 @@ build_gdb_vtable_type (struct gdbarch *arch)
2f9ed3
 {
2f9ed3
   struct type *t;
2f9ed3
   struct field *field_list, *field;
2f9ed3
-  int offset;
2f9ed3
+  LONGEST offset;
2f9ed3
 
2f9ed3
   struct type *void_ptr_type
2f9ed3
     = builtin_type (arch)->builtin_data_ptr;
2f9ed3
@@ -185,7 +185,7 @@ vtable_ptrdiff_type (struct gdbarch *gdbarch)
2f9ed3
 /* Return the offset from the start of the imaginary `struct
2f9ed3
    gdb_gnu_v3_abi_vtable' object to the vtable's "address point"
2f9ed3
    (i.e., where objects' virtual table pointers point).  */
2f9ed3
-static int
2f9ed3
+static LONGEST
2f9ed3
 vtable_address_point_offset (struct gdbarch *gdbarch)
2f9ed3
 {
2f9ed3
   struct type *vtable_type
2f9ed3
@@ -409,7 +409,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container,
2f9ed3
 static struct value *
2f9ed3
 gnuv3_virtual_fn_field (struct value **value_p,
2f9ed3
                         struct fn_field *f, int j,
2f9ed3
-			struct type *vfn_base, int offset)
2f9ed3
+			struct type *vfn_base, LONGEST offset)
2f9ed3
 {
2f9ed3
   struct type *values_type = check_typedef (value_type (*value_p));
2f9ed3
   struct gdbarch *gdbarch;
2f9ed3
@@ -439,7 +439,7 @@ gnuv3_virtual_fn_field (struct value **value_p,
2f9ed3
 
2f9ed3
    -1 is returned on error.  */
2f9ed3
 
2f9ed3
-static int
2f9ed3
+static LONGEST
2f9ed3
 gnuv3_baseclass_offset (struct type *type, int index,
2f9ed3
 			const bfd_byte *valaddr, LONGEST embedded_offset,
2f9ed3
 			CORE_ADDR address, const struct value *val)
2f9ed3
@@ -448,7 +448,7 @@ gnuv3_baseclass_offset (struct type *type, int index,
2f9ed3
   struct type *ptr_type;
2f9ed3
   struct value *vtable;
2f9ed3
   struct value *vbase_array;
2f9ed3
-  long int cur_base_offset, base_offset;
2f9ed3
+  LONGEST cur_base_offset, base_offset;
2f9ed3
 
2f9ed3
   /* Determine architecture.  */
2f9ed3
   gdbarch = get_type_arch (type);
2f9ed3
@@ -471,7 +471,7 @@ gnuv3_baseclass_offset (struct type *type, int index,
2f9ed3
   cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch);
2f9ed3
   if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0)
2f9ed3
     error (_("Misaligned vbase offset."));
2f9ed3
-  cur_base_offset = cur_base_offset / ((int) TYPE_LENGTH (ptr_type));
2f9ed3
+  cur_base_offset = cur_base_offset / ((LONGEST) TYPE_LENGTH (ptr_type));
2f9ed3
 
2f9ed3
   vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset);
2f9ed3
   gdb_assert (vtable != NULL);
2f9ed3
@@ -515,7 +515,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset,
2f9ed3
      we're out of luck.  */
2f9ed3
   for (i = 0; i < TYPE_N_BASECLASSES (domain); i++)
2f9ed3
     {
2f9ed3
-      int pos;
2f9ed3
+      LONGEST pos;
2f9ed3
       struct type *basetype;
2f9ed3
 
2f9ed3
       if (BASETYPE_VIA_VIRTUAL (domain, i))
2f9ed3
diff --git a/gdb/go-lang.h b/gdb/go-lang.h
2f9ed3
--- a/gdb/go-lang.h
2f9ed3
+++ b/gdb/go-lang.h
2f9ed3
@@ -83,7 +83,7 @@ extern void go_print_type (struct type *type, const char *varstring,
2f9ed3
 /* Defined in go-valprint.c.  */
2f9ed3
 
2f9ed3
 extern void go_val_print (struct type *type,
2f9ed3
-			  int embedded_offset, CORE_ADDR address,
2f9ed3
+			  LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 			  struct ui_file *stream, int recurse,
2f9ed3
 			  struct value *val,
2f9ed3
 			  const struct value_print_options *options);
2f9ed3
diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c
2f9ed3
--- a/gdb/go-valprint.c
2f9ed3
+++ b/gdb/go-valprint.c
2f9ed3
@@ -86,7 +86,7 @@ print_go_string (struct type *type,
2f9ed3
 /* Implements the la_val_print routine for language Go.  */
2f9ed3
 
2f9ed3
 void
2f9ed3
-go_val_print (struct type *type, int embedded_offset,
2f9ed3
+go_val_print (struct type *type, LONGEST embedded_offset,
2f9ed3
 	      CORE_ADDR address, struct ui_file *stream, int recurse,
2f9ed3
 	      struct value *val,
2f9ed3
 	      const struct value_print_options *options)
2f9ed3
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
2f9ed3
--- a/gdb/i386-tdep.c
2f9ed3
+++ b/gdb/i386-tdep.c
2f9ed3
@@ -8156,7 +8156,7 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr,
2f9ed3
 
2f9ed3
 const struct floatformat **
2f9ed3
 i386_floatformat_for_type (struct gdbarch *gdbarch,
2f9ed3
-			   const char *name, int len)
2f9ed3
+			   const char *name, LONGEST len)
2f9ed3
 {
2f9ed3
   if (len == 128 && name)
2f9ed3
     if (strcmp (name, "__float128") == 0
2f9ed3
diff --git a/gdb/language.c b/gdb/language.c
2f9ed3
--- a/gdb/language.c
2f9ed3
+++ b/gdb/language.c
2f9ed3
@@ -765,7 +765,7 @@ unk_lang_printchar (int c, struct type *type, struct ui_file *stream)
2f9ed3
 
2f9ed3
 static void
2f9ed3
 unk_lang_printstr (struct ui_file *stream, struct type *type,
2f9ed3
-		   const gdb_byte *string, unsigned int length,
2f9ed3
+		   const gdb_byte *string, ULONGEST length,
2f9ed3
 		   const char *encoding, int force_ellipses,
2f9ed3
 		   const struct value_print_options *options)
2f9ed3
 {
2f9ed3
@@ -784,7 +784,7 @@ unk_lang_print_type (struct type *type, const char *varstring,
2f9ed3
 
2f9ed3
 static void
2f9ed3
 unk_lang_val_print (struct type *type,
2f9ed3
-		    int embedded_offset, CORE_ADDR address,
2f9ed3
+		    LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 		    struct ui_file *stream, int recurse,
2f9ed3
 		    struct value *val,
2f9ed3
 		    const struct value_print_options *options)
2f9ed3
diff --git a/gdb/language.h b/gdb/language.h
2f9ed3
--- a/gdb/language.h
2f9ed3
+++ b/gdb/language.h
2f9ed3
@@ -184,7 +184,7 @@ struct language_defn
2f9ed3
 			  struct ui_file * stream);
2f9ed3
 
2f9ed3
     void (*la_printstr) (struct ui_file * stream, struct type *elttype,
2f9ed3
-			 const gdb_byte *string, unsigned int length,
2f9ed3
+			 const gdb_byte *string, ULONGEST length,
2f9ed3
 			 const char *encoding, int force_ellipses,
2f9ed3
 			 const struct value_print_options *);
2f9ed3
 
2f9ed3
@@ -222,7 +222,7 @@ struct language_defn
2f9ed3
        printing.  */
2f9ed3
 
2f9ed3
     void (*la_val_print) (struct type *type,
2f9ed3
-			  int embedded_offset, CORE_ADDR address,
2f9ed3
+			  LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 			  struct ui_file *stream, int recurse,
2f9ed3
 			  struct value *val,
2f9ed3
 			  const struct value_print_options *options);
2f9ed3
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
2f9ed3
--- a/gdb/m2-lang.c
2f9ed3
+++ b/gdb/m2-lang.c
2f9ed3
@@ -103,10 +103,10 @@ m2_printchar (int c, struct type *type, struct ui_file *stream)
2f9ed3
 
2f9ed3
 static void
2f9ed3
 m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
2f9ed3
-	     unsigned int length, const char *encoding, int force_ellipses,
2f9ed3
+	     ULONGEST length, const char *encoding, int force_ellipses,
2f9ed3
 	     const struct value_print_options *options)
2f9ed3
 {
2f9ed3
-  unsigned int i;
2f9ed3
+  ULONGEST i;
2f9ed3
   unsigned int things_printed = 0;
2f9ed3
   int in_quotes = 0;
2f9ed3
   int need_comma = 0;
2f9ed3
@@ -121,9 +121,9 @@ m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
2f9ed3
     {
2f9ed3
       /* Position of the character we are examining
2f9ed3
          to see whether it is repeated.  */
2f9ed3
-      unsigned int rep1;
2f9ed3
+      ULONGEST rep1;
2f9ed3
       /* Number of repetitions we have detected so far.  */
2f9ed3
-      unsigned int reps;
2f9ed3
+      ULONGEST reps;
2f9ed3
 
2f9ed3
       QUIT;
2f9ed3
 
2f9ed3
@@ -149,7 +149,7 @@ m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
2f9ed3
 	      in_quotes = 0;
2f9ed3
 	    }
2f9ed3
 	  m2_printchar (string[i], type, stream);
2f9ed3
-	  fprintf_filtered (stream, " <repeats %u times>", reps);
2f9ed3
+	  fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
2f9ed3
 	  i = rep1 - 1;
2f9ed3
 	  things_printed += options->repeat_count_threshold;
2f9ed3
 	  need_comma = 1;
2f9ed3
diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h
2f9ed3
--- a/gdb/m2-lang.h
2f9ed3
+++ b/gdb/m2-lang.h
2f9ed3
@@ -35,7 +35,7 @@ extern void m2_print_typedef (struct type *, struct symbol *,
2f9ed3
 extern int m2_is_long_set (struct type *type);
2f9ed3
 extern int m2_is_unbounded_array (struct type *type);
2f9ed3
 
2f9ed3
-extern void m2_val_print (struct type *, int, CORE_ADDR,
2f9ed3
+extern void m2_val_print (struct type *, LONGEST, CORE_ADDR,
2f9ed3
 			  struct ui_file *, int,
2f9ed3
 			  struct value *,
2f9ed3
 			  const struct value_print_options *);
2f9ed3
diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c
2f9ed3
--- a/gdb/m2-typeprint.c
2f9ed3
+++ b/gdb/m2-typeprint.c
2f9ed3
@@ -234,9 +234,12 @@ static void m2_array (struct type *type, struct ui_file *stream,
2f9ed3
 	  m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1);
2f9ed3
 	}
2f9ed3
       else
2f9ed3
-	fprintf_filtered (stream, "%d",
2f9ed3
-			  (TYPE_LENGTH (type)
2f9ed3
-			   / TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
2f9ed3
+        {
2f9ed3
+	  ULONGEST val = (TYPE_LENGTH (type)
2f9ed3
+			  / TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
2f9ed3
+
2f9ed3
+	  fprintf_filtered (stream, "%s", pulongest (val));
2f9ed3
+	}
2f9ed3
     }
2f9ed3
   fprintf_filtered (stream, "] OF ");
2f9ed3
   m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
2f9ed3
diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c
2f9ed3
--- a/gdb/m2-valprint.c
2f9ed3
+++ b/gdb/m2-valprint.c
2f9ed3
@@ -35,7 +35,7 @@ static int print_unpacked_pointer (struct type *type,
2f9ed3
 				   struct ui_file *stream);
2f9ed3
 static void
2f9ed3
 m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
2f9ed3
-			 int embedded_offset, CORE_ADDR address,
2f9ed3
+			 LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 			 struct ui_file *stream, int recurse,
2f9ed3
 			 struct value *val,
2f9ed3
 			 const struct value_print_options *options,
2f9ed3
@@ -67,7 +67,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high)
2f9ed3
 
2f9ed3
 static void
2f9ed3
 m2_print_long_set (struct type *type, const gdb_byte *valaddr,
2f9ed3
-		   int embedded_offset, CORE_ADDR address,
2f9ed3
+		   LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 		   struct ui_file *stream)
2f9ed3
 {
2f9ed3
   int empty_set        = 1;
2f9ed3
@@ -158,7 +158,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr,
2f9ed3
 
2f9ed3
 static void
2f9ed3
 m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
2f9ed3
-			  int embedded_offset, CORE_ADDR address,
2f9ed3
+			  LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 			  struct ui_file *stream, int recurse,
2f9ed3
 			  const struct value_print_options *options)
2f9ed3
 {
2f9ed3
@@ -260,7 +260,7 @@ print_variable_at_address (struct type *type,
2f9ed3
 
2f9ed3
 static void
2f9ed3
 m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
2f9ed3
-			 int embedded_offset, CORE_ADDR address,
2f9ed3
+			 LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 			 struct ui_file *stream, int recurse,
2f9ed3
 			 struct value *val,
2f9ed3
 			 const struct value_print_options *options,
2f9ed3
@@ -308,12 +308,12 @@ static const struct generic_val_print_decorations m2_decorations =
2f9ed3
    function; they are identical.  */
2f9ed3
 
2f9ed3
 void
2f9ed3
-m2_val_print (struct type *type, int embedded_offset,
2f9ed3
+m2_val_print (struct type *type, LONGEST embedded_offset,
2f9ed3
 	      CORE_ADDR address, struct ui_file *stream, int recurse,
2f9ed3
 	      struct value *original_value,
2f9ed3
 	      const struct value_print_options *options)
2f9ed3
 {
2f9ed3
-  unsigned len;
2f9ed3
+  ULONGEST len;
2f9ed3
   struct type *elttype;
2f9ed3
   CORE_ADDR addr;
2f9ed3
   const gdb_byte *valaddr = value_contents_for_printing (original_value);
2f9ed3
@@ -339,7 +339,7 @@ m2_val_print (struct type *type, int embedded_offset,
2f9ed3
 	         elements up to it.  */
2f9ed3
 	      if (options->stop_print_at_null)
2f9ed3
 		{
2f9ed3
-		  unsigned int temp_len;
2f9ed3
+		  ULONGEST temp_len;
2f9ed3
 
2f9ed3
 		  /* Look for a NULL char.  */
2f9ed3
 		  for (temp_len = 0;
2f9ed3
@@ -415,7 +415,7 @@ m2_val_print (struct type *type, int embedded_offset,
2f9ed3
 	{
2f9ed3
 	  struct type *range = elttype;
2f9ed3
 	  LONGEST low_bound, high_bound;
2f9ed3
-	  int i;
2f9ed3
+	  LONGEST i;
2f9ed3
 	  int need_comma = 0;
2f9ed3
 
2f9ed3
 	  fputs_filtered ("{", stream);
2f9ed3
diff --git a/gdb/memrange.c b/gdb/memrange.c
2f9ed3
--- a/gdb/memrange.c
2f9ed3
+++ b/gdb/memrange.c
2f9ed3
@@ -22,8 +22,8 @@
2f9ed3
 #include <algorithm>
2f9ed3
 
2f9ed3
 int
2f9ed3
-mem_ranges_overlap (CORE_ADDR start1, int len1,
2f9ed3
-		    CORE_ADDR start2, int len2)
2f9ed3
+mem_ranges_overlap (CORE_ADDR start1, LONGEST len1,
2f9ed3
+		    CORE_ADDR start2, LONGEST len2)
2f9ed3
 {
2f9ed3
   ULONGEST h, l;
2f9ed3
 
2f9ed3
diff --git a/gdb/memrange.h b/gdb/memrange.h
2f9ed3
--- a/gdb/memrange.h
2f9ed3
+++ b/gdb/memrange.h
2f9ed3
@@ -28,7 +28,7 @@ struct mem_range
2f9ed3
 {
2f9ed3
   mem_range () = default;
2f9ed3
 
2f9ed3
-  mem_range (CORE_ADDR start_, int length_)
2f9ed3
+  mem_range (CORE_ADDR start_, LONGEST length_)
2f9ed3
   : start (start_), length (length_)
2f9ed3
   {}
2f9ed3
 
2f9ed3
@@ -47,14 +47,14 @@ struct mem_range
2f9ed3
   CORE_ADDR start;
2f9ed3
 
2f9ed3
   /* Length of the range.  */
2f9ed3
-  int length;
2f9ed3
+  LONGEST length;
2f9ed3
 };
2f9ed3
 
2f9ed3
 /* Returns true if the ranges defined by [start1, start1+len1) and
2f9ed3
    [start2, start2+len2) overlap.  */
2f9ed3
 
2f9ed3
-extern int mem_ranges_overlap (CORE_ADDR start1, int len1,
2f9ed3
-			       CORE_ADDR start2, int len2);
2f9ed3
+extern int mem_ranges_overlap (CORE_ADDR start1, LONGEST len1,
2f9ed3
+			       CORE_ADDR start2, LONGEST len2);
2f9ed3
 
2f9ed3
 /* Returns true if ADDR is in RANGE.  */
2f9ed3
 
2f9ed3
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
2f9ed3
--- a/gdb/mips-linux-nat.c
2f9ed3
+++ b/gdb/mips-linux-nat.c
2f9ed3
@@ -610,7 +610,7 @@ mips_linux_nat_target::stopped_data_address (CORE_ADDR *paddr)
2f9ed3
    the specified region can be covered by the watch registers.  */
2f9ed3
 
2f9ed3
 int
2f9ed3
-mips_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
2f9ed3
+mips_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
2f9ed3
 {
2f9ed3
   struct pt_watch_regs dummy_regs;
2f9ed3
   int i;
2f9ed3
diff --git a/gdb/nat/x86-dregs.c b/gdb/nat/x86-dregs.c
2f9ed3
--- a/gdb/nat/x86-dregs.c
2f9ed3
+++ b/gdb/nat/x86-dregs.c
2f9ed3
@@ -380,7 +380,7 @@ x86_remove_aligned_watchpoint (struct x86_debug_reg_state *state,
2f9ed3
 
2f9ed3
 static int
2f9ed3
 x86_handle_nonaligned_watchpoint (struct x86_debug_reg_state *state,
2f9ed3
-				  x86_wp_op_t what, CORE_ADDR addr, int len,
2f9ed3
+				  x86_wp_op_t what, CORE_ADDR addr, LONGEST len,
2f9ed3
 				  enum target_hw_bp_type type)
2f9ed3
 {
2f9ed3
   int retval = 0;
2f9ed3
@@ -548,7 +548,7 @@ x86_dr_remove_watchpoint (struct x86_debug_reg_state *state,
2f9ed3
 
2f9ed3
 int
2f9ed3
 x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state,
2f9ed3
-				 CORE_ADDR addr, int len)
2f9ed3
+				 CORE_ADDR addr, LONGEST len)
2f9ed3
 {
2f9ed3
   int nregs;
2f9ed3
 
2f9ed3
diff --git a/gdb/nat/x86-dregs.h b/gdb/nat/x86-dregs.h
2f9ed3
--- a/gdb/nat/x86-dregs.h
2f9ed3
+++ b/gdb/nat/x86-dregs.h
2f9ed3
@@ -117,7 +117,7 @@ extern int x86_dr_remove_watchpoint (struct x86_debug_reg_state *state,
2f9ed3
 /* Return non-zero if we can watch a memory region that starts at
2f9ed3
    address ADDR and whose length is LEN bytes.  */
2f9ed3
 extern int x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state,
2f9ed3
-					    CORE_ADDR addr, int len);
2f9ed3
+					    CORE_ADDR addr, LONGEST len);
2f9ed3
 
2f9ed3
 /* If the inferior has some break/watchpoint that triggered, set the
2f9ed3
    address associated with that break/watchpoint and return true.
2f9ed3
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c
2f9ed3
--- a/gdb/opencl-lang.c
2f9ed3
+++ b/gdb/opencl-lang.c
2f9ed3
@@ -76,11 +76,11 @@ builtin_opencl_type (struct gdbarch *gdbarch)
2f9ed3
 
2f9ed3
 static struct type *
2f9ed3
 lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code,
2f9ed3
-			   unsigned int el_length, unsigned int flag_unsigned,
2f9ed3
+			   ULONGEST el_length, unsigned int flag_unsigned,
2f9ed3
 			   int n)
2f9ed3
 {
2f9ed3
   int i;
2f9ed3
-  unsigned int length;
2f9ed3
+  ULONGEST length;
2f9ed3
   struct type *type = NULL;
2f9ed3
   struct type **types = builtin_opencl_type (gdbarch);
2f9ed3
 
2f9ed3
@@ -172,7 +172,7 @@ lval_func_read (struct value *v)
2f9ed3
   struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val)));
2f9ed3
   LONGEST offset = value_offset (v);
2f9ed3
   LONGEST elsize = TYPE_LENGTH (eltype);
2f9ed3
-  int n, i, j = 0;
2f9ed3
+  LONGEST n, i, j = 0;
2f9ed3
   LONGEST lowb = 0;
2f9ed3
   LONGEST highb = 0;
2f9ed3
 
2f9ed3
@@ -201,7 +201,7 @@ lval_func_write (struct value *v, struct value *fromval)
2f9ed3
   struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val)));
2f9ed3
   LONGEST offset = value_offset (v);
2f9ed3
   LONGEST elsize = TYPE_LENGTH (eltype);
2f9ed3
-  int n, i, j = 0;
2f9ed3
+  LONGEST n, i, j = 0;
2f9ed3
   LONGEST lowb = 0;
2f9ed3
   LONGEST highb = 0;
2f9ed3
 
2f9ed3
@@ -241,17 +241,17 @@ lval_func_write (struct value *v, struct value *fromval)
2f9ed3
 
2f9ed3
 static int
2f9ed3
 lval_func_check_synthetic_pointer (const struct value *v,
2f9ed3
-				   LONGEST offset, int length)
2f9ed3
+				   LONGEST offset, LONGEST length)
2f9ed3
 {
2f9ed3
   struct lval_closure *c = (struct lval_closure *) value_computed_closure (v);
2f9ed3
   /* Size of the target type in bits.  */
2f9ed3
-  int elsize =
2f9ed3
+  LONGEST elsize =
2f9ed3
       TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8;
2f9ed3
-  int startrest = offset % elsize;
2f9ed3
-  int start = offset / elsize;
2f9ed3
-  int endrest = (offset + length) % elsize;
2f9ed3
-  int end = (offset + length) / elsize;
2f9ed3
-  int i;
2f9ed3
+  LONGEST startrest = offset % elsize;
2f9ed3
+  LONGEST start = offset / elsize;
2f9ed3
+  LONGEST endrest = (offset + length) % elsize;
2f9ed3
+  LONGEST end = (offset + length) / elsize;
2f9ed3
+  LONGEST i;
2f9ed3
 
2f9ed3
   if (endrest)
2f9ed3
     end++;
2f9ed3
@@ -261,8 +261,8 @@ lval_func_check_synthetic_pointer (const struct value *v,
2f9ed3
 
2f9ed3
   for (i = start; i < end; i++)
2f9ed3
     {
2f9ed3
-      int comp_offset = (i == start) ? startrest : 0;
2f9ed3
-      int comp_length = (i == end) ? endrest : elsize;
2f9ed3
+      LONGEST comp_offset = (i == start) ? startrest : 0;
2f9ed3
+      LONGEST comp_length = (i == end) ? endrest : elsize;
2f9ed3
 
2f9ed3
       if (!value_bits_synthetic_pointer (c->val,
2f9ed3
 					 c->indices[i] * elsize + comp_offset,
2f9ed3
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
2f9ed3
--- a/gdb/p-lang.c
2f9ed3
+++ b/gdb/p-lang.c
2f9ed3
@@ -93,8 +93,8 @@ pascal_main_name (void)
2f9ed3
    are not multiple of TARGET_CHAR_BIT then the results are wrong
2f9ed3
    but this does not happen for Free Pascal nor for GPC.  */
2f9ed3
 int
2f9ed3
-is_pascal_string_type (struct type *type,int *length_pos,
2f9ed3
-                       int *length_size, int *string_pos,
2f9ed3
+is_pascal_string_type (struct type *type, LONGEST *length_pos,
2f9ed3
+		       LONGEST *length_size, LONGEST *string_pos,
2f9ed3
 		       struct type **char_type,
2f9ed3
 		       const char **arrayname)
2f9ed3
 {
2f9ed3
@@ -214,12 +214,12 @@ pascal_printchar (int c, struct type *type, struct ui_file *stream)
2f9ed3
 
2f9ed3
 void
2f9ed3
 pascal_printstr (struct ui_file *stream, struct type *type,
2f9ed3
-		 const gdb_byte *string, unsigned int length,
2f9ed3
+		 const gdb_byte *string, ULONGEST length,
2f9ed3
 		 const char *encoding, int force_ellipses,
2f9ed3
 		 const struct value_print_options *options)
2f9ed3
 {
2f9ed3
   enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
2f9ed3
-  unsigned int i;
2f9ed3
+  ULONGEST i;
2f9ed3
   unsigned int things_printed = 0;
2f9ed3
   int in_quotes = 0;
2f9ed3
   int need_comma = 0;
2f9ed3
@@ -247,9 +247,9 @@ pascal_printstr (struct ui_file *stream, struct type *type,
2f9ed3
     {
2f9ed3
       /* Position of the character we are examining
2f9ed3
          to see whether it is repeated.  */
2f9ed3
-      unsigned int rep1;
2f9ed3
+      ULONGEST rep1;
2f9ed3
       /* Number of repetitions we have detected so far.  */
2f9ed3
-      unsigned int reps;
2f9ed3
+      ULONGEST reps;
2f9ed3
       unsigned long int current_char;
2f9ed3
 
2f9ed3
       QUIT;
2f9ed3
@@ -281,7 +281,7 @@ pascal_printstr (struct ui_file *stream, struct type *type,
2f9ed3
 	      in_quotes = 0;
2f9ed3
 	    }
2f9ed3
 	  pascal_printchar (current_char, type, stream);
2f9ed3
-	  fprintf_filtered (stream, " <repeats %u times>", reps);
2f9ed3
+	  fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
2f9ed3
 	  i = rep1 - 1;
2f9ed3
 	  things_printed += options->repeat_count_threshold;
2f9ed3
 	  need_comma = 1;
2f9ed3
diff --git a/gdb/p-lang.h b/gdb/p-lang.h
2f9ed3
--- a/gdb/p-lang.h
2f9ed3
+++ b/gdb/p-lang.h
2f9ed3
@@ -37,7 +37,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *,
2f9ed3
 extern void pascal_print_typedef (struct type *, struct symbol *,
2f9ed3
 				  struct ui_file *);
2f9ed3
 
2f9ed3
-extern void pascal_val_print (struct type *, int,
2f9ed3
+extern void pascal_val_print (struct type *, LONGEST,
2f9ed3
 			      CORE_ADDR, struct ui_file *, int,
2f9ed3
 			      struct value *,
2f9ed3
 			      const struct value_print_options *);
2f9ed3
@@ -51,13 +51,13 @@ extern void pascal_type_print_method_args (const char *, const char *,
2f9ed3
 /* These are in p-lang.c: */
2f9ed3
 
2f9ed3
 extern int
2f9ed3
-  is_pascal_string_type (struct type *, int *, int *, int *,
2f9ed3
+  is_pascal_string_type (struct type *, LONGEST *, LONGEST *, LONGEST *,
2f9ed3
 			 struct type **, const char **);
2f9ed3
 
2f9ed3
 extern void pascal_printchar (int, struct type *, struct ui_file *);
2f9ed3
 
2f9ed3
 extern void pascal_printstr (struct ui_file *, struct type *, const gdb_byte *,
2f9ed3
-			     unsigned int, const char *, int,
2f9ed3
+			     ULONGEST, const char *, int,
2f9ed3
 			     const struct value_print_options *);
2f9ed3
 
2f9ed3
 extern struct type **const pascal_builtin_types[];
2f9ed3
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
2f9ed3
--- a/gdb/p-valprint.c
2f9ed3
+++ b/gdb/p-valprint.c
2f9ed3
@@ -60,7 +60,7 @@ static const struct generic_val_print_decorations p_decorations =
2f9ed3
 
2f9ed3
 void
2f9ed3
 pascal_val_print (struct type *type,
2f9ed3
-		  int embedded_offset, CORE_ADDR address,
2f9ed3
+		  LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 		  struct ui_file *stream, int recurse,
2f9ed3
 		  struct value *original_value,
2f9ed3
 		  const struct value_print_options *options)
2f9ed3
@@ -70,8 +70,8 @@ pascal_val_print (struct type *type,
2f9ed3
   unsigned int i = 0;	/* Number of characters printed */
2f9ed3
   unsigned len;
2f9ed3
   struct type *elttype;
2f9ed3
-  unsigned eltlen;
2f9ed3
-  int length_pos, length_size, string_pos;
2f9ed3
+  ULONGEST eltlen;
2f9ed3
+  LONGEST length_pos, length_size, string_pos;
2f9ed3
   struct type *char_type;
2f9ed3
   CORE_ADDR addr;
2f9ed3
   int want_space = 0;
2f9ed3
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
2f9ed3
--- a/gdb/ppc-linux-nat.c
2f9ed3
+++ b/gdb/ppc-linux-nat.c
2f9ed3
@@ -1716,7 +1716,7 @@ ppc_linux_nat_target::can_use_hw_breakpoint (enum bptype type, int cnt, int ot)
2f9ed3
 }
2f9ed3
 
2f9ed3
 int
2f9ed3
-ppc_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
2f9ed3
+ppc_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
2f9ed3
 {
2f9ed3
   /* Handle sub-8-byte quantities.  */
2f9ed3
   if (len <= 0)
2f9ed3
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
2f9ed3
--- a/gdb/ppc-linux-tdep.c
2f9ed3
+++ b/gdb/ppc-linux-tdep.c
2f9ed3
@@ -2263,7 +2263,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
2f9ed3
 
2f9ed3
 const struct floatformat **
2f9ed3
 ppc_floatformat_for_type (struct gdbarch *gdbarch,
2f9ed3
-                          const char *name, int len)
2f9ed3
+                          const char *name, LONGEST len)
2f9ed3
 {
2f9ed3
   if (len == 128 && name)
2f9ed3
     {
2f9ed3
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
2f9ed3
--- a/gdb/printcmd.c
2f9ed3
+++ b/gdb/printcmd.c
2f9ed3
@@ -276,7 +276,7 @@ print_formatted (struct value *val, int size,
2f9ed3
 		 struct ui_file *stream)
2f9ed3
 {
2f9ed3
   struct type *type = check_typedef (value_type (val));
2f9ed3
-  int len = TYPE_LENGTH (type);
2f9ed3
+  LONGEST len = TYPE_LENGTH (type);
2f9ed3
 
2f9ed3
   if (VALUE_LVAL (val) == lval_memory)
2f9ed3
     next_address = value_address (val) + len;
2f9ed3
@@ -352,7 +352,7 @@ print_scalar_formatted (const gdb_byte *valaddr, struct type *type,
2f9ed3
 			int size, struct ui_file *stream)
2f9ed3
 {
2f9ed3
   struct gdbarch *gdbarch = get_type_arch (type);
2f9ed3
-  unsigned int len = TYPE_LENGTH (type);
2f9ed3
+  ULONGEST len = TYPE_LENGTH (type);
2f9ed3
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
2f9ed3
 
2f9ed3
   /* String printing should go through val_print_scalar_formatted.  */
2f9ed3
diff --git a/gdb/procfs.c b/gdb/procfs.c
2f9ed3
--- a/gdb/procfs.c
2f9ed3
+++ b/gdb/procfs.c
2f9ed3
@@ -3374,7 +3374,7 @@ procfs_target::remove_watchpoint (CORE_ADDR addr, int len,
2f9ed3
 }
2f9ed3
 
2f9ed3
 int
2f9ed3
-procfs_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
2f9ed3
+procfs_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
2f9ed3
 {
2f9ed3
   /* The man page for proc(4) on Solaris 2.6 and up says that the
2f9ed3
      system can support "thousands" of hardware watchpoints, but gives
2f9ed3
diff --git a/gdb/regcache.c b/gdb/regcache.c
2f9ed3
--- a/gdb/regcache.c
2f9ed3
+++ b/gdb/regcache.c
2f9ed3
@@ -763,7 +763,7 @@ regcache::cooked_write (int regnum, const gdb_byte *buf)
2f9ed3
 /* See regcache.h.  */
2f9ed3
 
2f9ed3
 enum register_status
2f9ed3
-readable_regcache::read_part (int regnum, int offset, int len,
2f9ed3
+readable_regcache::read_part (int regnum, LONGEST offset, LONGEST len,
2f9ed3
 			      gdb_byte *out, bool is_raw)
2f9ed3
 {
2f9ed3
   int reg_size = register_size (arch (), regnum);
2f9ed3
@@ -830,7 +830,7 @@ reg_buffer::raw_collect_part (int regnum, int offset, int len,
2f9ed3
 /* See regcache.h.  */
2f9ed3
 
2f9ed3
 enum register_status
2f9ed3
-regcache::write_part (int regnum, int offset, int len,
2f9ed3
+regcache::write_part (int regnum, LONGEST offset, LONGEST len,
2f9ed3
 		      const gdb_byte *in, bool is_raw)
2f9ed3
 {
2f9ed3
   int reg_size = register_size (arch (), regnum);
2f9ed3
@@ -901,7 +901,7 @@ reg_buffer::raw_supply_part (int regnum, int offset, int len,
2f9ed3
 }
2f9ed3
 
2f9ed3
 enum register_status
2f9ed3
-readable_regcache::raw_read_part (int regnum, int offset, int len,
2f9ed3
+readable_regcache::raw_read_part (int regnum, int offset, LONGEST len,
2f9ed3
 				  gdb_byte *buf)
2f9ed3
 {
2f9ed3
   assert_regnum (regnum);
2f9ed3
@@ -911,7 +911,7 @@ readable_regcache::raw_read_part (int regnum, int offset, int len,
2f9ed3
 /* See regcache.h.  */
2f9ed3
 
2f9ed3
 void
2f9ed3
-regcache::raw_write_part (int regnum, int offset, int len,
2f9ed3
+regcache::raw_write_part (int regnum, int offset, LONGEST len,
2f9ed3
 			  const gdb_byte *buf)
2f9ed3
 {
2f9ed3
   assert_regnum (regnum);
2f9ed3
@@ -921,7 +921,7 @@ regcache::raw_write_part (int regnum, int offset, int len,
2f9ed3
 /* See regcache.h.  */
2f9ed3
 
2f9ed3
 enum register_status
2f9ed3
-readable_regcache::cooked_read_part (int regnum, int offset, int len,
2f9ed3
+readable_regcache::cooked_read_part (int regnum, LONGEST offset, LONGEST len,
2f9ed3
 				     gdb_byte *buf)
2f9ed3
 {
2f9ed3
   gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers);
2f9ed3
@@ -931,7 +931,7 @@ readable_regcache::cooked_read_part (int regnum, int offset, int len,
2f9ed3
 /* See regcache.h.  */
2f9ed3
 
2f9ed3
 void
2f9ed3
-regcache::cooked_write_part (int regnum, int offset, int len,
2f9ed3
+regcache::cooked_write_part (int regnum, LONGEST offset, LONGEST len,
2f9ed3
 			     const gdb_byte *buf)
2f9ed3
 {
2f9ed3
   gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers);
2f9ed3
diff --git a/gdb/regcache.h b/gdb/regcache.h
2f9ed3
--- a/gdb/regcache.h
2f9ed3
+++ b/gdb/regcache.h
2f9ed3
@@ -273,8 +273,8 @@ public:
2f9ed3
   enum register_status raw_read (int regnum, T *val);
2f9ed3
 
2f9ed3
   /* Partial transfer of raw registers.  Return the status of the register.  */
2f9ed3
-  enum register_status raw_read_part (int regnum, int offset, int len,
2f9ed3
-				      gdb_byte *buf);
2f9ed3
+  enum register_status raw_read_part (int regnum, int offset,
2f9ed3
+				      LONGEST len, gdb_byte *buf);
2f9ed3
 
2f9ed3
   /* Make certain that the register REGNUM is up-to-date.  */
2f9ed3
   virtual void raw_update (int regnum) = 0;
2f9ed3
@@ -286,8 +286,8 @@ public:
2f9ed3
   enum register_status cooked_read (int regnum, T *val);
2f9ed3
 
2f9ed3
   /* Partial transfer of a cooked register.  */
2f9ed3
-  enum register_status cooked_read_part (int regnum, int offset, int len,
2f9ed3
-					 gdb_byte *buf);
2f9ed3
+  enum register_status cooked_read_part (int regnum, LONGEST offset,
2f9ed3
+					 LONGEST len, gdb_byte *buf);
2f9ed3
 
2f9ed3
   /* Read register REGNUM from the regcache and return a new value.  This
2f9ed3
      will call mark_value_bytes_unavailable as appropriate.  */
2f9ed3
@@ -297,7 +297,7 @@ protected:
2f9ed3
 
2f9ed3
   /* Perform a partial register transfer using a read, modify, write
2f9ed3
      operation.  Will fail if register is currently invalid.  */
2f9ed3
-  enum register_status read_part (int regnum, int offset, int len,
2f9ed3
+  enum register_status read_part (int regnum, LONGEST offset, LONGEST len,
2f9ed3
 				  gdb_byte *out, bool is_raw);
2f9ed3
 };
2f9ed3
 
2f9ed3
@@ -355,11 +355,12 @@ public:
2f9ed3
 
2f9ed3
   /* Partial transfer of raw registers.  Perform read, modify, write style
2f9ed3
      operations.  */
2f9ed3
-  void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf);
2f9ed3
+  void raw_write_part (int regnum, int offset, LONGEST len,
2f9ed3
+		       const gdb_byte *buf);
2f9ed3
 
2f9ed3
   /* Partial transfer of a cooked register.  Perform read, modify, write style
2f9ed3
      operations.  */
2f9ed3
-  void cooked_write_part (int regnum, int offset, int len,
2f9ed3
+  void cooked_write_part (int regnum, LONGEST offset, LONGEST len,
2f9ed3
 			  const gdb_byte *buf);
2f9ed3
 
2f9ed3
   void supply_regset (const struct regset *regset,
2f9ed3
@@ -410,7 +411,7 @@ private:
2f9ed3
 
2f9ed3
   /* Perform a partial register transfer using a read, modify, write
2f9ed3
      operation.  */
2f9ed3
-  enum register_status write_part (int regnum, int offset, int len,
2f9ed3
+  enum register_status write_part (int regnum, LONGEST offset, LONGEST len,
2f9ed3
 				   const gdb_byte *in, bool is_raw);
2f9ed3
 
2f9ed3
   /* The address space of this register cache (for registers where it
2f9ed3
diff --git a/gdb/remote.c b/gdb/remote.c
2f9ed3
--- a/gdb/remote.c
2f9ed3
+++ b/gdb/remote.c
2f9ed3
@@ -458,7 +458,7 @@ public:
2f9ed3
 
2f9ed3
   int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override;
2f9ed3
 
2f9ed3
-  int region_ok_for_hw_watchpoint (CORE_ADDR, int) override;
2f9ed3
+  int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override;
2f9ed3
 
2f9ed3
   int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
2f9ed3
 			 struct expression *) override;
2f9ed3
@@ -10406,7 +10406,7 @@ int remote_hw_watchpoint_length_limit = -1;
2f9ed3
 int remote_hw_breakpoint_limit = -1;
2f9ed3
 
2f9ed3
 int
2f9ed3
-remote_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
2f9ed3
+remote_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
2f9ed3
 {
2f9ed3
   if (remote_hw_watchpoint_length_limit == 0)
2f9ed3
     return 0;
2f9ed3
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
2f9ed3
--- a/gdb/rust-lang.c
2f9ed3
+++ b/gdb/rust-lang.c
2f9ed3
@@ -301,7 +301,7 @@ rust_printchar (int c, struct type *type, struct ui_file *stream)
2f9ed3
 
2f9ed3
 static void
2f9ed3
 rust_printstr (struct ui_file *stream, struct type *type,
2f9ed3
-	       const gdb_byte *string, unsigned int length,
2f9ed3
+	       const gdb_byte *string, ULONGEST length,
2f9ed3
 	       const char *user_encoding, int force_ellipses,
2f9ed3
 	       const struct value_print_options *options)
2f9ed3
 {
2f9ed3
@@ -517,7 +517,7 @@ static const struct generic_val_print_decorations rust_decorations =
2f9ed3
 /* la_val_print implementation for Rust.  */
2f9ed3
 
2f9ed3
 static void
2f9ed3
-rust_val_print (struct type *type, int embedded_offset,
2f9ed3
+rust_val_print (struct type *type, LONGEST embedded_offset,
2f9ed3
 		CORE_ADDR address, struct ui_file *stream, int recurse,
2f9ed3
 		struct value *val,
2f9ed3
 		const struct value_print_options *options)
2f9ed3
diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
2f9ed3
--- a/gdb/s390-linux-nat.c
2f9ed3
+++ b/gdb/s390-linux-nat.c
2f9ed3
@@ -951,7 +951,8 @@ s390_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch,
2f9ed3
 }
2f9ed3
 
2f9ed3
 int
2f9ed3
-s390_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int cnt)
2f9ed3
+s390_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr,
2f9ed3
+						    LONGEST cnt)
2f9ed3
 {
2f9ed3
   return 1;
2f9ed3
 }
2f9ed3
diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c
2f9ed3
--- a/gdb/spu-multiarch.c
2f9ed3
+++ b/gdb/spu-multiarch.c
2f9ed3
@@ -65,7 +65,7 @@ struct spu_multiarch_target final : public target_ops
2f9ed3
 		     const gdb_byte *pattern, ULONGEST pattern_len,
2f9ed3
 		     CORE_ADDR *found_addrp) override;
2f9ed3
 
2f9ed3
-  int region_ok_for_hw_watchpoint (CORE_ADDR, int) override;
2f9ed3
+  int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override;
2f9ed3
 
2f9ed3
   struct gdbarch *thread_architecture (ptid_t) override;
2f9ed3
 };
2f9ed3
@@ -162,7 +162,7 @@ spu_multiarch_target::thread_architecture (ptid_t ptid)
2f9ed3
 /* Override the to_region_ok_for_hw_watchpoint routine.  */
2f9ed3
 
2f9ed3
 int
2f9ed3
-spu_multiarch_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
2f9ed3
+spu_multiarch_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
2f9ed3
 {
2f9ed3
   /* We cannot watch SPU local store.  */
2f9ed3
   if (SPUADDR_SPU (addr) != -1)
2f9ed3
diff --git a/gdb/stack.c b/gdb/stack.c
2f9ed3
--- a/gdb/stack.c
2f9ed3
+++ b/gdb/stack.c
2f9ed3
@@ -194,7 +194,7 @@ print_stack_frame (struct frame_info *frame, int print_level,
2f9ed3
    argument (not just the first nameless argument).  */
2f9ed3
 
2f9ed3
 static void
2f9ed3
-print_frame_nameless_args (struct frame_info *frame, long start, int num,
2f9ed3
+print_frame_nameless_args (struct frame_info *frame, LONGEST start, int num,
2f9ed3
 			   int first, struct ui_file *stream)
2f9ed3
 {
2f9ed3
   struct gdbarch *gdbarch = get_frame_arch (frame);
2f9ed3
@@ -544,7 +544,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
2f9ed3
   /* Offset of next stack argument beyond the one we have seen that is
2f9ed3
      at the highest offset, or -1 if we haven't come to a stack
2f9ed3
      argument yet.  */
2f9ed3
-  long highest_offset = -1;
2f9ed3
+  LONGEST highest_offset = -1;
2f9ed3
   /* Number of ints of arguments that we have printed so far.  */
2f9ed3
   int args_printed = 0;
2f9ed3
   /* True if we should print arguments, false otherwise.  */
2f9ed3
@@ -573,8 +573,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
2f9ed3
 	    case LOC_ARG:
2f9ed3
 	    case LOC_REF_ARG:
2f9ed3
 	      {
2f9ed3
-		long current_offset = SYMBOL_VALUE (sym);
2f9ed3
-		int arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
2f9ed3
+		LONGEST current_offset = SYMBOL_VALUE (sym);
2f9ed3
+		LONGEST arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
2f9ed3
 
2f9ed3
 		/* Compute address of next argument by adding the size of
2f9ed3
 		   this argument and rounding to an int boundary.  */
2f9ed3
@@ -709,7 +709,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
2f9ed3
      enough about the stack to find them.  */
2f9ed3
   if (num != -1)
2f9ed3
     {
2f9ed3
-      long start;
2f9ed3
+      LONGEST start;
2f9ed3
 
2f9ed3
       if (highest_offset == -1)
2f9ed3
 	start = gdbarch_frame_args_skip (get_frame_arch (frame));
2f9ed3
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
2f9ed3
--- a/gdb/symmisc.c
2f9ed3
+++ b/gdb/symmisc.c
2f9ed3
@@ -587,11 +587,11 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
2f9ed3
 
2f9ed3
 	case LOC_CONST_BYTES:
2f9ed3
 	  {
2f9ed3
-	    unsigned i;
2f9ed3
+	    ULONGEST i;
2f9ed3
 	    struct type *type = check_typedef (SYMBOL_TYPE (symbol));
2f9ed3
 
2f9ed3
-	    fprintf_filtered (outfile, "const %u hex bytes:",
2f9ed3
-			      TYPE_LENGTH (type));
2f9ed3
+	    fprintf_filtered (outfile, "const %s hex bytes:",
2f9ed3
+			      pulongest (TYPE_LENGTH (type)));
2f9ed3
 	    for (i = 0; i < TYPE_LENGTH (type); i++)
2f9ed3
 	      fprintf_filtered (outfile, " %02x",
2f9ed3
 				(unsigned) SYMBOL_VALUE_BYTES (symbol)[i]);
2f9ed3
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
2f9ed3
--- a/gdb/target-delegates.c
2f9ed3
+++ b/gdb/target-delegates.c
2f9ed3
@@ -38,7 +38,7 @@ struct dummy_target : public target_ops
2f9ed3
   bool have_steppable_watchpoint () override;
2f9ed3
   bool stopped_data_address (CORE_ADDR *arg0) override;
2f9ed3
   bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override;
2f9ed3
-  int region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) override;
2f9ed3
+  int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override;
2f9ed3
   bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override;
2f9ed3
   int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override;
2f9ed3
   int can_do_single_step () override;
2f9ed3
@@ -205,7 +205,7 @@ struct debug_target : public target_ops
2f9ed3
   bool have_steppable_watchpoint () override;
2f9ed3
   bool stopped_data_address (CORE_ADDR *arg0) override;
2f9ed3
   bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override;
2f9ed3
-  int region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) override;
2f9ed3
+  int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override;
2f9ed3
   bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override;
2f9ed3
   int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override;
2f9ed3
   int can_do_single_step () override;
2f9ed3
@@ -1071,19 +1071,19 @@ debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int
2f9ed3
 }
2f9ed3
 
2f9ed3
 int
2f9ed3
-target_ops::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1)
2f9ed3
+target_ops::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1)
2f9ed3
 {
2f9ed3
   return this->beneath ()->region_ok_for_hw_watchpoint (arg0, arg1);
2f9ed3
 }
2f9ed3
 
2f9ed3
 int
2f9ed3
-dummy_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1)
2f9ed3
+dummy_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1)
2f9ed3
 {
2f9ed3
   return default_region_ok_for_hw_watchpoint (this, arg0, arg1);
2f9ed3
 }
2f9ed3
 
2f9ed3
 int
2f9ed3
-debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1)
2f9ed3
+debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1)
2f9ed3
 {
2f9ed3
   int result;
2f9ed3
   fprintf_unfiltered (gdb_stdlog, "-> %s->region_ok_for_hw_watchpoint (...)\n", this->beneath ()->shortname ());
2f9ed3
@@ -1091,7 +1091,7 @@ debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1)
2f9ed3
   fprintf_unfiltered (gdb_stdlog, "<- %s->region_ok_for_hw_watchpoint (", this->beneath ()->shortname ());
2f9ed3
   target_debug_print_CORE_ADDR (arg0);
2f9ed3
   fputs_unfiltered (", ", gdb_stdlog);
2f9ed3
-  target_debug_print_int (arg1);
2f9ed3
+  target_debug_print_LONGEST (arg1);
2f9ed3
   fputs_unfiltered (") = ", gdb_stdlog);
2f9ed3
   target_debug_print_int (result);
2f9ed3
   fputs_unfiltered ("\n", gdb_stdlog);
2f9ed3
diff --git a/gdb/target.c b/gdb/target.c
2f9ed3
--- a/gdb/target.c
2f9ed3
+++ b/gdb/target.c
2f9ed3
@@ -58,7 +58,7 @@ static int default_watchpoint_addr_within_range (struct target_ops *,
2f9ed3
 						 CORE_ADDR, CORE_ADDR, int);
2f9ed3
 
2f9ed3
 static int default_region_ok_for_hw_watchpoint (struct target_ops *,
2f9ed3
-						CORE_ADDR, int);
2f9ed3
+						CORE_ADDR, LONGEST);
2f9ed3
 
2f9ed3
 static void default_rcmd (struct target_ops *, const char *, struct ui_file *);
2f9ed3
 
2f9ed3
@@ -3103,7 +3103,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename)
2f9ed3
 
2f9ed3
 static int
2f9ed3
 default_region_ok_for_hw_watchpoint (struct target_ops *self,
2f9ed3
-				     CORE_ADDR addr, int len)
2f9ed3
+				     CORE_ADDR addr, LONGEST len)
2f9ed3
 {
2f9ed3
   return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT);
2f9ed3
 }
2f9ed3
diff --git a/gdb/target.h b/gdb/target.h
2f9ed3
--- a/gdb/target.h
2f9ed3
+++ b/gdb/target.h
2f9ed3
@@ -566,7 +566,7 @@ struct target_ops
2f9ed3
 
2f9ed3
     /* Documentation of this routine is provided with the corresponding
2f9ed3
        target_* macro.  */
2f9ed3
-    virtual int region_ok_for_hw_watchpoint (CORE_ADDR, int)
2f9ed3
+    virtual int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST)
2f9ed3
       TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
2f9ed3
 
2f9ed3
     virtual bool can_accel_watchpoint_condition (CORE_ADDR, int, int,
2f9ed3
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
2f9ed3
--- a/gdb/tracepoint.c
2f9ed3
+++ b/gdb/tracepoint.c
2f9ed3
@@ -893,10 +893,10 @@ collection_list::add_local_register (struct gdbarch *gdbarch,
2f9ed3
 void
2f9ed3
 collection_list::add_memrange (struct gdbarch *gdbarch,
2f9ed3
 			       int type, bfd_signed_vma base,
2f9ed3
-			       unsigned long len, CORE_ADDR scope)
2f9ed3
+			       ULONGEST len, CORE_ADDR scope)
2f9ed3
 {
2f9ed3
   if (info_verbose)
2f9ed3
-    printf_filtered ("(%d,%s,%ld)\n", type, paddress (gdbarch, base), len);
2f9ed3
+    printf_filtered ("(%d,%s,%s)\n", type, paddress (gdbarch, base), pulongest (len));
2f9ed3
 
2f9ed3
   /* type: memrange_absolute == memory, other n == basereg */
2f9ed3
   /* base: addr if memory, offset if reg relative.  */
2f9ed3
@@ -916,7 +916,7 @@ collection_list::collect_symbol (struct symbol *sym,
2f9ed3
 				 CORE_ADDR scope,
2f9ed3
 				 int trace_string)
2f9ed3
 {
2f9ed3
-  unsigned long len;
2f9ed3
+  ULONGEST len;
2f9ed3
   unsigned int reg;
2f9ed3
   bfd_signed_vma offset;
2f9ed3
   int treat_as_expr = 0;
2f9ed3
@@ -937,8 +937,8 @@ collection_list::collect_symbol (struct symbol *sym,
2f9ed3
       offset = SYMBOL_VALUE_ADDRESS (sym);
2f9ed3
       if (info_verbose)
2f9ed3
 	{
2f9ed3
-	  printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n",
2f9ed3
-			   SYMBOL_PRINT_NAME (sym), len,
2f9ed3
+	  printf_filtered ("LOC_STATIC %s: collect %s bytes at %s.\n",
2f9ed3
+			   SYMBOL_PRINT_NAME (sym), pulongest (len),
2f9ed3
 			   paddress (gdbarch, offset));
2f9ed3
 	}
2f9ed3
       /* A struct may be a C++ class with static fields, go to general
2f9ed3
@@ -970,9 +970,9 @@ collection_list::collect_symbol (struct symbol *sym,
2f9ed3
       offset = frame_offset + SYMBOL_VALUE (sym);
2f9ed3
       if (info_verbose)
2f9ed3
 	{
2f9ed3
-	  printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
2f9ed3
+	  printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s"
2f9ed3
 			   " from frame ptr reg %d\n",
2f9ed3
-			   SYMBOL_PRINT_NAME (sym), len,
2f9ed3
+			   SYMBOL_PRINT_NAME (sym), pulongest (len),
2f9ed3
 			   paddress (gdbarch, offset), reg);
2f9ed3
 	}
2f9ed3
       add_memrange (gdbarch, reg, offset, len, scope);
2f9ed3
@@ -982,9 +982,9 @@ collection_list::collect_symbol (struct symbol *sym,
2f9ed3
       offset = 0;
2f9ed3
       if (info_verbose)
2f9ed3
 	{
2f9ed3
-	  printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset %s"
2f9ed3
+	  printf_filtered ("LOC_REGPARM_ADDR %s: Collect %s bytes at offset %s"
2f9ed3
 			   " from reg %d\n",
2f9ed3
-			   SYMBOL_PRINT_NAME (sym), len,
2f9ed3
+			   SYMBOL_PRINT_NAME (sym), pulongest (len),
2f9ed3
 			   paddress (gdbarch, offset), reg);
2f9ed3
 	}
2f9ed3
       add_memrange (gdbarch, reg, offset, len, scope);
2f9ed3
@@ -994,9 +994,9 @@ collection_list::collect_symbol (struct symbol *sym,
2f9ed3
       offset = frame_offset + SYMBOL_VALUE (sym);
2f9ed3
       if (info_verbose)
2f9ed3
 	{
2f9ed3
-	  printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
2f9ed3
+	  printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s"
2f9ed3
 			   " from frame ptr reg %d\n",
2f9ed3
-			   SYMBOL_PRINT_NAME (sym), len,
2f9ed3
+			   SYMBOL_PRINT_NAME (sym), pulongest (len),
2f9ed3
 			   paddress (gdbarch, offset), reg);
2f9ed3
 	}
2f9ed3
       add_memrange (gdbarch, reg, offset, len, scope);
2f9ed3
@@ -2492,7 +2492,8 @@ info_scope_command (const char *args_in, int from_tty)
2f9ed3
   const char *symname;
2f9ed3
   const char *save_args = args_in;
2f9ed3
   struct block_iterator iter;
2f9ed3
-  int j, count = 0;
2f9ed3
+  int count = 0;
2f9ed3
+  LONGEST j;
2f9ed3
   struct gdbarch *gdbarch;
2f9ed3
   int regno;
2f9ed3
   const char *args = args_in;
2f9ed3
@@ -2636,8 +2637,11 @@ info_scope_command (const char *args_in, int from_tty)
2f9ed3
 		}
2f9ed3
 	    }
2f9ed3
 	  if (SYMBOL_TYPE (sym))
2f9ed3
-	    printf_filtered (", length %d.\n",
2f9ed3
-			     TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))));
2f9ed3
+	    {
2f9ed3
+	      ULONGEST len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)));
2f9ed3
+
2f9ed3
+	      printf_filtered (", length %s.\n", pulongest (len));
2f9ed3
+	    }
2f9ed3
 	}
2f9ed3
       if (BLOCK_FUNCTION (block))
2f9ed3
 	break;
2f9ed3
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
2f9ed3
--- a/gdb/tracepoint.h
2f9ed3
+++ b/gdb/tracepoint.h
2f9ed3
@@ -269,7 +269,7 @@ public:
2f9ed3
 			   CORE_ADDR scope);
2f9ed3
   void add_memrange (struct gdbarch *gdbarch,
2f9ed3
 		     int type, bfd_signed_vma base,
2f9ed3
-		     unsigned long len, CORE_ADDR scope);
2f9ed3
+		     ULONGEST len, CORE_ADDR scope);
2f9ed3
   void collect_symbol (struct symbol *sym,
2f9ed3
 		       struct gdbarch *gdbarch,
2f9ed3
 		       long frame_regno, long frame_offset,
2f9ed3
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
2f9ed3
--- a/gdb/typeprint.c
2f9ed3
+++ b/gdb/typeprint.c
2f9ed3
@@ -120,7 +120,8 @@ print_offset_data::update (struct type *type, unsigned int field_idx,
2f9ed3
     {
2f9ed3
       /* Since union fields don't have the concept of offsets, we just
2f9ed3
 	 print their sizes.  */
2f9ed3
-      fprintf_filtered (stream, "/*              %4u */", TYPE_LENGTH (ftype));
2f9ed3
+      fprintf_filtered (stream, "/*              %4s */",
2f9ed3
+			pulongest (TYPE_LENGTH (ftype)));
2f9ed3
       return;
2f9ed3
     }
2f9ed3
 
2f9ed3
@@ -183,8 +184,8 @@ print_offset_data::finish (struct type *type, int level,
2f9ed3
 
2f9ed3
   fputs_filtered ("\n", stream);
2f9ed3
   print_spaces_filtered (level + 4 + print_offset_data::indentation, stream);
2f9ed3
-  fprintf_filtered (stream, "/* total size (bytes): %4u */\n",
2f9ed3
-		    TYPE_LENGTH (type));
2f9ed3
+  fprintf_filtered (stream, "/* total size (bytes): %4s */\n",
2f9ed3
+		    pulongest (TYPE_LENGTH (type)));
2f9ed3
 }
2f9ed3
 
2f9ed3
 
2f9ed3
diff --git a/gdb/valarith.c b/gdb/valarith.c
2f9ed3
--- a/gdb/valarith.c
2f9ed3
+++ b/gdb/valarith.c
2f9ed3
@@ -182,7 +182,7 @@ value_subscript (struct value *array, LONGEST index)
2f9ed3
    to doubles, but no longer does.  */
2f9ed3
 
2f9ed3
 struct value *
2f9ed3
-value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
2f9ed3
+value_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound)
2f9ed3
 {
2f9ed3
   struct type *array_type = check_typedef (value_type (array));
2f9ed3
   struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
2f9ed3
@@ -656,7 +656,7 @@ value_concat (struct value *arg1, struct value *arg2)
2f9ed3
   struct value *inval1;
2f9ed3
   struct value *inval2;
2f9ed3
   struct value *outval = NULL;
2f9ed3
-  int inval1len, inval2len;
2f9ed3
+  ssize_t inval1len, inval2len;
2f9ed3
   int count, idx;
2f9ed3
   char inchar;
2f9ed3
   struct type *type1 = check_typedef (value_type (arg1));
2f9ed3
@@ -1416,7 +1416,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
2f9ed3
 int
2f9ed3
 value_logical_not (struct value *arg1)
2f9ed3
 {
2f9ed3
-  int len;
2f9ed3
+  LONGEST len;
2f9ed3
   const gdb_byte *p;
2f9ed3
   struct type *type1;
2f9ed3
 
2f9ed3
@@ -1444,11 +1444,11 @@ value_logical_not (struct value *arg1)
2f9ed3
 static int
2f9ed3
 value_strcmp (struct value *arg1, struct value *arg2)
2f9ed3
 {
2f9ed3
-  int len1 = TYPE_LENGTH (value_type (arg1));
2f9ed3
-  int len2 = TYPE_LENGTH (value_type (arg2));
2f9ed3
+  LONGEST len1 = TYPE_LENGTH (value_type (arg1));
2f9ed3
+  LONGEST len2 = TYPE_LENGTH (value_type (arg2));
2f9ed3
   const gdb_byte *s1 = value_contents (arg1);
2f9ed3
   const gdb_byte *s2 = value_contents (arg2);
2f9ed3
-  int i, len = len1 < len2 ? len1 : len2;
2f9ed3
+  LONGEST i, len = len1 < len2 ? len1 : len2;
2f9ed3
 
2f9ed3
   for (i = 0; i < len; i++)
2f9ed3
     {
2f9ed3
diff --git a/gdb/valops.c b/gdb/valops.c
2f9ed3
--- a/gdb/valops.c
2f9ed3
+++ b/gdb/valops.c
2f9ed3
@@ -81,7 +81,7 @@ static enum oload_classification classify_oload_match
2f9ed3
   (const badness_vector &, int, int);
2f9ed3
 
2f9ed3
 static struct value *value_struct_elt_for_reference (struct type *,
2f9ed3
-						     int, struct type *,
2f9ed3
+						     LONGEST, struct type *,
2f9ed3
 						     const char *,
2f9ed3
 						     struct type *,
2f9ed3
 						     int, enum noside);
2f9ed3
@@ -171,7 +171,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p)
2f9ed3
    space.  */
2f9ed3
 
2f9ed3
 struct value *
2f9ed3
-value_allocate_space_in_inferior (int len)
2f9ed3
+value_allocate_space_in_inferior (LONGEST len)
2f9ed3
 {
2f9ed3
   struct objfile *objf;
2f9ed3
   struct value *val = find_function_in_inferior ("malloc", &objf);
2f9ed3
@@ -386,12 +386,12 @@ value_cast (struct type *type, struct value *arg2)
2f9ed3
   if (code1 == TYPE_CODE_ARRAY)
2f9ed3
     {
2f9ed3
       struct type *element_type = TYPE_TARGET_TYPE (type);
2f9ed3
-      unsigned element_length = TYPE_LENGTH (check_typedef (element_type));
2f9ed3
+      ULONGEST element_length = TYPE_LENGTH (check_typedef (element_type));
2f9ed3
 
2f9ed3
       if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
2f9ed3
 	{
2f9ed3
 	  struct type *range_type = TYPE_INDEX_TYPE (type);
2f9ed3
-	  int val_length = TYPE_LENGTH (type2);
2f9ed3
+	  LONGEST val_length = TYPE_LENGTH (type2);
2f9ed3
 	  LONGEST low_bound, high_bound, new_length;
2f9ed3
 
2f9ed3
 	  if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
2f9ed3
@@ -1043,7 +1043,7 @@ value_assign (struct value *toval, struct value *fromval)
2f9ed3
       {
2f9ed3
 	const gdb_byte *dest_buffer;
2f9ed3
 	CORE_ADDR changed_addr;
2f9ed3
-	int changed_len;
2f9ed3
+	LONGEST changed_len;
2f9ed3
         gdb_byte buffer[sizeof (LONGEST)];
2f9ed3
 
2f9ed3
 	if (value_bitsize (toval))
2f9ed3
@@ -3335,7 +3335,7 @@ get_baseclass_offset (struct type *vt, struct type *cls,
2f9ed3
    the form "DOMAIN::NAME".  */
2f9ed3
 
2f9ed3
 static struct value *
2f9ed3
-value_struct_elt_for_reference (struct type *domain, int offset,
2f9ed3
+value_struct_elt_for_reference (struct type *domain, LONGEST offset,
2f9ed3
 				struct type *curtype, const char *name,
2f9ed3
 				struct type *intype, 
2f9ed3
 				int want_address,
2f9ed3
@@ -3369,7 +3369,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
2f9ed3
 	  if (want_address)
2f9ed3
 	    return value_from_longest
2f9ed3
 	      (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain),
2f9ed3
-	       offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3));
2f9ed3
+	       offset + (TYPE_FIELD_BITPOS (t, i) >> 3));
2f9ed3
 	  else if (noside != EVAL_NORMAL)
2f9ed3
 	    return allocate_value (TYPE_FIELD_TYPE (t, i));
2f9ed3
 	  else
2f9ed3
@@ -3548,7 +3548,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
2f9ed3
   for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--)
2f9ed3
     {
2f9ed3
       struct value *v;
2f9ed3
-      int base_offset;
2f9ed3
+      LONGEST base_offset;
2f9ed3
 
2f9ed3
       if (BASETYPE_VIA_VIRTUAL (t, i))
2f9ed3
 	base_offset = 0;
2f9ed3
@@ -3697,7 +3697,7 @@ value_rtti_indirect_type (struct value *v, int *full,
2f9ed3
 struct value *
2f9ed3
 value_full_object (struct value *argp, 
2f9ed3
 		   struct type *rtype, 
2f9ed3
-		   int xfull, int xtop,
2f9ed3
+		   int xfull, LONGEST xtop,
2f9ed3
 		   int xusing_enc)
2f9ed3
 {
2f9ed3
   struct type *real_type;
2f9ed3
diff --git a/gdb/valprint.c b/gdb/valprint.c
2f9ed3
--- a/gdb/valprint.c
2f9ed3
+++ b/gdb/valprint.c
2f9ed3
@@ -879,7 +879,7 @@ generic_val_print_complex (struct type *type,
2f9ed3
 
2f9ed3
 void
2f9ed3
 generic_val_print (struct type *type,
2f9ed3
-		   int embedded_offset, CORE_ADDR address,
2f9ed3
+		   LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 		   struct ui_file *stream, int recurse,
2f9ed3
 		   struct value *original_value,
2f9ed3
 		   const struct value_print_options *options,
2f9ed3
@@ -1774,7 +1774,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr,
2f9ed3
 
2f9ed3
 void
2f9ed3
 print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr,
2f9ed3
-		 unsigned len, enum bfd_endian byte_order,
2f9ed3
+		 ULONGEST len, enum bfd_endian byte_order,
2f9ed3
 		 bool zero_pad)
2f9ed3
 {
2f9ed3
   const gdb_byte *p;
2f9ed3
@@ -1927,17 +1927,17 @@ val_print_array_elements (struct type *type,
2f9ed3
 			  int recurse,
2f9ed3
 			  struct value *val,
2f9ed3
 			  const struct value_print_options *options,
2f9ed3
-			  unsigned int i)
2f9ed3
+			  ULONGEST i)
2f9ed3
 {
2f9ed3
   unsigned int things_printed = 0;
2f9ed3
-  unsigned len;
2f9ed3
+  ULONGEST len;
2f9ed3
   struct type *elttype, *index_type, *base_index_type;
2f9ed3
-  unsigned eltlen;
2f9ed3
+  ULONGEST eltlen;
2f9ed3
   /* Position of the array element we are examining to see
2f9ed3
      whether it is repeated.  */
2f9ed3
-  unsigned int rep1;
2f9ed3
+  ULONGEST rep1;
2f9ed3
   /* Number of repetitions we have detected so far.  */
2f9ed3
-  unsigned int reps;
2f9ed3
+  ULONGEST reps;
2f9ed3
   LONGEST low_bound, high_bound;
2f9ed3
   LONGEST low_pos, high_pos;
2f9ed3
 
2f9ed3
@@ -2027,7 +2027,7 @@ val_print_array_elements (struct type *type,
2f9ed3
 		     address, stream, recurse + 1, val, options,
2f9ed3
 		     current_language);
2f9ed3
 	  annotate_elt_rep (reps);
2f9ed3
-	  fprintf_filtered (stream, " <repeats %u times>", reps);
2f9ed3
+	  fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
2f9ed3
 	  annotate_elt_rep_end ();
2f9ed3
 
2f9ed3
 	  i = rep1 - 1;
2f9ed3
@@ -2669,7 +2669,7 @@ print_converted_chars_to_obstack (struct obstack *obstack,
2f9ed3
 
2f9ed3
 void
2f9ed3
 generic_printstr (struct ui_file *stream, struct type *type, 
2f9ed3
-		  const gdb_byte *string, unsigned int length, 
2f9ed3
+		  const gdb_byte *string, ULONGEST length,
2f9ed3
 		  const char *encoding, int force_ellipses,
2f9ed3
 		  int quote_char, int c_style_terminator,
2f9ed3
 		  const struct value_print_options *options)
2f9ed3
diff --git a/gdb/valprint.h b/gdb/valprint.h
2f9ed3
--- a/gdb/valprint.h
2f9ed3
+++ b/gdb/valprint.h
2f9ed3
@@ -119,7 +119,7 @@ extern void val_print_array_elements (struct type *, LONGEST,
2f9ed3
 				      CORE_ADDR, struct ui_file *, int,
2f9ed3
 				      struct value *,
2f9ed3
 				      const struct value_print_options *,
2f9ed3
-				      unsigned int);
2f9ed3
+				      ULONGEST);
2f9ed3
 
2f9ed3
 extern void val_print_scalar_formatted (struct type *,
2f9ed3
 					LONGEST,
2f9ed3
@@ -138,7 +138,7 @@ extern void print_decimal_chars (struct ui_file *, const gdb_byte *,
2f9ed3
 				 unsigned int, bool, enum bfd_endian);
2f9ed3
 
2f9ed3
 extern void print_hex_chars (struct ui_file *, const gdb_byte *,
2f9ed3
-			     unsigned int, enum bfd_endian, bool);
2f9ed3
+			     ULONGEST, enum bfd_endian, bool);
2f9ed3
 
2f9ed3
 extern void print_char_chars (struct ui_file *, struct type *,
2f9ed3
 			      const gdb_byte *, unsigned int, enum bfd_endian);
2f9ed3
@@ -192,7 +192,7 @@ struct generic_val_print_decorations
2f9ed3
 
2f9ed3
 
2f9ed3
 extern void generic_val_print (struct type *type,
2f9ed3
-			       int embedded_offset, CORE_ADDR address,
2f9ed3
+			       LONGEST embedded_offset, CORE_ADDR address,
2f9ed3
 			       struct ui_file *stream, int recurse,
2f9ed3
 			       struct value *original_value,
2f9ed3
 			       const struct value_print_options *options,
2f9ed3
@@ -202,7 +202,7 @@ extern void generic_emit_char (int c, struct type *type, struct ui_file *stream,
2f9ed3
 			       int quoter, const char *encoding);
2f9ed3
 
2f9ed3
 extern void generic_printstr (struct ui_file *stream, struct type *type, 
2f9ed3
-			      const gdb_byte *string, unsigned int length, 
2f9ed3
+			      const gdb_byte *string, ULONGEST length,
2f9ed3
 			      const char *encoding, int force_ellipses,
2f9ed3
 			      int quote_char, int c_style_terminator,
2f9ed3
 			      const struct value_print_options *options);
2f9ed3
diff --git a/gdb/value.c b/gdb/value.c
2f9ed3
--- a/gdb/value.c
2f9ed3
+++ b/gdb/value.c
2f9ed3
@@ -383,7 +383,8 @@ value_bytes_available (const struct value *value,
2f9ed3
 }
2f9ed3
 
2f9ed3
 int
2f9ed3
-value_bits_any_optimized_out (const struct value *value, int bit_offset, int bit_length)
2f9ed3
+value_bits_any_optimized_out (const struct value *value, LONGEST bit_offset,
2f9ed3
+			      LONGEST bit_length)
2f9ed3
 {
2f9ed3
   gdb_assert (!value->lazy);
2f9ed3
 
2f9ed3
@@ -831,8 +832,8 @@ find_first_range_overlap_and_match (struct ranges_and_idx *rp1,
2f9ed3
    Return true if the available bits match.  */
2f9ed3
 
2f9ed3
 static bool
2f9ed3
-value_contents_bits_eq (const struct value *val1, int offset1,
2f9ed3
-			const struct value *val2, int offset2,
2f9ed3
+value_contents_bits_eq (const struct value *val1, LONGEST offset1,
2f9ed3
+			const struct value *val2, LONGEST offset2,
2f9ed3
 			int length)
2f9ed3
 {
2f9ed3
   /* Each array element corresponds to a ranges source (unavailable,
2f9ed3
@@ -1423,7 +1424,8 @@ value_optimized_out (struct value *value)
2f9ed3
    the following LENGTH bytes.  */
2f9ed3
 
2f9ed3
 void
2f9ed3
-mark_value_bytes_optimized_out (struct value *value, int offset, int length)
2f9ed3
+mark_value_bytes_optimized_out (struct value *value, LONGEST offset,
2f9ed3
+				LONGEST length)
2f9ed3
 {
2f9ed3
   mark_value_bits_optimized_out (value,
2f9ed3
 				 offset * TARGET_CHAR_BIT,
2f9ed3
diff --git a/gdb/value.h b/gdb/value.h
2f9ed3
--- a/gdb/value.h
2f9ed3
+++ b/gdb/value.h
2f9ed3
@@ -274,7 +274,7 @@ struct lval_funcs
2f9ed3
   /* If non-NULL, this is used to determine whether the indicated bits
2f9ed3
      of VALUE are a synthetic pointer.  */
2f9ed3
   int (*check_synthetic_pointer) (const struct value *value,
2f9ed3
-				  LONGEST offset, int length);
2f9ed3
+				  LONGEST offset, LONGEST length);
2f9ed3
 
2f9ed3
   /* Return a duplicate of VALUE's closure, for use in a new value.
2f9ed3
      This may simply return the same closure, if VALUE's is
2f9ed3
@@ -405,7 +405,8 @@ extern int value_optimized_out (struct value *value);
2f9ed3
    otherwise.  */
2f9ed3
 
2f9ed3
 extern int value_bits_any_optimized_out (const struct value *value,
2f9ed3
-					 int bit_offset, int bit_length);
2f9ed3
+					 LONGEST bit_offset,
2f9ed3
+					 LONGEST bit_length);
2f9ed3
 
2f9ed3
 /* Like value_optimized_out, but return true iff the whole value is
2f9ed3
    optimized out.  */
2f9ed3
@@ -415,7 +416,7 @@ extern int value_entirely_optimized_out (struct value *value);
2f9ed3
    LENGTH bytes as optimized out.  */
2f9ed3
 
2f9ed3
 extern void mark_value_bytes_optimized_out (struct value *value,
2f9ed3
-					    int offset, int length);
2f9ed3
+					    LONGEST offset, LONGEST length);
2f9ed3
 
2f9ed3
 /* Mark VALUE's content bits starting at OFFSET and extending for
2f9ed3
    LENGTH bits as optimized out.  */
2f9ed3
@@ -849,12 +850,11 @@ extern struct value *value_primitive_field (struct value *arg1, LONGEST offset,
2f9ed3
 					    int fieldno,
2f9ed3
 					    struct type *arg_type);
2f9ed3
 
2f9ed3
-
2f9ed3
 extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *,
2f9ed3
 					      int *);
2f9ed3
 
2f9ed3
 extern struct value *value_full_object (struct value *, struct type *, int,
2f9ed3
-					int, int);
2f9ed3
+					LONGEST, int);
2f9ed3
 
2f9ed3
 extern struct value *value_cast_pointers (struct type *, struct value *, int);
2f9ed3
 
2f9ed3
@@ -1147,10 +1147,11 @@ extern struct value *value_literal_complex (struct value *, struct value *,
2f9ed3
 extern struct value *find_function_in_inferior (const char *,
2f9ed3
 						struct objfile **);
2f9ed3
 
2f9ed3
-extern struct value *value_allocate_space_in_inferior (int);
2f9ed3
+extern struct value *value_allocate_space_in_inferior (LONGEST);
2f9ed3
 
2f9ed3
 extern struct value *value_subscripted_rvalue (struct value *array,
2f9ed3
-					       LONGEST index, int lowerbound);
2f9ed3
+					       LONGEST index,
2f9ed3
+					       LONGEST lowerbound);
2f9ed3
 
2f9ed3
 /* User function handler.  */
2f9ed3
 
2f9ed3
diff --git a/gdb/x86-nat.c b/gdb/x86-nat.c
2f9ed3
--- a/gdb/x86-nat.c
2f9ed3
+++ b/gdb/x86-nat.c
2f9ed3
@@ -173,7 +173,7 @@ x86_remove_watchpoint (CORE_ADDR addr, int len,
2f9ed3
    address ADDR and whose length is LEN bytes.  */
2f9ed3
 
2f9ed3
 int
2f9ed3
-x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
2f9ed3
+x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
2f9ed3
 {
2f9ed3
   struct x86_debug_reg_state *state
2f9ed3
     = x86_debug_reg_state (inferior_ptid.pid ());
2f9ed3
diff --git a/gdb/x86-nat.h b/gdb/x86-nat.h
2f9ed3
--- a/gdb/x86-nat.h
2f9ed3
+++ b/gdb/x86-nat.h
2f9ed3
@@ -49,7 +49,7 @@ extern void x86_forget_process (pid_t pid);
2f9ed3
    definitions.  */
2f9ed3
 
2f9ed3
 extern int x86_can_use_hw_breakpoint (enum bptype type, int cnt, int othertype);
2f9ed3
-extern int x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len);
2f9ed3
+extern int x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len);
2f9ed3
 extern int x86_stopped_by_watchpoint ();
2f9ed3
 extern int x86_stopped_data_address (CORE_ADDR *addr_p);
2f9ed3
 extern int x86_insert_watchpoint (CORE_ADDR addr, int len,
2f9ed3
@@ -75,7 +75,7 @@ struct x86_nat_target : public BaseTarget
2f9ed3
   int can_use_hw_breakpoint (enum bptype type, int cnt, int othertype) override
2f9ed3
   { return x86_can_use_hw_breakpoint (type, cnt, othertype); }
2f9ed3
 
2f9ed3
-  int region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) override
2f9ed3
+  int region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) override
2f9ed3
   { return x86_region_ok_for_hw_watchpoint (addr, len); }
2f9ed3
 
2f9ed3
   int insert_watchpoint (CORE_ADDR addr, int len,