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

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