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

475228
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
475228
From: Fedora GDB patches <invalid@email.com>
475228
Date: Fri, 27 Oct 2017 21:07:50 +0200
475228
Subject: gdb-rhbz795424-bitpos-22of25.patch
475228
475228
;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
475228
;; (RH BZ 795424).
475228
;;=push
475228
475228
http://sourceware.org/ml/gdb-patches/2012-09/msg00629.html
475228
475228
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
475228
Content-Type: text/plain; charset=US-ASCII
475228
Content-Transfer-Encoding: 7bit
475228
Content-Disposition: inline
475228
475228
Hi,
475228
475228
This is part three of the bitpos expansion change.  Some architectures
475228
allow arbitrary length watchpoints and combined with the fact that type
475228
lengths could be large enough, we need LONGEST for watchpoint lengths.
475228
It is architecture dependent however, whether the LONGEST is needed or
475228
not.  This patch updates the signatures of watchpoint insertion and
475228
removal functions of all architectures (to comply with the function
475228
signatures in the callback struct), but expands types only in
475228
architectures that need it.  Tested on Fedora 16 x86_64.
475228
475228
Regards,
475228
Siddhesh
475228
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
475228
Content-Type: text/plain
475228
Content-Transfer-Encoding: quoted-printable
475228
Content-Disposition: attachment; filename=ChangeLog-wp
475228
475228
gdb/ChangeLog:
475228
475228
	* arm-linux-nat.c (arm_linux_insert_watchpoint): Expand
475228
	parameter LEN to LONGEST.
475228
	(arm_linux_remove_watchpoint): Likewise.
475228
	(arm_linux_watchpoint_addr_within_range): Expand parameter
475228
	LENGTH to LONGEST.
475228
	* i386-nat.c (i386_insert_watchpoint): Expand parameter LEN to
475228
	LONGEST.
475228
	(i386_remove_watchpoint): Likewise.
475228
	* ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise.
475228
	(ia64_linux_remove_watchpoint): Likewise.
475228
	* inf-ttrace.c (inf_ttrace_insert_watchpoint): Likewise.
475228
	Expand NUM_PAGES, PAGE to LONGEST.
475228
	(inf_ttrace_remove_watchpoint): Likewise.
475228
	* mips-linux-nat.c (mips_linux_insert_watchpoint): Expand
475228
	parameter LEN to LONGEST.
475228
	(mips_linux_remove_watchpoint): Likewise.
475228
	* nto-procfs.c (procfs_remove_hw_watchpoint): Likewise.
475228
	(procfs_insert_hw_watchpoint): Likewise.
475228
	* ppc-linux-nat.c (calculate_dvc): Likewise.  Expand I,
475228
	NUM_BYTE_ENABLE to LONGEST.
475228
	(check_condition): Expand parameter LEN to point to LONGEST.
475228
	(ppc_linux_can_accel_watchpoint_condition): Expand parameter
475228
	LEN to LONGEST.
475228
	(create_watchpoint_request): Likewise.
475228
	(ppc_linux_insert_watchpoint): Likewise.
475228
	(ppc_linux_remove_watchpoint): Likewise.
475228
	(ppc_linux_watchpoint_addr_within_range): Expand parameter
475228
	LENGTH to LONGEST.
475228
	* procfs.c (proc_set_watchpoint): Expand parameter LEN to
475228
	LONGEST.
475228
	(procfs_set_watchpoint): Likewise.
475228
	(procfs_insert_watchpoint): Likewise.
475228
	(procfs_remove_watchpoint): Likewise.
475228
	* remote-m32r-sdi.c (m32r_insert_watchpoint): Likewise.  Use
475228
	plongest to format print LEN.
475228
	(m32r_remove_watchpoint): Likewise.
475228
	* remote-mips.c (mips_insert_watchpoint): Expand parameter LEN
475228
	to LONGEST.
475228
	(mips_remove_watchpoint): Likewise.
475228
	* remote.c (remote_insert_watchpoint): Likewise.
475228
	Use phex_nz to format print LEN.
475228
	(remote_remove_watchpoint): Likewise.
475228
	(remote_watchpoint_addr_within_range): Expand parameter LENGTH
475228
	to LONGEST.
475228
	* s390-linux-nat.c (s390_insert_watchpoint): Expand parameter LEN to
475228
	LONGEST.
