a8767b3
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
f524ac5
From: Fedora GDB patches <invalid@email.com>
f524ac5
Date: Fri, 27 Oct 2017 21:07:50 +0200
fd7e5d7
Subject: gdb-rhbz795424-bitpos-20of25.patch
f524ac5
f637971
;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
f637971
;; (RH BZ 795424).
f637971
;;=push
f524ac5
f637971
http://sourceware.org/ml/gdb-patches/2012-09/msg00631.html
92b52c5
92b52c5
--MP_/yp5f+W_ED2JtUlSyBi8xujr
92b52c5
Content-Type: text/plain; charset=US-ASCII
92b52c5
Content-Transfer-Encoding: 7bit
92b52c5
Content-Disposition: inline
92b52c5
92b52c5
Hi,
92b52c5
92b52c5
This is patch 1/4, which implements the bulk of the changes in type
92b52c5
length and bitpos/type offset. I have verified that there are no
92b52c5
regressions resulting from this patch by running the testsuite on
92b52c5
Fedora 16 x86_64.  Patch and changelog attached.
92b52c5
92b52c5
Regards,
92b52c5
Siddhesh
92b52c5
92b52c5
--MP_/yp5f+W_ED2JtUlSyBi8xujr
92b52c5
Content-Type: text/plain
92b52c5
Content-Transfer-Encoding: quoted-printable
92b52c5
Content-Disposition: attachment; filename=ChangeLog-main
92b52c5
92b52c5
gdb/ChangeLog
92b52c5
92b52c5
2012-08-05  Siddhesh Poyarekar  <siddhesh@redhat.com>
92b52c5
92b52c5
	* ada-lang.c (fat_pntr_bounds_bitpos): Return LONGEST.
92b52c5
	(fat_pntr_data_bitpos): Likewise.
92b52c5
	(desc_bound_bitpos): Likewise.
92b52c5
	(constrained_packed_array_type): Expand ELT_BITS parameter to
92b52c5
	LONGEST.
92b52c5
	(move_bits): Expand parameters SRC_OFFSET and N to LONGEST.
92b52c5
	(cond_offset_host): Expand parameter OFFSET to LONGEST.
92b52c5
	(cond_offset_target): Likewise.
92b52c5
	(ada_type_of_array): Expand ARRAY_BITSIZE to LONGEST.
92b52c5
	(decode_constrained_packed_array_type): Expand BITS to LONGEST.
92b52c5
	(decode_constrained_packed_array): Expand BIT_POS to LONGEST.
92b52c5
	(ada_value_primitive_packed_val): Expand parameter OFFSET to
92b52c5
	LONGEST.  Expand TARG, NTARG and NEW_OFFSET to LONGEST.
92b52c5
	(ada_value_assign): Expand FROM_SIZE to LONGEST.
92b52c5
	(value_assign_to_component): Expand BITS to LONGEST.
92b52c5
	(ensure_lval): Expand LEN to LONGEST.
92b52c5
	(value_pointer): Expand LEN to ULONGEST.
92b52c5
	(value_tag_from_contents_and_address): Expand TAG_BYTE_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(ada_value_primitive_field): Expand parameter OFFSET to LONGEST.
92b52c5
	Expand bit_pos to LONGEST.
92b52c5
	(find_struct_field): Expand parameters OFFSET and BYTE_OFFSET_P to
92b52c5
	LONGEST.  Expand BIT_POS and FLD_OFFSET to LONGEST.
92b52c5
	(ada_search_struct_field): Expand parameter OFFSET to LONGEST.
92b52c5
	Expand VAR_OFFSET to LONGEST.
92b52c5
	(ada_index_struct_field): Expand parameters INDEX and OFFSET to
92b52c5
	LONGEST.
92b52c5
	(ada_index_struct_field_1): Expand parameters INDEX_P and OFFSET
92b52c5
	to LONGEST.
92b52c5
	(ada_value_struct_elt): Expand BYTE_OFFSET to LONGEST.
92b52c5
	(align_value): Return ULONGEST.  Expand parameter OFF and
92b52c5
	ALIGNMENT to ULONGEST.
92b52c5
	(ada_template_to_fixed_record_type_1): Expand OFF, BIT_LEN and
92b52c5
	fld_bit_len to LONGEST.  Expand FIELD_OFFSET to LONGEST.  Use
92b52c5
	pulongest function to print TYPE_LENGTH.
92b52c5
	(to_fixed_array_type): Expand LEN to LONGEST.
