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

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