475228
	(s390_remove_watchpoint): Likewise.
475228
	* target.c (update_current_target): Expand parameter LEN for
475228
	callbacks to TO_INSERT_WATCHPOINT, TO_REMOVE_WATCHPOINT,
475228
	TO_CAN_ACCEL_WATCHPOINT_CONDITION, to LONGEST.
475228
	(default_watchpoint_addr_within_range): Expand parameter
475228
	LENGTH to LONGEST.
475228
	(debug_to_can_accel_watchpoint_condition): Expand parameter LEN
475228
	to LONGEST.  Use plongest to format print LEN.
475228
	(debug_to_watchpoint_addr_within_range): Expand parameter LENGTH
475228
	to LONGEST.  Use plongest to format print LENGTH.
475228
	(debug_to_insert_watchpoint): Expand parameter LEN to LONGEST.
475228
	Use plongest to format print LEN.
475228
	(debug_to_remove_watchpoint): Likewise.
475228
	* target.h (struct target_ops): Expand parameter LEN of
475228
	TO_REMOVE_WATCHPOINT, TO_INSERT_WATCHPOINT,
475228
	TO_WATCHPOINT_ADDR_WITHIN_RANGE and
475228
	TO_CAN_ACCEL_WATCHPOINT_CONDITION to LONGEST.
475228
475228
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
475228
Content-Type: text/x-patch
475228
Content-Transfer-Encoding: 7bit
475228
Content-Disposition: attachment; filename=bitpos-wp.patch
475228
475228
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
475228
--- a/gdb/aarch64-linux-nat.c
475228
+++ b/gdb/aarch64-linux-nat.c
475228
@@ -63,14 +63,14 @@ public:
475228
   int can_use_hw_breakpoint (enum bptype, int, int) override;
475228
   int insert_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override;
475228
   int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override;
475228
-  int region_ok_for_hw_watchpoint (CORE_ADDR, int) override;
475228
+  int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override;
475228
   int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
475228
 			 struct expression *) override;
475228
   int remove_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
475228
 			 struct expression *) override;
475228
   bool stopped_by_watchpoint () override;
475228
   bool stopped_data_address (CORE_ADDR *) override;
475228
-  bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
475228
+  bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override;
475228
 
475228
   int can_do_single_step () override;
475228
 
475228
@@ -887,7 +887,8 @@ aarch64_linux_nat_target::stopped_by_watchpoint ()
475228
 
475228
 bool
475228
 aarch64_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr,
475228
-							CORE_ADDR start, int length)
475228
+							CORE_ADDR start,
475228
+							LONGEST length)
475228
 {
475228
   return start <= addr && start + length - 1 >= addr;
475228
 }
475228
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
475228
--- a/gdb/arm-linux-nat.c
475228
+++ b/gdb/arm-linux-nat.c
475228
@@ -80,7 +80,7 @@ public:
475228
 
475228
   int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override;
475228
 
475228
-  int region_ok_for_hw_watchpoint (CORE_ADDR, int) override;
475228
+  int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override;
475228
 
475228
   int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
475228
 			 struct expression *) override;
475228
@@ -91,7 +91,7 @@ public:
475228
 
475228
   bool stopped_data_address (CORE_ADDR *) override;
475228
 
475228
-  bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
475228
+  bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override;
475228
 
475228
   const struct target_desc *read_description () override;
475228
 
475228
@@ -1203,7 +1203,7 @@ arm_linux_nat_target::stopped_by_watchpoint ()
475228
 bool
475228
 arm_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr,
475228
 						    CORE_ADDR start,
475228
-						    int length)
475228
+						    LONGEST length)
475228
 {
475228
   return start <= addr && start + length - 1 >= addr;
475228
 }
475228
diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c
475228
--- a/gdb/nat/aarch64-linux-hw-point.c
475228
+++ b/gdb/nat/aarch64-linux-hw-point.c
475228
@@ -137,7 +137,7 @@ aarch64_point_encode_ctrl_reg (enum target_hw_bp_type type, int offset, int len)
475228
    Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise.  */
475228
 
475228
 static int
475228
-aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len)
475228
+aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, LONGEST len)
475228
 {
475228
   unsigned int alignment = 0;
475228
 
475228
@@ -212,9 +212,10 @@ aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len)
475228
    an address within the latter. */
475228
 
475228
 static void