92b52c5
	* ada-lang.h (ada_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(ada_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	(ada_value_primitive_packed_val): Expand parameter OFFSET to
92b52c5
	LONGEST.
92b52c5
	* ada-typeprint.c (ada_print_type): Use pulongest to print
92b52c5
	TYPE_LENGTH.
92b52c5
	* ada-valprint.c (val_print_packed_array_elements): Expand ELTLEN
92b52c5
	to ULONGEST.
92b52c5
	(char_at): Expand parameter I to LONGEST.
92b52c5
	(printstr): Expand parameter LENGTH, I, REP1, REPS to ULONGEST.
92b52c5
	Use pulongest to format print REPS.
92b52c5
	(ada_printstr): Expand parameter LENGTH to LONGEST.
92b52c5
	(ada_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	(ada_val_print_array): Expand ELTLEN, LEN to ULONGEST and TEMP_LEN
92b52c5
	to LONGEST.
92b52c5
	(ada_val_print_1): Expand parameter OFFSET to LONGEST.
92b52c5
	(print_variant_part): Expand parameters OFFSET and OUTER_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(print_field_values): Likewise.  Expand BIT_POS to LONGEST.
92b52c5
	* annotate.c (annotate_array_section_begin): Expand parameter
92b52c5
	IDX to LONGEST.  Use plongest to format-print IDX.
92b52c5
	(annotate_elt_rep): Expand parameter REPCOUNT to ULONGEST.  Use
92b52c5
	plongest to format-print REPCOUNT.
92b52c5
	* annotate.h: Likewise.
92b52c5
	* arm-linux-nat.c (arm_linux_region_ok_for_hw_watchpoint):
92b52c5
	Expand parameter parameter LEN to LONGEST.
92b52c5
	* ax-gdb.c (gen_left_shift): Expand parameter DISTANCE to LONGEST.
92b52c5
	(gen_offset): Expand parameter OFFSET to LONGEST.
92b52c5
	(gen_bitfield_ref): Expand parameters START, END to LONGEST.
92b52c5
	Expand BOUND_START, BOUND_END, OFFSET to LONGEST.
92b52c5
	(gen_primitive_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(gen_struct_ref_recursive): Likewise.
92b52c5
	* ax-general.c (ax_trace_quick): Expand parameter N to LONGEST.
92b52c5
	* ax.h (ax_trace_quick): Likewise.
92b52c5
	* breakpoint.c (breakpoint_address_match_range): Expand parameter
92b52c5
	LEN1 to LONGEST.
92b52c5
	(can_use_hardware_watchpoint): Expand LEN to LONGEST.
92b52c5
	* breakpoint.h (struct bp_target_info): Expand member LENGTH to
92b52c5
	LONGEST.
92b52c5
	(struct bp_location): Likewise.
92b52c5
	* c-lang.c (c_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	(evaluate_subexp_c): Expand ELEMENT_SIZE, I to LONGEST.
92b52c5
	* c-lang.h (c_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(c_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	(cp_print_value_fields): Expand parameter OFFSET to LONGEST.
92b52c5
	(cp_print_value_fields_rtti): Likewise.
92b52c5
	* c-typeprint.c (c_type_print_varspec_suffix): Remove cast down to
92b52c5
	int and use plongest to print LONGEST.
92b52c5
	* c-valprint.c (c_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.  Expand OFFSET to LONGEST, ELTLEN to ULONGEST.
92b52c5
	(c_value_print): Expand TOP to LONGEST.
92b52c5
	* cp-abi.c (baseclass_offset): Return LONGEST.  Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.  Expand RES to LONGEST.
92b52c5
	(value_virtual_fn_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_rtti_type): Expand parameter TOP to point to LONGEST.
92b52c5
	* cp-abi.h (value_virtual_fn_field): Expand OFFSET to LONGEST.
92b52c5
	(value_rtti_type): Expand TOP to point to LONGEST.
92b52c5
	(baseclass_offset): Return LONGEST.  Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.
92b52c5
	(struct cp_abi_ops): Expand parameter OFFSET for VIRTUAL_FN_FIELD
92b52c5
	to LONGEST.  Expand parameter TOP to point to LONGEST in
92b52c5
	VALUE_RTTI_TYPE.  Return LONGEST from BASECLASS_OFFSET and expand
92b52c5
	parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	* cp-valprint.c (cp_print_value_fields): Expand parameter OFFSET
92b52c5
	to LONGEST.  Expand I_OFFSET to LONGEST.
92b52c5
	(cp_print_value_fields_rtti): Expand parameter OFFSET to
92b52c5
	LONGEST.  Expand TOP to LONGEST.
92b52c5
	(cp_print_value): Expand parameter OFFSET to LONGEST.  Expand
92b52c5
	THISOFFSET, BOFFSET to LONGEST.
92b52c5
	* d-lang.h (d_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	* d-valprint.c (dynamic_array_type): Likewise.
92b52c5
	(d_val_print): Likewise.
92b52c5
	* doublest.c (floatformat_from_length): Expand parameter LEN to
92b52c5
	LONGEST.  Use plongest to format string for LONGEST.
92b52c5
	* dwarf2loc.c (copy_bitwise): Expand parameters DEST_OFFSET_BITS,
92b52c5
	BIT_COUNT to ULONGEST.  Rename parameter SOURCE_OFFSET_BITS to
92b52c5
	SOURCE_OFFSET and expand to ULONGEST.  New variable
92b52c5
	SOURCE_OFFSET_BITS.
92b52c5
	(read_pieced_value): Expand OFFSET, DEST_OFFSET_BITS,
92b52c5
	SOURCE_OFFSET_BITS, SOURCE_OFFSET to LONGEST.  Expand TYPE_LEN,
92b52c5
	THIS_SIZE, THIS_SIZE_BITS to ULONGEST.
92b52c5
	(write_pieced_value): Likewise.
92b52c5
	(check_pieced_value_bits): Expand parameters BIT_OFFSET and
92b52c5
	BIT_LENGTH to LONGEST.  Expand THIS_SIZE_BITS to ULONGEST.
92b52c5
	(check_pieced_value_validity): Expand parameters BIT_OFFSET and
92b52c5
	BIT_LENGTH to LONGEST.
92b52c5
	(check_pieced_synthetic_pointer): Likewise.
92b52c5
	(indirect_pieced_value): Expand BIT_LENGTH, BYTE_OFFSET and
92b52c5
	BIT_OFFSET to LONGEST.
92b52c5
	(dwarf2_evaluate_loc_desc_full): Expand N to ULONGEST.
92b52c5
	* dwarf2read.c (dwarf2_const_value_length_mismatch_complaint):
92b52c5
	Expand parameters ARG2 and ARG3 to LONGEST.  Use plongest to
92b52c5
	print ARG2 and ARG3.
92b52c5
	(dwarf2_add_field): Expand ANONYMOUS_SIZE, BIT_OFFSET to
92b52c5
	LONGEST.
92b52c5
	* eval.c (evaluate_struct_tuple): Expand BITPOS to LONGEST.
92b52c5
	(init_array_element): Expand ELEMENT_SIZE to LONGEST.
92b52c5
	(binop_promote): Expand PROMOTED_LEN1, PROMOTED_LEN2, RESULT_LEN
92b52c5
	to ULONGEST.
92b52c5
	(evaluate_subexp_standard): Expand MEM_OFFSET, TOP, ELEMENT_SIZE
92b52c5
	to LONGEST.
92b52c5
	* f-lang.c (f_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	* f-lang.h (f_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	* f-valprint.c (f77_array_offset_tbl): Make LONGEST.
92b52c5
	(f77_create_arrayprint_offset_tbl): Expand ELTLEN to LONGEST.
92b52c5
	(f77_print_array_1): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.  Expand I to LONGEST.
92b52c5
	(f77_print_array): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	(f_val_print): Likewise.  Expand OFFSET to LONGEST.
92b52c5
	* findvar.c (default_value_from_register): Expand LEN to LONGEST.
92b52c5
	(read_frame_register_value): Expand OFFSET, REG_OFFSET, LEN,
92b52c5
	REG_LEN to LONGEST.
92b52c5
	* frame.c (get_frame_register_bytes): Expand parameter LEN to
92b52c5
	LONGEST.
92b52c5
	* frame.h (get_frame_register_bytes): Likewise.
92b52c5
	* gdbtypes.c (init_type): Expand parameter LENGTH to LONGEST.
92b52c5
	(is_unique_ancestor_worker): Expand parameters OFFSET,
92b52c5
	EMBEDDED_OFFSET to LONGEST.  Expand THIS_OFFSET to LONGEST.
92b52c5
	(is_unique_ancestor): Expand OFFSET to LONGEST.
92b52c5
	(recursive_dump_type): Use pulongest to format print TYPE_LENGTH.
92b52c5
	Use plongest to format print TYPE_FIELD_BITPOS.
92b52c5
	(arch_type): Expand parameter LENGTH to LONGEST.
92b52c5
	* gdbtypes.h (struct type.main_type.fld_bnds.fields): Expand
92b52c5
	member BITPOS to LONGEST.
92b52c5
	(struct type): Expand member LENGTH to ULONGEST.
92b52c5
	(init_type): Expand parameter LENGTH to LONGEST.
92b52c5
	(arch_type): Likewise.
92b52c5
	* gnu-v2-abi.c (gnuv2_virtual_fn_field): Expand parameter OFFSET
92b52c5
	to LONGEST.
92b52c5
	(gnuv2_value_rtti_type): Expand parameter TOP to point to LONGEST.
92b52c5
	(gnuv2_baseclass_offset): Return LONGEST.  Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.  Expand FIELD_OFFSET, BOFFSET,
92b52c5
	FIELD_LENGTH to LONGEST.
92b52c5
	* gnu-v3-abi.c (build_gdb_vtable_type): Expand OFFSET to LONGEST.
92b52c5
	(vtable_address_point_offset): Return LONGEST.
92b52c5
	(gnuv3_rtti_type): Expand parameter TOP_P to point to LONGEST.
92b52c5
	(gnuv3_virtual_fn_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(gnuv3_baseclass_offset): Return LONGEST.  Expand parameter
92b52c5
	EMBEDDED_OFSET to LONGEST.  Expand CUR_BASE_OFFSET, BASE_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(gnuv3_find_method_in): Expand POS to LONGEST.
92b52c5
	* go-lang.h (go_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	* go-valprint.c (print_go_string): Likewise.
92b52c5
	(go_val_print): Likewise.
92b52c5
	* i386-nat.c (i386_handle_nonaligned_watchpoint): Expand
92b52c5
	parameter LEN to LONGEST.
92b52c5
	(i386_region_ok_for_watchpoint): Likewise.
92b52c5
	* inf-ttrace.c (inf_ttrace_region_ok_for_hw_watchpoint): Expand
92b52c5
	parameter LEN to LONGEST.
92b52c5
	* jv-lang.c (java_link_class_type): Expand BOFFSET to LONGEST.
92b52c5
	(java_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	* jv-lang.h (java_val_print): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	* jv-valprint.c (java_print_value_fields): Expand parameter OFFSET
92b52c5
	to LONGEST.
92b52c5
	(java_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	* language.c (unk_lang_printstr): Expand parameter LENGTH to
92b52c5
	ULONGEST.
92b52c5
	(unk_lang_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	* language.h (language_defn): Expand parameter LENGTH of
92b52c5
	LA_PRINTSTR to ULONGEST.  Expand parameter EMBEDDED_OFFSET of
92b52c5
	LA_VAL_PRINT to LONGEST.
92b52c5
	* m2-lang.c (m2_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	Expand I, REP1, REPS to ULONGEST.  Use pulongest to format print
92b52c5
	REPS.
92b52c5
	* m2-lang.h (m2_val_print): Expand parameter embedded_offset to
92b52c5
	LONGEST.
92b52c5
	* m2-typeprint.c (m2_array): New variable VAL.  Use pulongest to
92b52c5
	* format print VAL.
92b52c5
	(m2_enum): expand LASTVAL to LONGEST.
92b52c5
	* m2-valprint.c (m2_print_long_set): Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.
92b52c5
	(m2_print_unbounded_array): Likewise.
92b52c5
	(m2_print_array_contents): Likewise.
92b52c5
	(m2_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	Expand I, LEN, TEMP_LEN to ULONGEST.
92b52c5
	* memrange.c (mem_ranges_overlap): Expand parameters LEN1, LEN2 to
92b52c5
	LONGEST.
92b52c5
	* memrange.h (struct mem_range): Expand member LENGTH to LONGEST.
92b52c5
	(mem_ranges_overlap): Expand parameters LEN1, LEN2 to LONGEST.
92b52c5
	* mips-linux-nat.c (mips_linux_region_ok_for_hw_watchpoint):
92b52c5
	Expand parameter LEN to LONGEST.
92b52c5
	* objc-lang.c (objc_printstr): Expand parameter LENGTH to
92b52c5
	ULONGEST.  Expand I, REP1, REPS to ULONGEST.  use pulongest to
92b52c5
	format print REPS.
92b52c5
	* opencl-lang.c (lookup_opencl_vector_type): Expand parameter
92b52c5
	EL_LENGTH to ULONGEST.  Expand LENGTH to ULONGEST.
92b52c5
	(lval_func_read): Expand OFFSET, N, I, J and ELSIZE to LONGEST.
92b52c5
	(lval_func_write): Likewise.
92b52c5
	(lval_func_check_validity): Expand parameter LENGTH to LONGEST.
92b52c5
	Expand ELSIZE, START, END, I, STARTREST, ENDREST, COMP_OFFSET,
92b52c5
	COMP_LENGTH to LONGEST.
92b52c5
	(lval_func_check_any_valid): Expand ELSIZE to LONGEST.
92b52c5
	(lval_func_check_synthetic_pointer): Expand parameters OFFSET and
92b52c5
	LENGTH to LONGEST.  Expand ELSIZE, START, END, I, STARTREST,
92b52c5
	ENDREST, COMP_LENGTH, COMP_OFFSET to LONGEST.
92b52c5
	* p-lang.c (is_pascal_string_type): Expand parameters LENGTH_POS,
92b52c5
	STRING_POS, LENGTH_SIZE to point to LONGEST.
92b52c5
	(pascal_printstr): Expand parameter LENGTH to ULONGEST.  Expand
92b52c5
	I, REP1, REPS to ULONGEST.  Use pulongest to format print REPS.
92b52c5
	* p-lang.h (pascal_val_print): Expand parameter EMBEDDED_OFFSET
92b52c5
	to LONGEST.
92b52c5
	(is_pascal_string_type): Expand parameters LENGTH_POS, STRING_POS,
92b52c5
	LENGTH_SIZE to point to LONGEST.
92b52c5
	(pascal_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	(pascal_object_print_value_fields): Expand parameter OFFSET to
92b52c5
	LONGEST.
92b52c5
	* p-valprint.c (pascal_val_print): Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.  Expand ELTLEN to ULONGEST.  Expand
92b52c5
	LENGTH_SIZE, LENGTH_POS, STRING_POS to LONGEST.
92b52c5
	(pascal_object_print_value_fields): Expand parameter OFFSET to
92b52c5
	LONGEST.
92b52c5
	(pascal_object_print_value): Likewise.  Expand BOFFSET,
92b52c5
	THISOFFSET to LONGEST.
92b52c5
	* ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint):
92b52c5
	Expand parameter LEN to point to LONGEST.
92b52c5
	* printcmd.c (print_formatted): Expand LEN to LONGEST.
92b52c5
	(print_scalar_formatted): Likewise.
92b52c5
	* procfs.c (procfs_region_ok_for_hw_watchpoint): Expand
92b52c5
	parameter LEN to LONGEST.
92b52c5
	* python/py-prettyprint.c (apply_val_pretty_printer): Expand
92b52c5
	parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	* python/python.h (apply_val_pretty_printer): Likewise.
92b52c5
	* regcache.c (regcache_xfer_part): Expand parameter OFFSET to
92b52c5
	LONGEST.
92b52c5
	(regcache_raw_read_part): Likewise.
92b52c5
	(regcache_raw_write_part): Likewise.
92b52c5
	(regcache_cooked_read_part): Likewise.
92b52c5
	(regcache_cooked_write_part): Likewise.
92b52c5
	* regcache.h (regcache_raw_read_part): Likewise.
92b52c5
	(regcache_raw_write_part): Likewise.
92b52c5
	(regcache_cooked_read_part): Likewise.
92b52c5
	(regcache_cooked_write_part): Likewise.
92b52c5
	* remote.c (remote_region_ok_for_hw_watchpoint): Expand
92b52c5
	parameter LEN to LONGEST.
92b52c5
	* s390-nat.c (s390_region_ok_for_hw_watchpoint): Expand
92b52c5
	parameter LEN to LONGEST.
92b52c5
	* spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Expand
92b52c5
	parameter len to LONGEST.
92b52c5
	* stack.c (print_frame_nameless_args): Expand parameter START to
92b52c5
	LONGEST.
92b52c5
	(print_frame_args): Expand HIGHEST_OFFSET, CURRENT_OFFSET,
92b52c5
	ARG_SIZE, START to LONGEST.
92b52c5
	* symmisc.c (print_symbol): Expand I to ULONGEST.  Use pulongest
92b52c5
	to format print TYPE_LENGTH.
92b52c5
	* target.c (default_region_ok_for_hw_watchpoint): Expand parameter
92b52c5
	LEN to LONGEST.
92b52c5
	(debug_to_region_ok_for_hw_watchpoint): Likewise.
92b52c5
	* target.h (struct target_ops): Expand parameter LEN to LONGEST
92b52c5
	for TO_REGION_OK_FOR_HW_WATCHPOINT.
92b52c5
	* tracepoint.c (add_memrange): Expand parameter LEN to LONGEST.
92b52c5
	Use plongest to format print LEN.
92b52c5
	(collect_symbol): Expand LEN to ULONGEST.  Use pulongest to
92b52c5
	format print LEN.
92b52c5
	(scope_info): Expand J to LONGEST.  Use pulongest to format
92b52c5
	print TYPE_LENGTH.
92b52c5
	* typeprint.c (whatis_exp): Expand TOP to LONGEST.
92b52c5
	* valarith.c (value_subscripted_rvalue): Expand parameters INDEX
92b52c5
	and LOWERBOUND to LONGEST.  Expand ELT_SIZE, ELT_OFFS to ULONGEST.
92b52c5
	(value_concat): expand INVAL1LEN and INVAL2LEN to ssize_t.
92b52c5
	(value_logical_not): Expand LEN to LONGEST.
92b52c5
	(value_strcmp): Expand LEN1, LEN2, I, LEN to LONGEST.
92b52c5
	* valops.c (value_allocate_space_in_inferior): Expand parameter
92b52c5
	LEN to LONGEST.
92b52c5
	(value_cast_structs): Expand TOP to LONGEST.
92b52c5
	(value_cast): Expand ELEMENT_LENGTH to ULONGEST.  Expand
92b52c5
	VAL_LENGTH to LONGEST.
92b52c5
	(dynamic_cast_check_1): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.  Expand OFFSET to LONGEST.
92b52c5
	(dynamic_cast_check_2): Likewise.
92b52c5
	(value_dynamic_cast): Expand TOP to LONGEST.
92b52c5
	(read_value_memory): Expand EMBEDDED_OFFSET to LONGEST.
92b52c5
	(value_assign): Expand CHANGED_LEN, OFFSET to LONGEST.
92b52c5
	(value_array): Expand TYPELENGTH to ULONGEST.
92b52c5
	(update_search_result): Expand parameters LAST_BOFFSET, BOFFSET
92b52c5
	to LONGEST.
92b52c5
	(do_search_struct_field): Expand parameter OFFSET, LAST_BOFFSET
92b52c5
	to LONGEST.  Expand NEW_OFFSET, BOFFSET to LONGEST.
92b52c5
	(search_struct_field): Expand parameter OFFSET to LONGEST.
92b52c5
	Expand BOFFSET to LONGEST.
92b52c5
	(search_struct_method): Expand parameter OFFSET to LONGEST.
92b52c5
	Expand BASE_OFFSET, THIS_OFFSET to LONGEST.
92b52c5
	(find_method_list): Expand parameters OFFSET, BOFFSET to
92b52c5
	LONGEST.  Expand BASE_OFFSET to LONGEST.
92b52c5
	(value_find_oload_method_list): Expand parameter BOFFSET to point
92b52c5
	to LONGEST.
92b52c5
	(find_overload_match): Expand BOFFSET to LONGEST.
92b52c5
	(value_struct_elt_for_reference): Expand parameter OFFSET to
92b52c5
	LONGEST.  Remove unneeded cast.  Expand BASE_OFFSET to LONGEST.
92b52c5
	(value_rtti_indirect_type): Expand parameter TOP to point to
92b52c5
	LONGEST.
92b52c5
	(value_full_object): Expand parameter XTOP to LONGEST.  Expand
92b52c5
	TOP to LONGEST.
92b52c5
	* valprint.c (valprint_check_validity): Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.
92b52c5
	(generic_val_print): Likewise.
92b52c5
	(val_print): Likewise.
92b52c5
	(val_print_scalar_formatted): Likewise.
92b52c5
	(print_hex_chars): Expand parameter LEN to ULONGEST.
92b52c5
	(val_print_array_elements): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST, I to ULONGEST.  Expand LEN, ELTLEN, REP1, REPS to
92b52c5
	ULONGEST.  Use pulongest to format print REPS.
92b52c5
	(generic_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	* valprint.h (val_print_array_elements): Expand parameter
92b52c5
	EMBEDDED_OFFSET to LONGEST.
92b52c5
	(val_print_scalar_formatted): Likewise.
92b52c5
	(print_hex_chars): Expand parameter LEN to ULONGEST.
92b52c5
	(generic_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	(generic_printstr): Expand parameter LENGTH to ULONGEST.
92b52c5
	* value.c (struct range): Expand members OFFSET, LENGTH to
92b52c5
	LONGEST.
92b52c5
	(ranges_overlap): Expand parameters OFFSET1, OFFSET2, LEN1 AND
92b52c5
	LEN2 to LONGEST.
92b52c5
	(range_contain): Expand parameter OFFSET, LENGTH to LONGEST.
92b52c5
	(struct value): Expand members OFFSET, EMBEDDED_OFFSET,
92b52c5
	POINTED_TO_OFFSET to LONGEST.
92b52c5
	(value_bytes_available): Expand parameters OFFSET, LENGTH to
92b52c5
	LONGEST.
92b52c5
	(mark_value_bytes_unavailable): Likewise.
92b52c5
	(find_first_range_overlap): Likewise.
92b52c5
	(value_available_contents_eq): Expand parameters OFFSET1, OFFSET2
92b52c5
	and LENGTH to LONGEST.
92b52c5
	(value_offset): Return LONGEST.
92b52c5
	(set_value_offset): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_contents_copy_raw): Expand parameters SRC_OFFSET,
92b52c5
	DST_OFFSET, LENGTH to ssize_t.
92b52c5
	(value_contents_copy): Likewise.
92b52c5
	(value_bits_valid): Expand parameters OFFSET, LENGTH to LONGEST.
92b52c5
	(value_bits_synthetic_pointer): Likewise.
92b52c5
	(value_embedded_offset): Return LONGEST.
92b52c5
	(set_value_embedded_offset): Expand parameter VAL to LONGEST.
92b52c5
	(value_pointed_to_offset): Return LONGEST.
92b52c5
	(set_value_pointed_to_offset): Expand parameter VAL to LONGEST.
92b52c5
	(set_internalvar_component): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_primitive_field): Likewise.  Expand BITPOS, BOFFSET,
92b52c5
	CONTAINER_BITSIZE to LONGEST.
92b52c5
	(value_fn_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(unpack_value_bits_as_long_1): Expand parameters EMBEDDED_OFFSET,
92b52c5
	BITPOS to LONGEST.  Expand READ_OFFSET to LONGEST.
92b52c5
	(unpack_value_bits_as_long): Expand parameter EMBEDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(unpack_value_field_as_long_1): Likewise.  Expand BITPOS to
92b52c5
	LONGEST.
92b52c5
	(unpack_value_field_as_long): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(value_field_bitfield): Likewise.
92b52c5
	(modify_field): Expand parameter BITPOS to LONGEST.  Expand
92b52c5
	BYTESIZE to LONGEST.
92b52c5
	* value.h (value_offset): Return LONGEST.
92b52c5
	(set_value_offset): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_pointed_to_offset): Return LONGEST.
92b52c5
	(set_value_pointed_to_offset): Expand parameter VAL to LONGEST.
92b52c5
	(value_embedded_offset): Return LONGEST.
92b52c5
	(set_value_embedded_offset): Expand parameter VAL to LONGEST.
92b52c5
	(struct lval_funcs): Expand parameters OFFSET and LENGTH to
92b52c5
	LONGEST for CHECK_VALIDITY.  Likewise for CHECK_SYNTHETIC_POINTER.
92b52c5
	(valprint_check_validity): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(value_bits_valid): Expand parameters OFFSET, LENGTH to LONGEST.
92b52c5
	(value_bits_synthetic_pointer): Likewise.
92b52c5
	(value_bytes_available): Likewise.
92b52c5
	(mark_value_bytes_unavailable): Likewise.
92b52c5
	(value_available_contents_eq): Fix comment.  Expand parameters
92b52c5
	OFFSET1, OFFSET2, LENGTH to LONGEST.
92b52c5
	(read_value_memory): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(unpack_value_bits_as_long): Expand parameter EMBEDDED_OFFSET to
92b52c5
	LONGEST.
92b52c5
	(unpack_value_field_as_long): Likewise.
92b52c5
	(value_field_bitfield): Likewise.
92b52c5
	(value_contents_copy_raw): Expand parameters SRC_OFFSET,
92b52c5
	DST_OFFSET, LENGTH to LONGEST.
92b52c5
	(value_contents_copy): Likewise.
92b52c5
	(value_primitive_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_rtti_indirect_type): Expand parameter TOP to point to
92b52c5
	LONGEST.
92b52c5
	(value_full_object): Expand parameter XTOP to LONGEST.
92b52c5
	(set_internalvar_component): Expand parameter OFFSET to LONGEST.
92b52c5
	(value_fn_field): Expand parameter OFFSET to LONGEST.
92b52c5
	(modify_field): Expand parameter BITPOS to LONGEST.
92b52c5
	(val_print): Expand parameter EMBEDDED_OFFSET to LONGEST.
92b52c5
	(value_allocate_space_in_inferior): Expand parameter LEN to
92b52c5
	LONGEST.
92b52c5
92b52c5
gdb/testsuite/ChangeLog:
92b52c5
92b52c5
2012-08-05  Siddhesh Poyarekar  <siddhesh@redhat.com>
92b52c5
92b52c5
	* gdb.base/longest-types.exp: Add test case to get offset of
92b52c5
	BUF2.
92b52c5
92b52c5
--MP_/yp5f+W_ED2JtUlSyBi8xujr
92b52c5
Content-Type: text/x-patch
92b52c5
Content-Transfer-Encoding: 7bit
92b52c5
Content-Disposition: attachment; filename=bitpos-main.patch
92b52c5
f637971
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
f637971
--- a/gdb/aarch64-linux-nat.c
f637971
+++ b/gdb/aarch64-linux-nat.c
ab024a6
@@ -808,7 +808,7 @@ aarch64_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len,
2bcd68d
 /* Implement the "region_ok_for_hw_watchpoint" target_ops method.  */
f637971
 
2bcd68d
 int
2bcd68d
-aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
2bcd68d
+aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
f637971
 {
f637971
   return aarch64_linux_region_ok_for_watchpoint (addr, len);
f637971
 }
f637971
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
f637971
--- a/gdb/ada-lang.c
f637971
+++ b/gdb/ada-lang.c
f637971
@@ -78,7 +78,7 @@ static struct type *desc_bounds_type (struct type *);
92b52c5
 
92b52c5
 static struct value *desc_bounds (struct value *);
92b52c5
 
92b52c5
-static int fat_pntr_bounds_bitpos (struct type *);
92b52c5
+static LONGEST fat_pntr_bounds_bitpos (struct type *);
92b52c5
 
92b52c5
 static int fat_pntr_bounds_bitsize (struct type *);
92b52c5
 
f637971
@@ -86,13 +86,13 @@ static struct type *desc_data_target_type (struct type *);
92b52c5
 
92b52c5
 static struct value *desc_data (struct value *);
92b52c5
 
92b52c5
-static int fat_pntr_data_bitpos (struct type *);
92b52c5
+static LONGEST fat_pntr_data_bitpos (struct type *);
92b52c5
 
92b52c5
 static int fat_pntr_data_bitsize (struct type *);
92b52c5
 
92b52c5
 static struct value *desc_one_bound (struct value *, int, int);
92b52c5
 
92b52c5
-static int desc_bound_bitpos (struct type *, int, int);
92b52c5
+static LONGEST desc_bound_bitpos (struct type *, int, int);
92b52c5
 
92b52c5
 static int desc_bound_bitsize (struct type *, int, int);
92b52c5
 
f637971
@@ -175,7 +175,7 @@ static struct type *static_unwrap_type (struct type *type);
92b52c5
 
92b52c5
 static struct value *unwrap_value (struct value *);
92b52c5
 
92b52c5
-static struct type *constrained_packed_array_type (struct type *, long *);
92b52c5
+static struct type *constrained_packed_array_type (struct type *, LONGEST *);
92b52c5
 
92b52c5
 static struct type *decode_constrained_packed_array_type (struct type *);
92b52c5
 
9c7d730
@@ -214,14 +214,14 @@ static struct value *value_val_atr (struct type *, struct value *);
92b52c5
 static struct symbol *standard_lookup (const char *, const struct block *,
92b52c5
                                        domain_enum);
92b52c5
 
23f398e
-static struct value *ada_search_struct_field (const char *, struct value *, int,
23f398e
+static struct value *ada_search_struct_field (const char *, struct value *, LONGEST,
92b52c5
                                               struct type *);
92b52c5
 
92b52c5
-static struct value *ada_value_primitive_field (struct value *, int, int,
92b52c5
+static struct value *ada_value_primitive_field (struct value *, LONGEST, int,
92b52c5
                                                 struct type *);
92b52c5
 
92b52c5
-static int find_struct_field (const char *, struct type *, int,
92b52c5
-                              struct type **, int *, int *, int *, int *);
92b52c5
+static int find_struct_field (const char *, struct type *, LONGEST,
23f398e
+                              struct type **, LONGEST *, int *, int *, int *);
92b52c5
 
2bcd68d
 static int ada_resolve_function (struct block_symbol *, int,
2bcd68d
                                  struct value **, int, const char *,
9c7d730
@@ -232,7 +232,7 @@ static int ada_is_direct_array_type (struct type *);
2f7f533
 static void ada_language_arch_info (struct gdbarch *,
2f7f533
 				    struct language_arch_info *);
92b52c5
 
92b52c5
-static struct value *ada_index_struct_field (int, struct value *, int,
92b52c5
+static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST,
92b52c5
 					     struct type *);
92b52c5
 
92b52c5
 static struct value *assign_aggregate (struct value *, struct value *, 
9c7d730
@@ -701,7 +701,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type)
92b52c5
 }
92b52c5
 
92b52c5
 static const gdb_byte *
92b52c5
-cond_offset_host (const gdb_byte *valaddr, long offset)
92b52c5
+cond_offset_host (const gdb_byte *valaddr, LONGEST offset)
92b52c5
 {
92b52c5
   if (valaddr == NULL)
92b52c5
     return NULL;
9c7d730
@@ -710,7 +710,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset)
92b52c5
 }
92b52c5
 
92b52c5
 static CORE_ADDR
92b52c5
-cond_offset_target (CORE_ADDR address, long offset)
92b52c5
+cond_offset_target (CORE_ADDR address, LONGEST offset)
92b52c5
 {
92b52c5
   if (address == 0)
92b52c5
     return 0;
9c7d730
@@ -1752,7 +1752,7 @@ desc_bounds (struct value *arr)
92b52c5
 /* If TYPE is the type of an array-descriptor (fat pointer),  the bit
92b52c5
    position of the field containing the address of the bounds data.  */
92b52c5
 
92b52c5
-static int
92b52c5
+static LONGEST
92b52c5
 fat_pntr_bounds_bitpos (struct type *type)
92b52c5
 {
92b52c5
   return TYPE_FIELD_BITPOS (desc_base_type (type), 1);
9c7d730
@@ -1818,7 +1818,7 @@ desc_data (struct value *arr)
92b52c5
 /* If TYPE is the type of an array-descriptor (fat pointer), the bit
92b52c5
    position of the field containing the address of the data.  */
92b52c5
 
92b52c5
-static int
92b52c5
+static LONGEST
92b52c5
 fat_pntr_data_bitpos (struct type *type)
92b52c5
 {
92b52c5
   return TYPE_FIELD_BITPOS (desc_base_type (type), 0);
9c7d730
@@ -1853,7 +1853,7 @@ desc_one_bound (struct value *bounds, int i, int which)
92b52c5
    of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
92b52c5
    bound, if WHICH is 1.  The first bound is I=1.  */
92b52c5
 
92b52c5
-static int
92b52c5
+static LONGEST
92b52c5
 desc_bound_bitpos (struct type *type, int i, int which)
92b52c5
 {
92b52c5
   return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2);
9c7d730
@@ -2043,7 +2043,7 @@ ada_type_of_array (struct value *arr, int bounds)
92b52c5
 	         zero, and does not need to be recomputed.  */
92b52c5
 	      if (lo < hi)
92b52c5
 		{
92b52c5
-		  int array_bitsize =
92b52c5
+		  LONGEST array_bitsize =
92b52c5
 		        (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0);
92b52c5
 
92b52c5
 		  TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8;
9c7d730
@@ -2203,7 +2203,7 @@ decode_packed_array_bitsize (struct type *type)
2f7f533
    the length is arbitrary.  */
92b52c5
 
92b52c5
 static struct type *
92b52c5
-constrained_packed_array_type (struct type *type, long *elt_bits)
92b52c5
+constrained_packed_array_type (struct type *type, LONGEST *elt_bits)
92b52c5
 {
92b52c5
   struct type *new_elt_type;
92b52c5
   struct type *new_type;
9c7d730
@@ -2257,7 +2257,7 @@ decode_constrained_packed_array_type (struct type *type)
92b52c5
   char *name;
92b52c5
   const char *tail;
92b52c5
   struct type *shadow_type;
92b52c5
-  long bits;
92b52c5
+  LONGEST bits;
92b52c5
 
92b52c5
   if (!raw_name)
92b52c5
     raw_name = ada_type_name (desc_base_type (type));
9c7d730
@@ -2328,7 +2328,8 @@ decode_constrained_packed_array (struct value *arr)
92b52c5
  	 array with no wrapper.  In order to interpret the value through
92b52c5
  	 the (left-justified) packed array type we just built, we must
92b52c5
  	 first left-justify it.  */
92b52c5
-      int bit_size, bit_pos;
92b52c5
+      int bit_size;
92b52c5
+      LONGEST bit_pos;
92b52c5
       ULONGEST mod;
92b52c5
 
92b52c5
       mod = ada_modulus (value_type (arr)) - 1;
9c7d730
@@ -2556,7 +2557,7 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size,
92b52c5
 
92b52c5
 struct value *
92b52c5
 ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
92b52c5
-				long offset, int bit_offset, int bit_size,
92b52c5
+				LONGEST offset, int bit_offset, int bit_size,
92b52c5
                                 struct type *type)
92b52c5
 {
92b52c5
   struct value *v;
9c7d730
@@ -2626,7 +2627,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
92b52c5
 
92b52c5
   if (obj != NULL)
92b52c5
     {
92b52c5
-      long new_offset = offset;
92b52c5
+      LONGEST new_offset = offset;
92b52c5
 
92b52c5
       set_value_component_location (v, obj);
92b52c5
       set_value_bitpos (v, bit_offset + value_bitpos (obj));
9c7d730
@@ -2696,7 +2697,7 @@ ada_value_assign (struct value *toval, struct value *fromval)
92b52c5
     {
92b52c5
       int len = (value_bitpos (toval)
92b52c5
 		 + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
92b52c5
-      int from_size;
92b52c5
+      LONGEST from_size;
23f398e
       gdb_byte *buffer = (gdb_byte *) alloca (len);
92b52c5
       struct value *val;
92b52c5
       CORE_ADDR to_addr = value_address (toval);
9c7d730
@@ -2747,7 +2748,7 @@ value_assign_to_component (struct value *container, struct value *component,
92b52c5
     (LONGEST)  (value_address (component) - value_address (container));
32f92b2
   int bit_offset_in_container =
92b52c5
     value_bitpos (component) - value_bitpos (container);
92b52c5
-  int bits;
92b52c5
+  LONGEST bits;
32f92b2
 
92b52c5
   val = value_cast (value_type (component), val);
92b52c5
 
9c7d730
@@ -4445,7 +4446,7 @@ ensure_lval (struct value *val)
92b52c5
   if (VALUE_LVAL (val) == not_lval
92b52c5
       || VALUE_LVAL (val) == lval_internalvar)
92b52c5
     {
92b52c5
-      int len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
92b52c5
+      LONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
92b52c5
       const CORE_ADDR addr =
92b52c5
         value_as_long (value_allocate_space_in_inferior (len));
92b52c5
 
9c7d730
@@ -4529,7 +4530,7 @@ static CORE_ADDR
92b52c5
 value_pointer (struct value *value, struct type *type)
92b52c5
 {
92b52c5
   struct gdbarch *gdbarch = get_type_arch (type);
92b52c5
-  unsigned len = TYPE_LENGTH (type);
92b52c5
+  ULONGEST len = TYPE_LENGTH (type);
23f398e
   gdb_byte *buf = (gdb_byte *) alloca (len);
92b52c5
   CORE_ADDR addr;
92b52c5
 
31f5b96
@@ -6642,7 +6643,7 @@ value_tag_from_contents_and_address (struct type *type,
92b52c5
 				     const gdb_byte *valaddr,
92b52c5
                                      CORE_ADDR address)
92b52c5
 {
92b52c5
-  int tag_byte_offset;
92b52c5
+  LONGEST tag_byte_offset;
92b52c5
   struct type *tag_type;
92b52c5
 
92b52c5
   if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
31f5b96
@@ -7135,7 +7136,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num)
92b52c5
    only in that it can handle packed values of arbitrary type.  */
92b52c5
 
92b52c5
 static struct value *
92b52c5
-ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
92b52c5
+ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno,
92b52c5
                            struct type *arg_type)
92b52c5
 {
92b52c5
   struct type *type;
31f5b96
@@ -7147,7 +7148,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
92b52c5
 
92b52c5
   if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0)
92b52c5
     {
92b52c5
-      int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
92b52c5
+      LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
92b52c5
       int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
92b52c5
 
92b52c5
       return ada_value_primitive_packed_val (arg1, value_contents (arg1),
31f5b96
@@ -7224,9 +7225,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
92b52c5
    Returns 1 if found, 0 otherwise.  */
92b52c5
 
92b52c5
 static int
92b52c5
-find_struct_field (const char *name, struct type *type, int offset,
92b52c5
+find_struct_field (const char *name, struct type *type, LONGEST offset,
92b52c5
                    struct type **field_type_p,
92b52c5
-                   int *byte_offset_p, int *bit_offset_p, int *bit_size_p,
92b52c5
+		   LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p,
92b52c5
 		   int *index_p)
92b52c5
 {
92b52c5
   int i;
31f5b96
@@ -7245,8 +7246,8 @@ find_struct_field (const char *name, struct type *type, int offset,
92b52c5
 
92b52c5
   for (i = 0; i < TYPE_NFIELDS (type); i += 1)
92b52c5
     {
92b52c5
-      int bit_pos = TYPE_FIELD_BITPOS (type, i);
92b52c5
-      int fld_offset = offset + bit_pos / 8;
92b52c5
+      LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
92b52c5
+      LONGEST fld_offset = offset + bit_pos / 8;
92b52c5
       const char *t_field_name = TYPE_FIELD_NAME (type, i);
92b52c5
 
92b52c5
       if (t_field_name == NULL)
31f5b96
@@ -7348,7 +7349,7 @@ num_visible_fields (struct type *type)
c42f029
    long explanation in find_struct_field's function documentation.  */
92b52c5
 
92b52c5
 static struct value *
23f398e
-ada_search_struct_field (const char *name, struct value *arg, int offset,
23f398e
+ada_search_struct_field (const char *name, struct value *arg, LONGEST offset,
92b52c5
                          struct type *type)
92b52c5
 {
92b52c5
   int i;
31f5b96
@@ -7396,7 +7397,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset,
92b52c5
           int j;
92b52c5
           struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type,
92b52c5
 									i));
92b52c5
-          int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
92b52c5
+	  LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
92b52c5
 
92b52c5
           for (j = 0; j < TYPE_NFIELDS (field_type); j += 1)
92b52c5
             {
31f5b96
@@ -7428,8 +7429,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset,
92b52c5
   return NULL;
92b52c5
 }
92b52c5
 
92b52c5
-static struct value *ada_index_struct_field_1 (int *, struct value *,
92b52c5
-					       int, struct type *);
92b52c5
+static struct value *ada_index_struct_field_1 (LONGEST *, struct value *,
92b52c5
+					       LONGEST, struct type *);
92b52c5
 
92b52c5
 
92b52c5
 /* Return field #INDEX in ARG, where the index is that returned by
31f5b96
@@ -7438,7 +7439,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *,
92b52c5
  * If found, return value, else return NULL.  */
92b52c5
 
92b52c5
 static struct value *
92b52c5
-ada_index_struct_field (int index, struct value *arg, int offset,
92b52c5
+ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset,
92b52c5
 			struct type *type)
92b52c5
 {
92b52c5
   return ada_index_struct_field_1 (&index, arg, offset, type);
31f5b96
@@ -7450,7 +7451,7 @@ ada_index_struct_field (int index, struct value *arg, int offset,
92b52c5
  * *INDEX_P.  */
92b52c5
 
92b52c5
 static struct value *
92b52c5
-ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
92b52c5
+ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset,
92b52c5
 			  struct type *type)
92b52c5
 {
92b52c5
   int i;
31f5b96
@@ -7541,7 +7542,8 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err)
92b52c5
     v = ada_search_struct_field (name, arg, 0, t);
92b52c5
   else
92b52c5
     {
92b52c5
-      int bit_offset, bit_size, byte_offset;
92b52c5
+      int bit_offset, bit_size;
92b52c5
+      LONGEST byte_offset;
92b52c5
       struct type *field_type;
92b52c5
       CORE_ADDR address;
92b52c5
 
31f5b96
@@ -7890,8 +7892,8 @@ ada_coerce_ref (struct value *val0)
92b52c5
 /* Return OFF rounded upward if necessary to a multiple of
92b52c5
    ALIGNMENT (a power of 2).  */
92b52c5
 
92b52c5
-static unsigned int
92b52c5
-align_value (unsigned int off, unsigned int alignment)
92b52c5
+static ULONGEST
92b52c5
+align_value (ULONGEST off, ULONGEST alignment)
92b52c5
 {
92b52c5
   return (off + alignment - 1) & ~(alignment - 1);
92b52c5
 }
31f5b96
@@ -8281,10 +8283,9 @@ ada_template_to_fixed_record_type_1 (struct type *type,
92b52c5
   struct value *mark = value_mark ();
92b52c5
   struct value *dval;
92b52c5
   struct type *rtype;
92b52c5
-  int nfields, bit_len;
92b52c5
+  int nfields;
92b52c5
   int variant_field;
92b52c5
-  long off;
92b52c5
-  int fld_bit_len;
92b52c5
+  LONGEST off, bit_len, fld_bit_len;
92b52c5
   int f;
92b52c5
 
92b52c5
   /* Compute the number of fields in this record type that are going
31f5b96
@@ -8361,7 +8362,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
92b52c5
 	     that follow this one.  */
92b52c5
 	  if (ada_is_aligner_type (field_type))
92b52c5
 	    {
92b52c5
-	      long field_offset = TYPE_FIELD_BITPOS (field_type, f);
92b52c5
+	      LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f);
92b52c5
 
92b52c5
 	      field_valaddr = cond_offset_host (field_valaddr, field_offset);
92b52c5
 	      field_address = cond_offset_target (field_address, field_offset);
31f5b96
@@ -8497,11 +8498,11 @@ ada_template_to_fixed_record_type_1 (struct type *type,
92b52c5
   if (TYPE_LENGTH (type) <= 0)
92b52c5
     {
92b52c5
       if (TYPE_NAME (rtype))
92b52c5
-	warning (_("Invalid type size for `%s' detected: %d."),
92b52c5
-		 TYPE_NAME (rtype), TYPE_LENGTH (type));
92b52c5
+	warning (_("Invalid type size for `%s' detected: %s."),
92b52c5
+		 TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type)));
92b52c5
       else
92b52c5
-	warning (_("Invalid type size for <unnamed> detected: %d."),
92b52c5
-		 TYPE_LENGTH (type));
92b52c5
+	warning (_("Invalid type size for <unnamed> detected: %s."),
92b52c5
+		 pulongest (TYPE_LENGTH (type)));
92b52c5
     }
92b52c5
   else
92b52c5
     {
31f5b96
@@ -8965,7 +8966,8 @@ to_fixed_array_type (struct type *type0, struct value *dval,
92b52c5
 	 type was a regular (non-packed) array type.  As a result, the
92b52c5
 	 bitsize of the array elements needs to be set again, and the array
92b52c5
 	 length needs to be recomputed based on that bitsize.  */
92b52c5
-      int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result));
92b52c5
+      LONGEST len = (TYPE_LENGTH (result)
92b52c5
+		     / TYPE_LENGTH (TYPE_TARGET_TYPE (result)));
92b52c5
       int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0);
92b52c5
 
92b52c5
       TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0);
f637971
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
f637971
--- a/gdb/ada-lang.h
f637971
+++ b/gdb/ada-lang.h
ab024a6
@@ -173,7 +173,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int,
92b52c5
 extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
92b52c5
 			       struct ui_file *stream);
92b52c5
 
af2c2a5
-extern void ada_val_print (struct type *, int, CORE_ADDR,
af2c2a5
+extern void ada_val_print (struct type *, LONGEST, CORE_ADDR,
92b52c5
 			   struct ui_file *, int,
af2c2a5
 			   struct value *,
92b52c5
 			   const struct value_print_options *);
ab024a6
@@ -188,7 +188,7 @@ extern void ada_emit_char (int, struct type *, struct ui_file *, int, int);
92b52c5
 extern void ada_printchar (int, struct type *, struct ui_file *);
92b52c5
 
92b52c5
 extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *,
92b52c5
-			  unsigned int, const char *, int,
92b52c5
+			  ULONGEST, const char *, int,
92b52c5
 			  const struct value_print_options *);
92b52c5
 
92b52c5
 struct value *ada_convert_actual (struct value *actual,
0702d0d
@@ -263,7 +263,7 @@ extern int ada_is_constrained_packed_array_type (struct type *);
92b52c5
 
92b52c5
 extern struct value *ada_value_primitive_packed_val (struct value *,
92b52c5
 						     const gdb_byte *,
92b52c5
-                                                     long, int, int,
92b52c5
+						     LONGEST, int, int,
92b52c5
                                                      struct type *);
92b52c5
 
92b52c5
 extern struct type *ada_coerce_to_simple_array_type (struct type *);
f637971
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
f637971
--- a/gdb/ada-typeprint.c
f637971
+++ b/gdb/ada-typeprint.c
b1bf7bc
@@ -895,8 +895,8 @@ ada_print_type (struct type *type0, const char *varstring,
92b52c5
 	    const char *name = ada_type_name (type);
92b52c5
 
92b52c5
 	    if (!ada_is_range_type_name (name))
92b52c5
-	      fprintf_filtered (stream, _("<%d-byte integer>"),
92b52c5
-				TYPE_LENGTH (type));
92b52c5
+	      fprintf_filtered (stream, _("<%s-byte integer>"),
92b52c5
+				pulongest (TYPE_LENGTH (type)));
92b52c5
 	    else
92b52c5
 	      {
92b52c5
 		fprintf_filtered (stream, "range ");
b1bf7bc
@@ -917,7 +917,8 @@ ada_print_type (struct type *type0, const char *varstring,
92b52c5
 	  }
92b52c5
 	break;
92b52c5
       case TYPE_CODE_FLT:
92b52c5
-	fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type));
92b52c5
+	fprintf_filtered (stream, _("<%s-byte float>"),
92b52c5
+			  pulongest (TYPE_LENGTH (type)));
92b52c5
 	break;
92b52c5
       case TYPE_CODE_ENUM:
92b52c5
 	if (show < 0)
f637971
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
f637971
--- a/gdb/ada-valprint.c
f637971
+++ b/gdb/ada-valprint.c
f637971
@@ -34,11 +34,11 @@
f637971
 #include "target-float.h"
92b52c5
 
92b52c5
 static int print_field_values (struct type *, const gdb_byte *,
92b52c5
-			       int,
92b52c5
+			       LONGEST,
92b52c5
 			       struct ui_file *, int,
af2c2a5
 			       struct value *,
92b52c5
 			       const struct value_print_options *,
2c55a54
-			       int, struct type *, int,
2c55a54
+			       int, struct type *, LONGEST,
2c55a54
 			       const struct language_defn *);
92b52c5
 
2c55a54
 
2bcd68d
@@ -316,7 +316,7 @@ ada_emit_char (int c, struct type *type, struct ui_file *stream,
92b52c5
    of a character.  */
92b52c5
 
92b52c5
 static int
92b52c5
-char_at (const gdb_byte *string, int i, int type_len,
92b52c5
+char_at (const gdb_byte *string, LONGEST i, int type_len,
92b52c5
 	 enum bfd_endian byte_order)
92b52c5
 {
92b52c5
   if (type_len == 1)
2bcd68d
@@ -476,11 +476,11 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
92b52c5
 
92b52c5
 static void
92b52c5
 printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
92b52c5
-	  unsigned int length, int force_ellipses, int type_len,
92b52c5
+	  ULONGEST length, int force_ellipses, int type_len,
92b52c5
 	  const struct value_print_options *options)
92b52c5
 {
92b52c5
   enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype));
92b52c5
-  unsigned int i;
92b52c5
+  ULONGEST i;
92b52c5
   unsigned int things_printed = 0;
92b52c5
   int in_quotes = 0;
92b52c5
   int need_comma = 0;
2bcd68d
@@ -495,9 +495,9 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
92b52c5
     {
92b52c5
       /* Position of the character we are examining
92b52c5
          to see whether it is repeated.  */
92b52c5
-      unsigned int rep1;
92b52c5
+      ULONGEST rep1;
92b52c5
       /* Number of repetitions we have detected so far.  */
92b52c5
-      unsigned int reps;
92b52c5
+      ULONGEST reps;
92b52c5
 
92b52c5
       QUIT;
92b52c5
 
2bcd68d
@@ -528,7 +528,8 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
92b52c5
 	  ada_emit_char (char_at (string, i, type_len, byte_order),
92b52c5
 			 elttype, stream, '\'', type_len);
92b52c5
 	  fputs_filtered ("'", stream);
92b52c5
-	  fprintf_filtered (stream, _(" <repeats %u times>"), reps);
92b52c5
+	  fprintf_filtered (stream, _(" <repeats %s times>"),
92b52c5
+			    pulongest (reps));
92b52c5
 	  i = rep1 - 1;
92b52c5
 	  things_printed += options->repeat_count_threshold;
92b52c5
 	  need_comma = 1;
2bcd68d
@@ -556,7 +557,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
92b52c5
 
92b52c5
 void
92b52c5
 ada_printstr (struct ui_file *stream, struct type *type,
92b52c5
-	      const gdb_byte *string, unsigned int length,
92b52c5
+	      const gdb_byte *string, ULONGEST length,
92b52c5
 	      const char *encoding, int force_ellipses,
92b52c5
 	      const struct value_print_options *options)
92b52c5
 {
2bcd68d
@@ -566,12 +567,12 @@ ada_printstr (struct ui_file *stream, struct type *type,
92b52c5
 
92b52c5
 static int
92b52c5
 print_variant_part (struct type *type, int field_num,
92b52c5
-		    const gdb_byte *valaddr, int offset,
92b52c5
+		    const gdb_byte *valaddr, LONGEST offset,
92b52c5
 		    struct ui_file *stream, int recurse,
af2c2a5
 		    struct value *val,
92b52c5
 		    const struct value_print_options *options,
92b52c5
 		    int comma_needed,
2c55a54
-		    struct type *outer_type, int outer_offset,
2c55a54
+		    struct type *outer_type, LONGEST outer_offset,
2c55a54
 		    const struct language_defn *language)
92b52c5
 {
92b52c5
   struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
2bcd68d
@@ -607,11 +608,11 @@ print_variant_part (struct type *type, int field_num,
92b52c5
 
92b52c5
 static int
92b52c5
 print_field_values (struct type *type, const gdb_byte *valaddr,
92b52c5
-		    int offset, struct ui_file *stream, int recurse,
92b52c5
+		    LONGEST offset, struct ui_file *stream, int recurse,
af2c2a5
 		    struct value *val,
92b52c5
 		    const struct value_print_options *options,
92b52c5
 		    int comma_needed,
2c55a54
-		    struct type *outer_type, int outer_offset,
2c55a54
+		    struct type *outer_type, LONGEST outer_offset,
2c55a54
 		    const struct language_defn *language)
92b52c5
 {
92b52c5
   int i, len;
2bcd68d
@@ -677,7 +678,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
92b52c5
 	  else
92b52c5
 	    {
af2c2a5
 	      struct value *v;
92b52c5
-	      int bit_pos = TYPE_FIELD_BITPOS (type, i);
92b52c5
+	      LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
92b52c5
 	      int bit_size = TYPE_FIELD_BITSIZE (type, i);
92b52c5
 	      struct value_print_options opts;
92b52c5
 
2bcd68d
@@ -722,8 +723,8 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr,
2c55a54
 {
2c55a54
   enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
2c55a54
   struct type *elttype = TYPE_TARGET_TYPE (type);
2c55a54
-  unsigned int eltlen;
2c55a54
-  unsigned int len;
2c55a54
+  ULONGEST eltlen;
2c55a54
+  ULONGEST len;
2c55a54
 
2c55a54
   /* We know that ELTTYPE cannot possibly be null, because we assume
2c55a54
      that we're called only when TYPE is a string-like type.
2bcd68d
@@ -742,7 +743,7 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr,
2c55a54
      elements up to it.  */
2c55a54
   if (options->stop_print_at_null)
2c55a54
     {
2c55a54
-      int temp_len;
2c55a54
+      LONGEST temp_len;
2c55a54
 
2c55a54
       /* Look for a NULL char.  */
2c55a54
       for (temp_len = 0;
2bcd68d
@@ -1115,7 +1116,7 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr,
2c55a54
 
2c55a54
 static void
af2c2a5
 ada_val_print_1 (struct type *type,
2c55a54
-		 int offset, CORE_ADDR address,
2c55a54
+		 LONGEST offset, CORE_ADDR address,
2c55a54
 		 struct ui_file *stream, int recurse,
af2c2a5
 		 struct value *original_value,
2c55a54
 		 const struct value_print_options *options,
2bcd68d
@@ -1199,7 +1200,7 @@ ada_val_print_1 (struct type *type,
2c55a54
 
2c55a54
 void
af2c2a5
 ada_val_print (struct type *type,
2c55a54
-	       int embedded_offset, CORE_ADDR address,
2c55a54
+	       LONGEST embedded_offset, CORE_ADDR address,
2c55a54
 	       struct ui_file *stream, int recurse,
af2c2a5
 	       struct value *val,
2c55a54
 	       const struct value_print_options *options)
f637971
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
f637971
--- a/gdb/amd64-tdep.c
f637971
+++ b/gdb/amd64-tdep.c
6ee43ae
@@ -732,7 +732,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
f637971
 		    gdb_byte *readbuf, const gdb_byte *writebuf)
f637971
 {
f637971
   enum amd64_reg_class theclass[2];
f637971
-  int len = TYPE_LENGTH (type);
f637971
+  LONGEST len = TYPE_LENGTH (type);
f637971
   static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
f637971
   static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM };
f637971
   int integer_reg = 0;
6ee43ae
@@ -849,10 +849,10 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
f637971
       gdb_assert (regnum != -1);
f637971
 
f637971
       if (readbuf)
c9daf93
-	regcache->raw_read_part (regnum, offset, std::min (len, 8),
c9daf93
+	regcache->raw_read_part (regnum, offset, std::min (len, (LONGEST) 8),
c9daf93
 				 readbuf + i * 8);
f637971
       if (writebuf)
c9daf93
-	regcache->raw_write_part (regnum, offset, std::min (len, 8),
c9daf93
+	regcache->raw_write_part (regnum, offset, std::min (len, (LONGEST) 8),
c9daf93
 				  writebuf + i * 8);
f637971
     }
f637971
 
f637971
diff --git a/gdb/annotate.c b/gdb/annotate.c
f637971
--- a/gdb/annotate.c
f637971
+++ b/gdb/annotate.c
f637971
@@ -531,21 +531,21 @@ annotate_frame_end (void)
92b52c5
 }
92b52c5
 
92b52c5
 void
92b52c5
-annotate_array_section_begin (int idx, struct type *elttype)
92b52c5
+annotate_array_section_begin (LONGEST idx, struct type *elttype)
92b52c5
 {
92b52c5
   if (annotation_level == 2)
92b52c5
     {
92b52c5
-      printf_filtered (("\n\032\032array-section-begin %d "), idx);
92b52c5
+      printf_filtered (("\n\032\032array-section-begin %s "), plongest (idx));
92b52c5
       print_value_flags (elttype);
92b52c5
       printf_filtered (("\n"));
92b52c5
     }
92b52c5
 }
92b52c5
 
92b52c5
 void
92b52c5
-annotate_elt_rep (unsigned int repcount)
92b52c5
+annotate_elt_rep (ULONGEST repcount)
92b52c5
 {
92b52c5
   if (annotation_level == 2)
92b52c5
-    printf_filtered (("\n\032\032elt-rep %u\n"), repcount);
92b52c5
+    printf_filtered (("\n\032\032elt-rep %s\n"), pulongest (repcount));
92b52c5
 }
92b52c5
 
92b52c5
 void
f637971
diff --git a/gdb/annotate.h b/gdb/annotate.h
f637971
--- a/gdb/annotate.h
f637971
+++ b/gdb/annotate.h
b1bf7bc
@@ -105,8 +105,8 @@ extern void annotate_frame_source_end (void);
92b52c5
 extern void annotate_frame_where (void);
92b52c5
 extern void annotate_frame_end (void);
92b52c5
 
92b52c5
-extern void annotate_array_section_begin (int, struct type *);
92b52c5
-extern void annotate_elt_rep (unsigned int);
92b52c5
+extern void annotate_array_section_begin (LONGEST, struct type *);
92b52c5
+extern void annotate_elt_rep (ULONGEST);
92b52c5
 extern void annotate_elt_rep_end (void);
92b52c5
 extern void annotate_elt (void);
92b52c5
 extern void annotate_array_section_end (void);
f637971
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
f637971
--- a/gdb/arch-utils.c
f637971
+++ b/gdb/arch-utils.c
0702d0d
@@ -227,7 +227,7 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch,
f637971
 
f637971
 const struct floatformat **
f637971
 default_floatformat_for_type (struct gdbarch *gdbarch,
f637971
-			      const char *name, int len)
f637971
+			      const char *name, LONGEST len)
f637971
 {
f637971
   const struct floatformat **format = NULL;
f637971
 
f637971
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
f637971
--- a/gdb/arch-utils.h
f637971
+++ b/gdb/arch-utils.h
f637971
@@ -131,7 +131,7 @@ extern gdbarch_virtual_frame_pointer_ftype legacy_virtual_frame_pointer;
f637971
 /* Default implementation of gdbarch_floatformat_for_type.  */
f637971
 extern const struct floatformat **
f637971
   default_floatformat_for_type (struct gdbarch *gdbarch,
f637971
-				const char *name, int len);
f637971
+				const char *name, LONGEST len);
f637971
 
f637971
 extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame,
f637971
 					       CORE_ADDR pc);
f637971
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
f637971
--- a/gdb/arm-linux-nat.c
f637971
+++ b/gdb/arm-linux-nat.c
0702d0d
@@ -1096,7 +1096,7 @@ arm_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch,
2bcd68d
 /* Are we able to use a hardware watchpoint for the LEN bytes starting at 
92b52c5
    ADDR?  */
2bcd68d
 int
2bcd68d
-arm_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
2bcd68d
+arm_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
92b52c5
 {
92b52c5
   const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap ();
92b52c5
   CORE_ADDR max_wp_length, aligned_addr;
f637971
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
f637971
--- a/gdb/ax-gdb.c
f637971
+++ b/gdb/ax-gdb.c
f637971
@@ -82,12 +82,12 @@ static void gen_traced_pop (struct agent_expr *, struct axs_value *);
92b52c5
 static void gen_sign_extend (struct agent_expr *, struct type *);
92b52c5
 static void gen_extend (struct agent_expr *, struct type *);
92b52c5
 static void gen_fetch (struct agent_expr *, struct type *);
92b52c5
-static void gen_left_shift (struct agent_expr *, int);
92b52c5
+static void gen_left_shift (struct agent_expr *, LONGEST);
92b52c5
 
92b52c5
 
f637971
 static void gen_frame_args_address (struct agent_expr *);
f637971
 static void gen_frame_locals_address (struct agent_expr *);
92b52c5
-static void gen_offset (struct agent_expr *ax, int offset);
92b52c5
+static void gen_offset (struct agent_expr *ax, LONGEST offset);
92b52c5
 static void gen_sym_offset (struct agent_expr *, struct symbol *);
f637971
 static void gen_var_ref (struct agent_expr *ax, struct axs_value *value,
f637971
 			 struct symbol *var);
f637971
@@ -132,13 +132,13 @@ static void gen_complement (struct agent_expr *ax, struct axs_value *value);
f637971
 static void gen_deref (struct axs_value *);
f637971
 static void gen_address_of (struct axs_value *);
f637971
 static void gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
92b52c5
-			      struct type *type, int start, int end);
92b52c5
+			      struct type *type, LONGEST start, LONGEST end);
f637971
 static void gen_primitive_field (struct agent_expr *ax,
92b52c5
 				 struct axs_value *value,
92b52c5
-				 int offset, int fieldno, struct type *type);
5bb0f3b
+				 LONGEST offset, int fieldno, struct type *type);
f637971
 static int gen_struct_ref_recursive (struct agent_expr *ax,
92b52c5
 				     struct axs_value *value,
5bb0f3b
-				     const char *field, int offset,
5bb0f3b
+				     const char *field, LONGEST offset,
92b52c5
 				     struct type *type);
f637971
 static void gen_struct_ref (struct agent_expr *ax,
92b52c5
 			    struct axs_value *value,
f637971
@@ -529,7 +529,7 @@ gen_fetch (struct agent_expr *ax, struct type *type)
92b52c5
    right shift it by -DISTANCE bits if DISTANCE < 0.  This generates
92b52c5
    unsigned (logical) right shifts.  */
92b52c5
 static void
92b52c5
-gen_left_shift (struct agent_expr *ax, int distance)
92b52c5
+gen_left_shift (struct agent_expr *ax, LONGEST distance)
92b52c5
 {
92b52c5
   if (distance > 0)
92b52c5
     {
f637971
@@ -583,7 +583,7 @@ gen_frame_locals_address (struct agent_expr *ax)
92b52c5
    programming in ML, it would be clearer why these are the same
92b52c5
    thing.  */
92b52c5
 static void
92b52c5
-gen_offset (struct agent_expr *ax, int offset)
92b52c5
+gen_offset (struct agent_expr *ax, LONGEST offset)
92b52c5
 {
92b52c5
   /* It would suffice to simply push the offset and add it, but this
92b52c5
      makes it easier to read positive and negative offsets in the
f637971
@@ -1254,7 +1254,7 @@ gen_address_of (struct axs_value *value)
f637971
    structure.  */
92b52c5
 static void
f637971
 gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
f637971
-		  struct type *type, int start, int end)
f637971
+		  struct type *type, LONGEST start, LONGEST  end)
92b52c5
 {
92b52c5
   /* Note that ops[i] fetches 8 << i bits.  */
92b52c5
   static enum agent_op ops[]
f637971
@@ -1289,13 +1289,13 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
92b52c5
 
92b52c5
   /* The first and one-after-last bits in the field, but rounded down
92b52c5
      and up to byte boundaries.  */
92b52c5
-  int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
92b52c5
-  int bound_end = (((end + TARGET_CHAR_BIT - 1)
92b52c5
-		    / TARGET_CHAR_BIT)
92b52c5
-		   * TARGET_CHAR_BIT);
92b52c5
+  LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
92b52c5
+  LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1)
92b52c5
+			/ TARGET_CHAR_BIT)
92b52c5
+		       * TARGET_CHAR_BIT);
92b52c5
 
92b52c5
   /* current bit offset within the structure */
92b52c5
-  int offset;
92b52c5
+  LONGEST offset;
92b52c5
 
92b52c5
   /* The index in ops of the opcode we're considering.  */
92b52c5
   int op;
f637971
@@ -1413,7 +1413,7 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
f637971
 
92b52c5
 static void
f637971
 gen_primitive_field (struct agent_expr *ax, struct axs_value *value,
92b52c5
-		     int offset, int fieldno, struct type *type)
92b52c5
+		     LONGEST offset, int fieldno, struct type *type)
92b52c5
 {
92b52c5
   /* Is this a bitfield?  */
92b52c5
   if (TYPE_FIELD_PACKED (type, fieldno))
f637971
@@ -1437,7 +1437,7 @@ gen_primitive_field (struct agent_expr *ax, struct axs_value *value,
f637971
 
92b52c5
 static int
f637971
 gen_struct_ref_recursive (struct agent_expr *ax, struct axs_value *value,
5bb0f3b
-			  const char *field, int offset, struct type *type)
5bb0f3b
+			  const char *field, LONGEST offset, struct type *type)
92b52c5
 {
92b52c5
   int i, rslt;
92b52c5
   int nbases = TYPE_N_BASECLASSES (type);
f637971
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
f637971
--- a/gdb/ax-general.c
f637971
+++ b/gdb/ax-general.c
f637971
@@ -177,7 +177,7 @@ ax_zero_ext (struct agent_expr *x, int n)
92b52c5
 
92b52c5
 /* Append a trace_quick instruction to EXPR, to record N bytes.  */
92b52c5
 void
92b52c5
-ax_trace_quick (struct agent_expr *x, int n)
92b52c5
+ax_trace_quick (struct agent_expr *x, LONGEST n)
92b52c5
 {
92b52c5
   /* N must fit in a byte.  */
92b52c5
   if (n < 0 || n > 255)
f637971
diff --git a/gdb/ax.h b/gdb/ax.h
f637971
--- a/gdb/ax.h
f637971
+++ b/gdb/ax.h
f637971
@@ -193,7 +193,7 @@ extern void ax_ext (struct agent_expr *EXPR, int N);
92b52c5
 extern void ax_zero_ext (struct agent_expr *EXPR, int N);
92b52c5
 
92b52c5
 /* Append a trace_quick instruction to EXPR, to record N bytes.  */
92b52c5
-extern void ax_trace_quick (struct agent_expr *EXPR, int N);
92b52c5
+extern void ax_trace_quick (struct agent_expr *EXPR, LONGEST N);
92b52c5
 
92b52c5
 /* Append a goto op to EXPR.  OP is the actual op (must be aop_goto or
92b52c5
    aop_if_goto).  We assume we don't know the target offset yet,
f637971
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
f637971
--- a/gdb/breakpoint.c
f637971
+++ b/gdb/breakpoint.c
31f5b96
@@ -2056,9 +2056,9 @@ should_be_inserted (struct bp_location *bl)
2f7f533
 	{
2f7f533
 	  fprintf_unfiltered (gdb_stdlog,
2f7f533
 			      "infrun: stepping past non-steppable watchpoint. "
2f7f533
-			      "skipping watchpoint at %s:%d\n",
2f7f533
+			      "skipping watchpoint at %s:%s\n",
2f7f533
 			      paddress (bl->gdbarch, bl->address),
2f7f533
-			      bl->length);
2f7f533
+			      plongest (bl->length));
2f7f533
 	}
2f7f533
       return 0;
2f7f533
     }
31f5b96
@@ -6793,7 +6793,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1,
92b52c5
 static int
f637971
 breakpoint_address_match_range (const address_space *aspace1,
f637971
 				CORE_ADDR addr1,
f637971
-				int len1, const address_space *aspace2,
f637971
+				LONGEST len1, const address_space *aspace2,
92b52c5
 				CORE_ADDR addr2)
92b52c5
 {
556378e
   return ((gdbarch_has_global_breakpoints (target_gdbarch ())
b1bf7bc
@@ -10859,7 +10859,7 @@ can_use_hardware_watchpoint (const std::vector<value_ref_ptr> &vals)
92b52c5
 		      && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
92b52c5
 		{
92b52c5
 		  CORE_ADDR vaddr = value_address (v);
92b52c5
-		  int len;
92b52c5
+		  LONGEST len;
92b52c5
 		  int num_regs;
92b52c5
 
92b52c5
 		  len = (target_exact_watchpoints
f637971
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
f637971
--- a/gdb/breakpoint.h
f637971
+++ b/gdb/breakpoint.h
ab024a6
@@ -252,7 +252,7 @@ struct bp_target_info
92b52c5
 
92b52c5
   /* If this is a ranged breakpoint, then this field contains the
92b52c5
      length of the range that will be watched for execution.  */
92b52c5
-  int length;
92b52c5
+  LONGEST length;
92b52c5
 
92b52c5
   /* If the breakpoint lives in memory and reading that memory would
92b52c5
      give back the breakpoint, instead of the original contents, then
b1bf7bc
@@ -417,7 +417,7 @@ public:
92b52c5
   /* For hardware watchpoints, the size of the memory region being
92b52c5
      watched.  For hardware ranged breakpoints, the size of the
92b52c5
      breakpoint range.  */
f637971
-  int length = 0;
f637971
+  LONGEST length = 0;
92b52c5
 
92b52c5
   /* Type of hardware watchpoint.  */
f637971
   target_hw_bp_type watchpoint_type {};
f637971
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
f637971
--- a/gdb/c-lang.c
f637971
+++ b/gdb/c-lang.c
9e41188
@@ -185,7 +185,7 @@ c_printchar (int c, struct type *type, struct ui_file *stream)
92b52c5
 
92b52c5
 void
92b52c5
 c_printstr (struct ui_file *stream, struct type *type, 
92b52c5
-	    const gdb_byte *string, unsigned int length, 
92b52c5
+	    const gdb_byte *string, ULONGEST length,
92b52c5
 	    const char *user_encoding, int force_ellipses,
92b52c5
 	    const struct value_print_options *options)
92b52c5
 {
ab024a6
@@ -664,7 +664,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
92b52c5
 	  }
92b52c5
 	else
92b52c5
 	  {
92b52c5
-	    int i;
92b52c5
+	    LONGEST i;
92b52c5
 
92b52c5
 	    /* Write the terminating character.  */
92b52c5
 	    for (i = 0; i < TYPE_LENGTH (type); ++i)
ab024a6
@@ -673,7 +673,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
92b52c5
 	    if (satisfy_expected)
92b52c5
 	      {
92b52c5
 		LONGEST low_bound, high_bound;
92b52c5
-		int element_size = TYPE_LENGTH (type);
92b52c5
+		LONGEST element_size = TYPE_LENGTH (type);
92b52c5
 
92b52c5
 		if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type),
92b52c5
 					 &low_bound, &high_bound) < 0)
f637971
diff --git a/gdb/c-lang.h b/gdb/c-lang.h
f637971
--- a/gdb/c-lang.h
f637971
+++ b/gdb/c-lang.h
ab024a6
@@ -82,7 +82,7 @@ extern void c_print_typedef (struct type *,
92b52c5
 			     struct ui_file *);
92b52c5
 
af2c2a5
 extern void c_val_print (struct type *,
92b52c5
-			 int, CORE_ADDR,
92b52c5
+			 LONGEST, CORE_ADDR,
92b52c5
 			 struct ui_file *, int,
af2c2a5
 			 struct value *,
92b52c5
 			 const struct value_print_options *);
ab024a6
@@ -102,7 +102,7 @@ extern void c_printchar (int, struct type *, struct ui_file *);
92b52c5
 extern void c_printstr (struct ui_file * stream,
92b52c5
 			struct type *elttype,
92b52c5
 			const gdb_byte *string,
92b52c5
-			unsigned int length,
92b52c5
+			ULONGEST length,
92b52c5
 			const char *user_encoding,
92b52c5
 			int force_ellipses,
92b52c5
 			const struct value_print_options *options);
f637971
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
f637971
--- a/gdb/c-valprint.c
f637971
+++ b/gdb/c-valprint.c
c42f029
@@ -247,7 +247,7 @@ c_val_print_array (struct type *type, const gdb_byte *valaddr,
23f398e
   if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0)
23f398e
     {
23f398e
       LONGEST low_bound, high_bound;
23f398e
-      int eltlen, len;
23f398e
+      LONGEST eltlen, len;
23f398e
       struct gdbarch *gdbarch = get_type_arch (type);
23f398e
       enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
23f398e
       unsigned int i = 0;	/* Number of characters printed.  */
c42f029
@@ -321,8 +321,8 @@ c_val_print_array (struct type *type, const gdb_byte *valaddr,
23f398e
 	  if (cp_is_vtbl_ptr_type (elttype))
23f398e
 	    {
23f398e
 	      i = 1;
23f398e
-	      fprintf_filtered (stream, _("%d vtable entries"),
23f398e
-				len - 1);
23f398e
+	      fprintf_filtered (stream, _("%s vtable entries"),
23f398e
+				plongest (len - 1));
23f398e
 	    }
23f398e
 	  else
23f398e
 	    {
c42f029
@@ -399,7 +399,7 @@ c_val_print_struct (struct type *type, const gdb_byte *valaddr,
23f398e
 	 -fvtable_thunks.  (Otherwise, look under
23f398e
 	 TYPE_CODE_PTR.)  */
23f398e
       struct gdbarch *gdbarch = get_type_arch (type);
23f398e
-      int offset = (embedded_offset
23f398e
+      LONGEST offset = (embedded_offset
23f398e
 		    + TYPE_FIELD_BITPOS (type,
23f398e
 					 VTBL_FNADDR_OFFSET) / 8);
23f398e
       struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET);
c42f029
@@ -498,7 +498,7 @@ c_val_print_memberptr (struct type *type, const gdb_byte *valaddr,
92b52c5
 
92b52c5
 void
af2c2a5
 c_val_print (struct type *type,
92b52c5
-	     int embedded_offset, CORE_ADDR address,
92b52c5
+	     LONGEST embedded_offset, CORE_ADDR address,
92b52c5
 	     struct ui_file *stream, int recurse,
af2c2a5
 	     struct value *original_value,
92b52c5
 	     const struct value_print_options *options)
f637971
diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c
f637971
--- a/gdb/compile/compile-c-support.c
f637971
+++ b/gdb/compile/compile-c-support.c
0702d0d
@@ -270,11 +270,11 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
f637971
 
f637971
 	      default:
f637971
 		fprintf_unfiltered (stream,
f637971
-				    "  unsigned char %s[%d]"
f637971
+				    "  unsigned char %s[%s]"
f637971
 				    " __attribute__((__aligned__("
f637971
 				    "__BIGGEST_ALIGNMENT__)))",
f637971
 				    regname.c_str (),
f637971
-				    TYPE_LENGTH (regtype));
f637971
+				    pulongest (TYPE_LENGTH (regtype)));
f637971
 	      }
f637971
 	    fputs_unfiltered (";\n", stream);
f637971
 	  }
f637971
diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c
f637971
--- a/gdb/cp-abi.c
f637971
+++ b/gdb/cp-abi.c
f637971
@@ -64,12 +64,12 @@ is_operator_name (const char *name)
92b52c5
   return (*current_cp_abi.is_operator_name) (name);
92b52c5
 }
92b52c5
 
92b52c5
-int
92b52c5
+LONGEST
92b52c5
 baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
7306e88
 		  LONGEST embedded_offset, CORE_ADDR address,
92b52c5
 		  const struct value *val)
92b52c5
 {
92b52c5
-  int res = 0;
92b52c5
+  LONGEST res = 0;
92b52c5
 
92b52c5
   gdb_assert (current_cp_abi.baseclass_offset != NULL);
92b52c5
 
f637971
@@ -96,7 +96,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
92b52c5
 struct value *
92b52c5
 value_virtual_fn_field (struct value **arg1p,
92b52c5
 			struct fn_field *f, int j,
92b52c5
-			struct type *type, int offset)
92b52c5
+			struct type *type, LONGEST offset)
92b52c5
 {
92b52c5
   if ((current_cp_abi.virtual_fn_field) == NULL)
92b52c5
     return NULL;
f637971
diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h
f637971
--- a/gdb/cp-abi.h
f637971
+++ b/gdb/cp-abi.h
f637971
@@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep,
92b52c5
 					     struct fn_field *f,
92b52c5
 					     int j,
92b52c5
 					     struct type *type,
92b52c5
-					     int offset);
92b52c5
+					     LONGEST offset);
92b52c5
 
92b52c5
 
92b52c5
 /* Try to find the run-time type of VALUE, using C++ run-time type
f637971
@@ -144,11 +144,11 @@ extern struct type *value_rtti_type (struct value *value,
92b52c5
    contents of VAL.  The result is the offset of the baseclass value
92b52c5
    relative to (the address of)(ARG) + OFFSET.  */
92b52c5
 
92b52c5
-extern int baseclass_offset (struct type *type,
92b52c5
-			     int index, const gdb_byte *valaddr,
7306e88
-			     LONGEST embedded_offset,
92b52c5
-			     CORE_ADDR address,
92b52c5
-			     const struct value *val);
92b52c5
+extern LONGEST baseclass_offset (struct type *type,
92b52c5
+				 int index, const gdb_byte *valaddr,
92b52c5
+				 LONGEST embedded_offset,
92b52c5
+				 CORE_ADDR address,
92b52c5
+				 const struct value *val);
92b52c5
 
92b52c5
 /* Describe the target of a pointer to method.  CONTENTS is the byte
92b52c5
    pattern representing the pointer to method.  TYPE is the pointer to
f637971
@@ -226,12 +226,12 @@ struct cp_abi_ops
92b52c5
   struct value *(*virtual_fn_field) (struct value **arg1p,
92b52c5
 				     struct fn_field * f,
92b52c5
 				     int j, struct type * type,
92b52c5
-				     int offset);
92b52c5
+				     LONGEST offset);
92b52c5
   struct type *(*rtti_type) (struct value *v, int *full,
7306e88
 			     LONGEST *top, int *using_enc);
92b52c5
-  int (*baseclass_offset) (struct type *type, int index,
7306e88
-			   const bfd_byte *valaddr, LONGEST embedded_offset,
92b52c5
-			   CORE_ADDR address, const struct value *val);
92b52c5
+  LONGEST (*baseclass_offset) (struct type *type, int index,
7306e88
+			       const bfd_byte *valaddr, LONGEST embedded_offset,
7306e88
+			       CORE_ADDR address, const struct value *val);
92b52c5
   void (*print_method_ptr) (const gdb_byte *contents,
92b52c5
 			    struct type *type,
92b52c5
 			    struct ui_file *stream);
f637971
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
f637971
--- a/gdb/cp-valprint.c
f637971
+++ b/gdb/cp-valprint.c
f637971
@@ -335,7 +335,7 @@ cp_print_value_fields (struct type *type, struct type *real_type,
92b52c5
 		}
92b52c5
 	      else if (i == vptr_fieldno && type == vptr_basetype)
92b52c5
 		{
92b52c5
-		  int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
92b52c5
+		  LONGEST i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
92b52c5
 		  struct type *i_type = TYPE_FIELD_TYPE (type, i);
92b52c5
 
92b52c5
 		  if (valprint_check_validity (stream, i_type, i_offset, val))
f637971
diff --git a/gdb/d-lang.h b/gdb/d-lang.h
f637971
--- a/gdb/d-lang.h
f637971
+++ b/gdb/d-lang.h
ab024a6
@@ -79,7 +79,7 @@ extern struct block_symbol d_lookup_nested_symbol (struct type *, const char *,
eb6cb2d
 /* Defined in d-valprint.c  */
92b52c5
 
af2c2a5
 extern void d_val_print (struct type *type,
92b52c5
-			 int embedded_offset, CORE_ADDR address,
92b52c5
+			 LONGEST embedded_offset, CORE_ADDR address,
92b52c5
 			 struct ui_file *stream, int recurse,
af2c2a5
 			 struct value *val,
92b52c5
 			 const struct value_print_options *options);
f637971
diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c
f637971
--- a/gdb/d-valprint.c
f637971
+++ b/gdb/d-valprint.c
f637971
@@ -73,7 +73,7 @@ dynamic_array_type (struct type *type,
92b52c5
 
92b52c5
 /* Implements the la_val_print routine for language D.  */
92b52c5
 void
af2c2a5
-d_val_print (struct type *type, int embedded_offset,
af2c2a5
+d_val_print (struct type *type, LONGEST embedded_offset,
af2c2a5
              CORE_ADDR address, struct ui_file *stream, int recurse,
af2c2a5
 	     struct value *val,
92b52c5
              const struct value_print_options *options)
f637971
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
f637971
--- a/gdb/dwarf2loc.c
f637971
+++ b/gdb/dwarf2loc.c
9c7d730
@@ -1625,7 +1625,7 @@ rw_pieced_value (struct value *v, struct value *from)
f637971
   for (; i < c->pieces.size () && offset < max_offset; i++)
92b52c5
     {
92b52c5
       struct dwarf_expr_piece *p = &c->pieces[i];
92b52c5
-      size_t this_size_bits, this_size;
92b52c5
+      ULONGEST this_size_bits, this_size;
92b52c5
 
4f1de05
       this_size_bits = p->size - bits_to_skip;
4f1de05
       if (this_size_bits > max_offset - offset)
9c7d730
@@ -1872,7 +1872,7 @@ write_pieced_value (struct value *to, struct value *from)
92b52c5
 
92b52c5
 static int
7306e88
 check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset,
2f7f533
-				int bit_length)
2f7f533
+				LONGEST bit_length)
92b52c5
 {
92b52c5
   struct piece_closure *c
2f7f533
     = (struct piece_closure *) value_computed_closure (value);
9c7d730
@@ -1885,7 +1885,7 @@ check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset,
f637971
   for (i = 0; i < c->pieces.size () && bit_length > 0; i++)
92b52c5
     {
92b52c5
       struct dwarf_expr_piece *p = &c->pieces[i];
92b52c5
-      size_t this_size_bits = p->size;
92b52c5
+      ULONGEST this_size_bits = p->size;
92b52c5
 
92b52c5
       if (bit_offset > 0)
92b52c5
 	{
9c7d730
@@ -1989,8 +1989,8 @@ indirect_pieced_value (struct value *value)
4632e1f
     = (struct piece_closure *) value_computed_closure (value);
92b52c5
   struct type *type;
92b52c5
   struct frame_info *frame;
7306e88
-  int i, bit_length;
7306e88
-  LONGEST bit_offset;
92b52c5
+  int i;
7306e88
+  LONGEST bit_length, bit_offset;
92b52c5
   struct dwarf_expr_piece *piece = NULL;
7306e88
   LONGEST byte_offset;
0728371
   enum bfd_endian byte_order;
9c7d730
@@ -2007,7 +2007,7 @@ indirect_pieced_value (struct value *value)
f637971
   for (i = 0; i < c->pieces.size () && bit_length > 0; i++)
92b52c5
     {
92b52c5
       struct dwarf_expr_piece *p = &c->pieces[i];
92b52c5
-      size_t this_size_bits = p->size;
92b52c5
+      ULONGEST this_size_bits = p->size;
92b52c5
 
92b52c5
       if (bit_offset > 0)
92b52c5
 	{
9c7d730
@@ -2296,9 +2296,9 @@ if (frame != NULL) select_frame (frame);
5bb0f3b
 	case DWARF_VALUE_STACK:
5bb0f3b
 	  {
af2c2a5
 	    struct value *value = ctx.fetch (0);
92b52c5
-	    size_t n = TYPE_LENGTH (value_type (value));
5bb0f3b
-	    size_t len = TYPE_LENGTH (subobj_type);
5bb0f3b
-	    size_t max = TYPE_LENGTH (type);
92b52c5
+	    ULONGEST n = TYPE_LENGTH (value_type (value));
5bb0f3b
+	    ULONGEST len = TYPE_LENGTH (subobj_type);
5bb0f3b
+	    ULONGEST max = TYPE_LENGTH (type);
5bb0f3b
 	    struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
92b52c5
 
f637971
 	    if (subobj_byte_offset + len > max)
f637971
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
f637971
--- a/gdb/dwarf2read.c
f637971
+++ b/gdb/dwarf2read.c
31f5b96
@@ -2065,11 +2065,11 @@ dwarf2_complex_location_expr_complaint (void)
92b52c5
 }
92b52c5
 
92b52c5
 static void
92b52c5
-dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2,
92b52c5
-					      int arg3)
92b52c5
+dwarf2_const_value_length_mismatch_complaint (const char *arg1, LONGEST arg2,
92b52c5
+					      LONGEST arg3)
92b52c5
 {
9e41188
-  complaint (_("const value length mismatch for '%s', got %d, expected %d"),
92b52c5
-	     arg1, arg2, arg3);
9e41188
+  complaint (_("const value length mismatch for '%s', got %s, expected %s"),
92b52c5
+	     arg1, plongest (arg2), plongest (arg3));
92b52c5
 }
92b52c5
 
92b52c5
 static void
5e264d9
@@ -15104,8 +15104,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
92b52c5
 	         object, and then subtract off the number of bits of
92b52c5
 	         the field itself.  The result is the bit offset of
92b52c5
 	         the LSB of the field.  */
92b52c5
-	      int anonymous_size;
92b52c5
-	      int bit_offset = DW_UNSND (attr);
92b52c5
+	      LONGEST anonymous_size;
92b52c5
+	      LONGEST bit_offset = DW_UNSND (attr);
92b52c5
 
92b52c5
 	      attr = dwarf2_attr (die, DW_AT_byte_size, cu);
92b52c5
 	      if (attr)
f637971
diff --git a/gdb/eval.c b/gdb/eval.c
f637971
--- a/gdb/eval.c
f637971
+++ b/gdb/eval.c
2bcd68d
@@ -295,7 +295,8 @@ evaluate_struct_tuple (struct value *struct_val,
556378e
   while (--nargs >= 0)
556378e
     {
92b52c5
       struct value *val = NULL;
92b52c5
-      int bitpos, bitsize;
92b52c5
+      LONGEST bitpos;
556378e
+      int bitsize;
92b52c5
       bfd_byte *addr;
92b52c5
 
556378e
       fieldno++;
2bcd68d
@@ -356,7 +357,7 @@ init_array_element (struct value *array, struct value *element,
92b52c5
 		    enum noside noside, LONGEST low_bound, LONGEST high_bound)
92b52c5
 {
92b52c5
   LONGEST index;
92b52c5
-  int element_size = TYPE_LENGTH (value_type (element));
92b52c5
+  LONGEST element_size = TYPE_LENGTH (value_type (element));
92b52c5
 
92b52c5
   if (exp->elts[*pos].opcode == BINOP_COMMA)
92b52c5
     {
0702d0d
@@ -799,11 +800,11 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch,
92b52c5
     /* FIXME: Also mixed integral/booleans, with result an integer.  */
92b52c5
     {
92b52c5
       const struct builtin_type *builtin = builtin_type (gdbarch);
92b52c5
-      unsigned int promoted_len1 = TYPE_LENGTH (type1);
92b52c5
-      unsigned int promoted_len2 = TYPE_LENGTH (type2);
92b52c5
+      ULONGEST promoted_len1 = TYPE_LENGTH (type1);
92b52c5
+      ULONGEST promoted_len2 = TYPE_LENGTH (type2);
92b52c5
       int is_unsigned1 = TYPE_UNSIGNED (type1);
92b52c5
       int is_unsigned2 = TYPE_UNSIGNED (type2);
92b52c5
-      unsigned int result_len;
92b52c5
+      ULONGEST result_len;
92b52c5
       int unsigned_operation;
92b52c5
 
92b52c5
       /* Determine type length and signedness after promotion for
9c7d730
@@ -1553,7 +1554,7 @@ evaluate_subexp_standard (struct type *expect_type,
556378e
   struct value **argvec;
92b52c5
   int code;
92b52c5
   int ix;
92b52c5
-  long mem_offset;
92b52c5
+  LONGEST mem_offset;
92b52c5
   struct type **arg_types;
f637971
 
f637971
   pc = (*pos)++;
9c7d730
@@ -1738,7 +1739,7 @@ evaluate_subexp_standard (struct type *expect_type,
92b52c5
 	  struct type *range_type = TYPE_INDEX_TYPE (type);
92b52c5
 	  struct type *element_type = TYPE_TARGET_TYPE (type);
92b52c5
 	  struct value *array = allocate_value (expect_type);
92b52c5
-	  int element_size = TYPE_LENGTH (check_typedef (element_type));
92b52c5
+	  LONGEST element_size = TYPE_LENGTH (check_typedef (element_type));
92b52c5
 	  LONGEST low_bound, high_bound, index;
92b52c5
 
92b52c5
 	  if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
f637971
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
f637971
--- a/gdb/f-lang.c
f637971
+++ b/gdb/f-lang.c
f637971
@@ -101,7 +101,7 @@ f_printchar (int c, struct type *type, struct ui_file *stream)
92b52c5
 
92b52c5
 static void
92b52c5
 f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
92b52c5
-	    unsigned int length, const char *encoding, int force_ellipses,
92b52c5
+	    ULONGEST length, const char *encoding, int force_ellipses,
92b52c5
 	    const struct value_print_options *options)
92b52c5
 {
92b52c5
   const char *type_encoding = f_get_encoding (type);
f637971
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
f637971
--- a/gdb/f-lang.h
f637971
+++ b/gdb/f-lang.h
b1bf7bc
@@ -31,7 +31,7 @@ extern int f_parse (struct parser_state *);
eb6cb2d
 extern void f_print_type (struct type *, const char *, struct ui_file *, int,
eb6cb2d
 			  int, const struct type_print_options *);
92b52c5
 
af2c2a5
-extern void f_val_print (struct type *, int, CORE_ADDR,
af2c2a5
+extern void f_val_print (struct type *, LONGEST, CORE_ADDR,
92b52c5
 			 struct ui_file *, int,
af2c2a5
 			 struct value *,
92b52c5
 			 const struct value_print_options *);
f637971
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
f637971
--- a/gdb/f-valprint.c
f637971
+++ b/gdb/f-valprint.c
f637971
@@ -36,7 +36,7 @@
f637971
 
92b52c5
 static void f77_get_dynamic_length_of_aggregate (struct type *);
92b52c5
 
92b52c5
-int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
92b52c5
+LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
92b52c5
 
92b52c5
 /* Array which holds offsets to be applied to get a row's elements
92b52c5
    for a given array.  Array also holds the size of each subarray.  */
f637971
@@ -71,8 +71,8 @@ f77_get_upperbound (struct type *type)
eb6cb2d
 static void
eb6cb2d
 f77_get_dynamic_length_of_aggregate (struct type *type)
92b52c5
 {
eb6cb2d
-  int upper_bound = -1;
eb6cb2d
-  int lower_bound = 1;
eb6cb2d
+  LONGEST upper_bound = -1;
eb6cb2d
+  LONGEST lower_bound = 1;
92b52c5
 
eb6cb2d
   /* Recursively go all the way down into a possibly multi-dimensional
eb6cb2d
      F77 array and get the bounds.  For simple arrays, this is pretty
f637971
@@ -104,7 +104,7 @@ f77_get_dynamic_length_of_aggregate (struct type *type)
92b52c5
 static void
92b52c5
 f77_print_array_1 (int nss, int ndimensions, struct type *type,
92b52c5
 		   const gdb_byte *valaddr,
92b52c5
-		   int embedded_offset, CORE_ADDR address,
92b52c5
+		   LONGEST embedded_offset, CORE_ADDR address,
92b52c5
 		   struct ui_file *stream, int recurse,
92b52c5
 		   const struct value *val,
92b52c5
 		   const struct value_print_options *options,
f637971
@@ -113,7 +113,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
eb6cb2d
   struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type));
eb6cb2d
   CORE_ADDR addr = address + embedded_offset;
eb6cb2d
   LONGEST lowerbound, upperbound;
92b52c5
-  int i;
92b52c5
+  LONGEST i;
92b52c5
 
eb6cb2d
   get_discrete_bounds (range_type, &lowerbound, &upperbound);
eb6cb2d
 
f637971
@@ -175,7 +175,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
92b52c5
 
92b52c5
 static void
92b52c5
 f77_print_array (struct type *type, const gdb_byte *valaddr,
92b52c5
-		 int embedded_offset,
92b52c5
+		 LONGEST embedded_offset,
92b52c5
 		 CORE_ADDR address, struct ui_file *stream,
92b52c5
 		 int recurse,
92b52c5
 		 const struct value *val,
f637971
@@ -214,7 +214,7 @@ static const struct generic_val_print_decorations f_decorations =
92b52c5
    function; they are identical.  */
92b52c5
 
92b52c5
 void
af2c2a5
-f_val_print (struct type *type, int embedded_offset,
af2c2a5
+f_val_print (struct type *type, LONGEST embedded_offset,
af2c2a5
 	     CORE_ADDR address, struct ui_file *stream, int recurse,
af2c2a5
 	     struct value *original_value,
92b52c5
 	     const struct value_print_options *options)
f637971
diff --git a/gdb/findvar.c b/gdb/findvar.c
f637971
--- a/gdb/findvar.c
f637971
+++ b/gdb/findvar.c
6ee43ae
@@ -821,7 +821,7 @@ struct value *
eb6cb2d
 default_value_from_register (struct gdbarch *gdbarch, struct type *type,
eb6cb2d
                              int regnum, struct frame_id frame_id)
92b52c5
 {
92b52c5
-  int len = TYPE_LENGTH (type);
92b52c5
+  LONGEST len = TYPE_LENGTH (type);
92b52c5
   struct value *value = allocate_value (type);
af2c2a5
   struct frame_info *frame;
92b52c5
 
6ee43ae
@@ -865,7 +865,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame)
7306e88
   LONGEST offset = 0;
7306e88
   LONGEST reg_offset = value_offset (value);
92b52c5
   int regnum = VALUE_REGNUM (value);
23f398e
-  int len = type_length_units (check_typedef (value_type (value)));
23f398e
+  LONGEST len = type_length_units (check_typedef (value_type (value)));
92b52c5
 
92b52c5
   gdb_assert (VALUE_LVAL (value) == lval_register);
92b52c5
 
6ee43ae
@@ -880,7 +880,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame)
92b52c5
   while (len > 0)
92b52c5
     {
92b52c5
       struct value *regval = get_frame_register_value (frame, regnum);
23f398e
-      int reg_len = type_length_units (value_type (regval)) - reg_offset;
23f398e
+      LONGEST reg_len = type_length_units (value_type (regval)) - reg_offset;
92b52c5
 
2f7f533
       /* If the register length is larger than the number of bytes
2f7f533
          remaining to copy, then only copy the appropriate bytes.  */
f637971
diff --git a/gdb/frame.c b/gdb/frame.c
f637971
--- a/gdb/frame.c
f637971
+++ b/gdb/frame.c
2111580
@@ -1393,7 +1393,7 @@ deprecated_frame_register_read (struct frame_info *frame, int regnum,
92b52c5
 
92b52c5
 int
92b52c5
 get_frame_register_bytes (struct frame_info *frame, int regnum,
92b52c5
-			  CORE_ADDR offset, int len, gdb_byte *myaddr,
92b52c5
+			  CORE_ADDR offset, LONGEST len, gdb_byte *myaddr,
92b52c5
 			  int *optimizedp, int *unavailablep)
92b52c5
 {
92b52c5
   struct gdbarch *gdbarch = get_frame_arch (frame);
2111580
@@ -1422,7 +1422,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum,
92b52c5
     }
92b52c5
   if (len > maxsize)
92b52c5
     error (_("Bad debug information detected: "
92b52c5
-	     "Attempt to read %d bytes from registers."), len);
92b52c5
+	     "Attempt to read %s bytes from registers."), plongest (len));
92b52c5
 
92b52c5
   /* Copy the data.  */
92b52c5
   while (len > 0)
f637971
diff --git a/gdb/frame.h b/gdb/frame.h
f637971
--- a/gdb/frame.h
f637971
+++ b/gdb/frame.h
9e41188
@@ -620,7 +620,7 @@ extern void put_frame_register (struct frame_info *frame, int regnum,
92b52c5
    contents are optimized out or unavailable, set *OPTIMIZEDP,
92b52c5
    *UNAVAILABLEP accordingly.  */
92b52c5
 extern int get_frame_register_bytes (struct frame_info *frame, int regnum,
92b52c5
-				     CORE_ADDR offset, int len,
92b52c5
+				     CORE_ADDR offset, LONGEST len,
92b52c5
 				     gdb_byte *myaddr,
92b52c5
 				     int *optimizedp, int *unavailablep);
92b52c5
 
f637971
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
f637971
--- a/gdb/gdbarch.c
f637971
+++ b/gdb/gdbarch.c
2111580
@@ -1795,7 +1795,7 @@ set_gdbarch_wchar_signed (struct gdbarch *gdbarch,
f637971
 }
f637971
 
f637971
 const struct floatformat **
f637971
-gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length)
f637971
+gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length)
f637971
 {
f637971
   gdb_assert (gdbarch != NULL);
f637971
   gdb_assert (gdbarch->floatformat_for_type != NULL);
f637971
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
f637971
--- a/gdb/gdbarch.h
f637971
+++ b/gdb/gdbarch.h
9c7d730
@@ -218,8 +218,8 @@ extern void set_gdbarch_wchar_signed (struct gdbarch *gdbarch, int wchar_signed)
f637971
    NAME, if non-NULL, is the type name, which may be used to distinguish
f637971
    different target formats of the same length. */
f637971
 
f637971
-typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, int length);
f637971
-extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length);
f637971
+typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, LONGEST length);
f637971
+extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length);
f637971
 extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type);
f637971
 
f637971
 /* For most targets, a pointer on the target and its representation as an
f637971
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
f637971
--- a/gdb/gdbarch.sh
f637971
+++ b/gdb/gdbarch.sh
2bcd68d
@@ -385,7 +385,7 @@ v;int;wchar_signed;;;1;-1;1
f637971
 # Returns the floating-point format to be used for values of length LENGTH.
f637971
 # NAME, if non-NULL, is the type name, which may be used to distinguish
f637971
 # different target formats of the same length.
f637971
-m;const struct floatformat **;floatformat_for_type;const char *name, int length;name, length;0;default_floatformat_for_type;;0
f637971
+m;const struct floatformat **;floatformat_for_type;const char *name, LONGEST length;name, length;0;default_floatformat_for_type;;0
f637971
 
f637971
 # For most targets, a pointer on the target and its representation as an
f637971
 # address in GDB have the same size and "look the same".  For such a
f637971
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
f637971
--- a/gdb/gdbtypes.c
f637971
+++ b/gdb/gdbtypes.c
31f5b96
@@ -2889,7 +2889,7 @@ floatformat_from_type (const struct type *type)
ab333d9
    least as long as OBJFILE.  */
92b52c5
 
92b52c5
 struct type *
f637971
-init_type (struct objfile *objfile, enum type_code code, int bit,
f637971
+init_type (struct objfile *objfile, enum type_code code, LONGEST bit,
af2c2a5
 	   const char *name)
92b52c5
 {
92b52c5
   struct type *type;
b1bf7bc
@@ -3340,8 +3340,8 @@ is_public_ancestor (struct type *base, struct type *dclass)
92b52c5
 
92b52c5
 static int
92b52c5
 is_unique_ancestor_worker (struct type *base, struct type *dclass,
92b52c5
-			   int *offset,
92b52c5
-			   const gdb_byte *valaddr, int embedded_offset,
92b52c5
+			   LONGEST *offset,
92b52c5
+			   const gdb_byte *valaddr, LONGEST embedded_offset,
92b52c5
 			   CORE_ADDR address, struct value *val)
92b52c5
 {
92b52c5
   int i, count = 0;
b1bf7bc
@@ -3352,7 +3352,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass,
92b52c5
   for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i)
92b52c5
     {
92b52c5
       struct type *iter;
92b52c5
-      int this_offset;
92b52c5
+      LONGEST this_offset;
92b52c5
 
92b52c5
       iter = check_typedef (TYPE_BASECLASS (dclass, i));
92b52c5
 
b1bf7bc
@@ -3393,7 +3393,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass,
92b52c5
 int
92b52c5
 is_unique_ancestor (struct type *base, struct value *val)
92b52c5
 {
92b52c5
-  int offset = -1;
92b52c5
+  LONGEST offset = -1;
92b52c5
 
92b52c5
   return is_unique_ancestor_worker (base, value_type (val), &offset,
92b52c5
 				    value_contents_for_printing (val),
b1bf7bc
@@ -4620,7 +4620,7 @@ recursive_dump_type (struct type *type, int spaces)
92b52c5
       break;
92b52c5
     }
92b52c5
   puts_filtered ("\n");
92b52c5
-  printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
92b52c5
+  printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type)));
92b52c5
   if (TYPE_OBJFILE_OWNED (type))
92b52c5
     {
92b52c5
       printfi_filtered (spaces, "objfile ");
b1bf7bc
@@ -5065,7 +5065,7 @@ copy_type (const struct type *type)
556378e
 
92b52c5
 struct type *
92b52c5
 arch_type (struct gdbarch *gdbarch,
f637971
-	   enum type_code code, int bit, const char *name)
f637971
+	   enum type_code code, LONGEST bit, const char *name)
92b52c5
 {
92b52c5
   struct type *type;
92b52c5
 
f637971
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
f637971
--- a/gdb/gdbtypes.h
f637971
+++ b/gdb/gdbtypes.h
9c7d730
@@ -864,7 +864,7 @@ struct type
23f398e
      type_length_units function should be used in order to get the length
23f398e
      expressed in target addressable memory units.  */
23f398e
 
23f398e
-  unsigned int length;
92b52c5
+  ULONGEST length;
92b52c5
 
eb6cb2d
   /* * Core type, shared by a group of qualified types.  */
eb6cb2d
 
9c7d730
@@ -1787,7 +1787,7 @@ extern unsigned int type_length_units (struct type *type);
eb6cb2d
 
eb6cb2d
 /* * Helper function to construct objfile-owned types.  */
92b52c5
 
af2c2a5
-extern struct type *init_type (struct objfile *, enum type_code, int,
af2c2a5
+extern struct type *init_type (struct objfile *, enum type_code, LONGEST,
af2c2a5
 			       const char *);
af2c2a5
 extern struct type *init_integer_type (struct objfile *, int, int,
af2c2a5
 				       const char *);
9c7d730
@@ -1804,7 +1804,7 @@ extern struct type *init_pointer_type (struct objfile *, int, const char *,
af2c2a5
 				       struct type *);
92b52c5
 
92b52c5
 /* Helper functions to construct architecture-owned types.  */
7306e88
-extern struct type *arch_type (struct gdbarch *, enum type_code, int,
92b52c5
+extern struct type *arch_type (struct gdbarch *, enum type_code, LONGEST,
7306e88
 			       const char *);
7306e88
 extern struct type *arch_integer_type (struct gdbarch *, int, int,
7306e88
 				       const char *);
f637971
diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
f637971
--- a/gdb/gnu-v2-abi.c
f637971
+++ b/gdb/gnu-v2-abi.c
f637971
@@ -82,7 +82,7 @@ gnuv2_is_operator_name (const char *name)
92b52c5
    TYPE is the type in which F is located.  */
92b52c5
 static struct value *
92b52c5
 gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
92b52c5
-			struct type * type, int offset)
92b52c5
+			struct type *type, LONGEST offset)
92b52c5
 {
92b52c5
   struct value *arg1 = *arg1p;
92b52c5
   struct type *type1 = check_typedef (value_type (arg1));
f637971
@@ -338,7 +338,7 @@ vb_match (struct type *type, int index, struct type *basetype)
92b52c5
    target).  The result is the offset of the baseclass value relative<