475228
-aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p,
475228
+aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len,
475228
+			  CORE_ADDR *aligned_addr_p,
475228
 			  int *aligned_offset_p, int *aligned_len_p,
475228
-			  CORE_ADDR *next_addr_p, int *next_len_p,
475228
+			  CORE_ADDR *next_addr_p, LONGEST *next_len_p,
475228
 			  CORE_ADDR *next_addr_orig_p)
475228
 {
475228
   int aligned_len;
475228
@@ -611,7 +612,7 @@ aarch64_handle_aligned_watchpoint (enum target_hw_bp_type type,
475228
 
475228
 static int
475228
 aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
475228
-				     CORE_ADDR addr, int len, int is_insert,
475228
+				     CORE_ADDR addr, LONGEST len, int is_insert,
475228
 				     struct aarch64_debug_reg_state *state)
475228
 {
475228
   CORE_ADDR addr_orig = addr;
475228
@@ -641,12 +642,12 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
475228
 		      "                                "
475228
 		      "addr_orig: %s\n"
475228
 		      "                                "
475228
-		      "next_addr: %s,    next_len: %d\n"
475228
+		      "next_addr: %s,    next_len: %s\n"
475228
 		      "                           "
475228
 		      "addr_orig_next: %s\n",
475228
 		      is_insert, core_addr_to_string_nz (aligned_addr),
475228
 		      aligned_len, core_addr_to_string_nz (addr_orig),
475228
-		      core_addr_to_string_nz (addr), len,
475228
+		      core_addr_to_string_nz (addr), plongest (len),
475228
 		      core_addr_to_string_nz (addr_orig_next));
475228
 
475228
       addr_orig = addr_orig_next;
475228
@@ -660,7 +661,7 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
475228
 
475228
 int
475228
 aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
475228
-			   int len, int is_insert,
475228
+			   LONGEST len, int is_insert,
475228
 			   struct aarch64_debug_reg_state *state)
475228
 {
475228
   if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len))
475228
@@ -742,14 +743,14 @@ aarch64_linux_any_set_debug_regs_state (aarch64_debug_reg_state *state,
475228
 void
475228
 aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
475228
 			      const char *func, CORE_ADDR addr,
475228
-			      int len, enum target_hw_bp_type type)
475228
+			      LONGEST len, enum target_hw_bp_type type)
475228
 {
475228
   int i;
475228
 
475228
   debug_printf ("%s", func);
475228
   if (addr || len)
475228
-    debug_printf (" (addr=0x%08lx, len=%d, type=%s)",
475228
-		  (unsigned long) addr, len,
475228
+    debug_printf (" (addr=0x%08lx, len=%s, type=%s)",
475228
+		  (unsigned long) addr, plongest (len),
475228
 		  type == hw_write ? "hw-write-watchpoint"
475228
 		  : (type == hw_read ? "hw-read-watchpoint"
475228
 		     : (type == hw_access ? "hw-access-watchpoint"
475228
@@ -832,7 +833,7 @@ aarch64_linux_get_debug_reg_capacity (int tid)
475228
    ADDR and whose length is LEN in bytes.  */
475228
 
475228
 int
475228
-aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, int len)
475228
+aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, LONGEST len)
475228
 {
475228
   CORE_ADDR aligned_addr;
475228
 
475228
diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h
475228
--- a/gdb/nat/aarch64-linux-hw-point.h
475228
+++ b/gdb/nat/aarch64-linux-hw-point.h
475228
@@ -176,7 +176,7 @@ int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr,
475228
 			       int len, int is_insert,
475228
 			       struct aarch64_debug_reg_state *state);
475228
 int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
475228
-			       int len, int is_insert,
475228
+			       LONGEST len, int is_insert,
475228
 			       struct aarch64_debug_reg_state *state);
475228
 
475228
 void aarch64_linux_set_debug_regs (struct aarch64_debug_reg_state *state,
475228
@@ -189,12 +189,12 @@ bool aarch64_linux_any_set_debug_regs_state (aarch64_debug_reg_state *state,
475228
 
475228
 void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
475228
 				   const char *func, CORE_ADDR addr,
475228
-				   int len, enum target_hw_bp_type type);
475228
+				   LONGEST len, enum target_hw_bp_type type);
475228
 
475228
 void aarch64_linux_get_debug_reg_capacity (int tid);
475228
 
475228
 struct aarch64_debug_reg_state *aarch64_get_debug_reg_state (pid_t pid);
475228
 
475228
-int aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, int len);
475228
+int aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, LONGEST len);
475228
 
475228
 #endif /* NAT_AARCH64_LINUX_HW_POINT_H */
475228
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
475228
--- a/gdb/ppc-linux-nat.c
475228
+++ b/gdb/ppc-linux-nat.c
475228
@@ -284,7 +284,7 @@ struct ppc_linux_nat_target final : public linux_nat_target
475228
   int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *)
475228
     override;
475228
 
475228
-  int region_ok_for_hw_watchpoint (CORE_ADDR, int) override;
475228
+  int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override;
475228
 
475228
   int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
475228
 			 struct expression *) override;
475228
@@ -302,9 +302,9 @@ struct ppc_linux_nat_target final : public linux_nat_target
475228
 
475228
   bool stopped_data_address (CORE_ADDR *) override;
475228
 
475228
-  bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
475228
+  bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override;
475228
 
475228
-  bool can_accel_watchpoint_condition (CORE_ADDR, int, int, struct expression *)
475228
+  bool can_accel_watchpoint_condition (CORE_ADDR, LONGEST, int, struct expression *)
475228
     override;
475228
 
475228
   int masked_watch_num_registers (CORE_ADDR, CORE_ADDR) override;
475228
@@ -2065,11 +2065,11 @@ can_use_watchpoint_cond_accel (void)
475228
    CONDITION_VALUE will hold the value which should be put in the
475228
    DVC register.  */
475228
 static void
475228
-calculate_dvc (CORE_ADDR addr, int len, CORE_ADDR data_value,
475228
+calculate_dvc (CORE_ADDR addr, LONGEST len, CORE_ADDR data_value,
475228
 	       uint32_t *condition_mode, uint64_t *condition_value)
475228
 {
475228
-  int i, num_byte_enable, align_offset, num_bytes_off_dvc,
475228
-      rightmost_enabled_byte;
475228
+  LONGEST i, num_byte_enable;
475228
+  int align_offset, num_bytes_off_dvc, rightmost_enabled_byte;
475228
   CORE_ADDR addr_end_data, addr_end_dvc;
475228
 
475228
   /* The DVC register compares bytes within fixed-length windows which
475228
@@ -2157,7 +2157,7 @@ num_memory_accesses (const std::vector<value_ref_ptr> &chain)
475228
    of the constant.  */
475228
 static int
475228
 check_condition (CORE_ADDR watch_addr, struct expression *cond,
475228
-		 CORE_ADDR *data_value, int *len)
475228
+		 CORE_ADDR *data_value, LONGEST *len)
475228
 {
475228
   int pc = 1, num_accesses_left, num_accesses_right;
475228
   struct value *left_val, *right_val;
475228
@@ -2208,7 +2208,8 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond,
475228
    the condition expression, thus only triggering the watchpoint when it is
475228
    true.  */
475228
 bool
475228
-ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, int len,
475228
+ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr,
475228
+						      LONGEST len,
475228
 						      int rw,
475228
 						      struct expression *cond)
475228
 {
475228
@@ -2226,7 +2227,7 @@ ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, int len,
475228
 
475228
 static void
475228
 create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr,
475228
-			   int len, enum target_hw_bp_type type,
475228
+			   LONGEST len, enum target_hw_bp_type type,
475228
 			   struct expression *cond, int insert)
475228
 {
475228
   if (len == 1
475228
@@ -2492,7 +2493,7 @@ ppc_linux_nat_target::stopped_by_watchpoint ()
475228
 bool
475228
 ppc_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr,
475228
 						    CORE_ADDR start,
475228
-						    int length)
475228
+						    LONGEST length)
475228
 {
475228
   int mask;
475228
 
475228
diff --git a/gdb/procfs.c b/gdb/procfs.c
475228
--- a/gdb/procfs.c
475228
+++ b/gdb/procfs.c
475228
@@ -1546,7 +1546,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr)
475228
 }
475228
 
475228
 static int
475228
-proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags)
475228
+proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, LONGEST len, int wflags)
475228
 {
475228
   struct {
475228
     procfs_ctl_t cmd;
475228
@@ -3238,7 +3238,7 @@ procfs_target::pid_to_exec_file (int pid)
475228
 /* Insert a watchpoint.  */
475228
 
475228
 static int
475228
-procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
475228
+procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, LONGEST len, int rwflag,
475228
 		       int after)
475228
 {
475228
   int       pflags = 0;
475228
diff --git a/gdb/remote.c b/gdb/remote.c
475228
--- a/gdb/remote.c
475228
+++ b/gdb/remote.c
475228
@@ -450,7 +450,7 @@ public:
475228
 
475228
   bool stopped_data_address (CORE_ADDR *) override;
475228
 
475228
-  bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
475228
+  bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override;
475228
 
475228
   int can_use_hw_breakpoint (enum bptype, int, int) override;
475228
 
475228
@@ -10335,7 +10335,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len,
475228
   p = strchr (rs->buf.data (), '\0');
475228
   addr = remote_address_masked (addr);
475228
   p += hexnumstr (p, (ULONGEST) addr);
475228
-  xsnprintf (p, endbuf - p, ",%x", len);
475228
+  xsnprintf (p, endbuf - p, ",%s", phex_nz (len, sizeof (len)));
475228
 
475228
   putpkt (rs->buf);
475228
   getpkt (&rs->buf, 0);
475228
@@ -10355,7 +10355,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len,
475228
 
475228
 bool
475228
 remote_target::watchpoint_addr_within_range (CORE_ADDR addr,
475228
-					     CORE_ADDR start, int length)
475228
+					     CORE_ADDR start, LONGEST length)
475228
 {
475228
   CORE_ADDR diff = remote_address_masked (addr - start);
475228
 
475228
@@ -10384,7 +10384,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len,
475228
   p = strchr (rs->buf.data (), '\0');
475228
   addr = remote_address_masked (addr);
475228
   p += hexnumstr (p, (ULONGEST) addr);
475228
-  xsnprintf (p, endbuf - p, ",%x", len);
475228
+  xsnprintf (p, endbuf - p, ",%s", phex_nz (len, sizeof (len)));
475228
   putpkt (rs->buf);
475228
   getpkt (&rs->buf, 0);
475228
 
475228
diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
475228
--- a/gdb/s390-linux-nat.c
475228
+++ b/gdb/s390-linux-nat.c
475228
@@ -121,7 +121,7 @@ public:
475228
     override;
475228
   int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *)
475228
     override;
475228
-  int region_ok_for_hw_watchpoint (CORE_ADDR, int) override;
475228
+  int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override;
475228
   bool stopped_by_watchpoint () override;
475228
   int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
475228
 			 struct expression *) override;
475228
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
475228
--- a/gdb/target-delegates.c
475228
+++ b/gdb/target-delegates.c
475228
@@ -37,9 +37,9 @@ struct dummy_target : public target_ops
475228
   bool stopped_by_watchpoint () override;
475228
   bool have_steppable_watchpoint () override;
475228
   bool stopped_data_address (CORE_ADDR *arg0) override;
475228
-  bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override;
475228
+  bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) override;
475228
   int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override;
475228
-  bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override;
475228
+  bool can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3) override;
475228
   int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override;
475228
   int can_do_single_step () override;
475228
   bool supports_terminal_ours () override;
475228
@@ -204,9 +204,9 @@ struct debug_target : public target_ops
475228
   bool stopped_by_watchpoint () override;
475228
   bool have_steppable_watchpoint () override;
475228
   bool stopped_data_address (CORE_ADDR *arg0) override;
475228
-  bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override;
475228
+  bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) override;
475228
   int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override;
475228
-  bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override;
475228
+  bool can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3) override;
475228
   int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override;
475228
   int can_do_single_step () override;
475228
   bool supports_terminal_ours () override;
475228
@@ -1041,19 +1041,19 @@ debug_target::stopped_data_address (CORE_ADDR *arg0)
475228
 }
475228
 
475228
 bool
475228
-target_ops::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2)
475228
+target_ops::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2)
475228
 {
475228
   return this->beneath ()->watchpoint_addr_within_range (arg0, arg1, arg2);
475228
 }
475228
 
475228
 bool
475228
-dummy_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2)
475228
+dummy_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2)
475228
 {
475228
   return default_watchpoint_addr_within_range (this, arg0, arg1, arg2);
475228
 }
475228
 
475228
 bool
475228
-debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2)
475228
+debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2)
475228
 {
475228
   bool result;
475228
   fprintf_unfiltered (gdb_stdlog, "-> %s->watchpoint_addr_within_range (...)\n", this->beneath ()->shortname ());
475228
@@ -1063,7 +1063,7 @@ debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int
475228
   fputs_unfiltered (", ", gdb_stdlog);
475228
   target_debug_print_CORE_ADDR (arg1);
475228
   fputs_unfiltered (", ", gdb_stdlog);
475228
-  target_debug_print_int (arg2);
475228
+  target_debug_print_LONGEST (arg2);
475228
   fputs_unfiltered (") = ", gdb_stdlog);
475228
   target_debug_print_bool (result);
475228
   fputs_unfiltered ("\n", gdb_stdlog);
475228
@@ -1099,19 +1099,19 @@ debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1)
475228
 }
475228
 
475228
 bool
475228
-target_ops::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3)
475228
+target_ops::can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3)
475228
 {
475228
   return this->beneath ()->can_accel_watchpoint_condition (arg0, arg1, arg2, arg3);
475228
 }
475228
 
475228
 bool
475228
-dummy_target::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3)
475228
+dummy_target::can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3)
475228
 {
475228
   return false;
475228
 }
475228
 
475228
 bool
475228
-debug_target::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3)
475228
+debug_target::can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3)
475228
 {
475228
   bool result;
475228
   fprintf_unfiltered (gdb_stdlog, "-> %s->can_accel_watchpoint_condition (...)\n", this->beneath ()->shortname ());
475228
@@ -1119,7 +1119,7 @@ debug_target::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2
475228
   fprintf_unfiltered (gdb_stdlog, "<- %s->can_accel_watchpoint_condition (", this->beneath ()->shortname ());
475228
   target_debug_print_CORE_ADDR (arg0);
475228
   fputs_unfiltered (", ", gdb_stdlog);
475228
-  target_debug_print_int (arg1);
475228
+  target_debug_print_LONGEST (arg1);
475228
   fputs_unfiltered (", ", gdb_stdlog);
475228
   target_debug_print_int (arg2);
475228
   fputs_unfiltered (", ", gdb_stdlog);
475228
diff --git a/gdb/target.c b/gdb/target.c
475228
--- a/gdb/target.c
475228
+++ b/gdb/target.c
475228
@@ -55,7 +55,7 @@ static void generic_tls_error (void) ATTRIBUTE_NORETURN;
475228
 static void default_terminal_info (struct target_ops *, const char *, int);
475228
 
475228
 static int default_watchpoint_addr_within_range (struct target_ops *,
475228
-						 CORE_ADDR, CORE_ADDR, int);
475228
+						 CORE_ADDR, CORE_ADDR, LONGEST);
475228
 
475228
 static int default_region_ok_for_hw_watchpoint (struct target_ops *,
475228
 						CORE_ADDR, LONGEST);
475228
@@ -3111,7 +3111,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self,
475228
 static int
475228
 default_watchpoint_addr_within_range (struct target_ops *target,
475228
 				      CORE_ADDR addr,
475228
-				      CORE_ADDR start, int length)
475228
+				      CORE_ADDR start, LONGEST length)
475228
 {
475228
   return addr >= start && addr < start + length;
475228
 }
475228
diff --git a/gdb/target.h b/gdb/target.h
475228
--- a/gdb/target.h
475228
+++ b/gdb/target.h
475228
@@ -561,7 +561,7 @@ struct target_ops
475228
       TARGET_DEFAULT_RETURN (false);
475228
     virtual bool stopped_data_address (CORE_ADDR *)
475228
       TARGET_DEFAULT_RETURN (false);
475228
-    virtual bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int)
475228
+    virtual bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST)
475228
       TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range);
475228
 
475228
     /* Documentation of this routine is provided with the corresponding
475228
@@ -569,7 +569,7 @@ struct target_ops
475228
     virtual int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST)
475228
       TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
475228
 
475228
-    virtual bool can_accel_watchpoint_condition (CORE_ADDR, int, int,
475228
+    virtual bool can_accel_watchpoint_condition (CORE_ADDR, LONGEST, int,
475228
 						 struct expression *)
475228
       TARGET_DEFAULT_RETURN (false);
475228
     virtual int masked_watch_num_registers (CORE_ADDR, CORE_ADDR)