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

7a6771
http://sourceware.org/ml/gdb-patches/2012-09/msg00629.html
7a6771
Subject: [PATCH 3/4] Expand watchpoint lengths to LONGEST
7a6771
7a6771
7a6771
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
7a6771
Content-Type: text/plain; charset=US-ASCII
7a6771
Content-Transfer-Encoding: 7bit
7a6771
Content-Disposition: inline
7a6771
7a6771
Hi,
7a6771
7a6771
This is part three of the bitpos expansion change.  Some architectures
7a6771
allow arbitrary length watchpoints and combined with the fact that type
7a6771
lengths could be large enough, we need LONGEST for watchpoint lengths.
7a6771
It is architecture dependent however, whether the LONGEST is needed or
7a6771
not.  This patch updates the signatures of watchpoint insertion and
7a6771
removal functions of all architectures (to comply with the function
7a6771
signatures in the callback struct), but expands types only in
7a6771
architectures that need it.  Tested on Fedora 16 x86_64.
7a6771
7a6771
Regards,
7a6771
Siddhesh
7a6771
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
7a6771
Content-Type: text/plain
7a6771
Content-Transfer-Encoding: quoted-printable
7a6771
Content-Disposition: attachment; filename=ChangeLog-wp
7a6771
7a6771
gdb/ChangeLog:
7a6771
7a6771
	* arm-linux-nat.c (arm_linux_insert_watchpoint): Expand
7a6771
	parameter LEN to LONGEST.
7a6771
	(arm_linux_remove_watchpoint): Likewise.
7a6771
	(arm_linux_watchpoint_addr_within_range): Expand parameter
7a6771
	LENGTH to LONGEST.
7a6771
	* i386-nat.c (i386_insert_watchpoint): Expand parameter LEN to
7a6771
	LONGEST.
7a6771
	(i386_remove_watchpoint): Likewise.
7a6771
	* ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise.
7a6771
	(ia64_linux_remove_watchpoint): Likewise.
7a6771
	* inf-ttrace.c (inf_ttrace_insert_watchpoint): Likewise.
7a6771
	Expand NUM_PAGES, PAGE to LONGEST.
7a6771
	(inf_ttrace_remove_watchpoint): Likewise.
7a6771
	* mips-linux-nat.c (mips_linux_insert_watchpoint): Expand
7a6771
	parameter LEN to LONGEST.
7a6771
	(mips_linux_remove_watchpoint): Likewise.
7a6771
	* nto-procfs.c (procfs_remove_hw_watchpoint): Likewise.
7a6771
	(procfs_insert_hw_watchpoint): Likewise.
7a6771
	* ppc-linux-nat.c (calculate_dvc): Likewise.  Expand I,
7a6771
	NUM_BYTE_ENABLE to LONGEST.
7a6771
	(check_condition): Expand parameter LEN to point to LONGEST.
7a6771
	(ppc_linux_can_accel_watchpoint_condition): Expand parameter
7a6771
	LEN to LONGEST.
7a6771
	(create_watchpoint_request): Likewise.
7a6771
	(ppc_linux_insert_watchpoint): Likewise.
7a6771
	(ppc_linux_remove_watchpoint): Likewise.
7a6771
	(ppc_linux_watchpoint_addr_within_range): Expand parameter
7a6771
	LENGTH to LONGEST.
7a6771
	* procfs.c (proc_set_watchpoint): Expand parameter LEN to
7a6771
	LONGEST.
7a6771
	(procfs_set_watchpoint): Likewise.
7a6771
	(procfs_insert_watchpoint): Likewise.
7a6771
	(procfs_remove_watchpoint): Likewise.
7a6771
	* remote-m32r-sdi.c (m32r_insert_watchpoint): Likewise.  Use
7a6771
	plongest to format print LEN.
7a6771
	(m32r_remove_watchpoint): Likewise.
7a6771
	* remote-mips.c (mips_insert_watchpoint): Expand parameter LEN
7a6771
	to LONGEST.
7a6771
	(mips_remove_watchpoint): Likewise.
7a6771
	* remote.c (remote_insert_watchpoint): Likewise.
7a6771
	Use phex_nz to format print LEN.
7a6771
	(remote_remove_watchpoint): Likewise.
7a6771
	(remote_watchpoint_addr_within_range): Expand parameter LENGTH
7a6771
	to LONGEST.
7a6771
	* s390-linux-nat.c (s390_insert_watchpoint): Expand parameter LEN to
7a6771
	LONGEST.
7a6771
	(s390_remove_watchpoint): Likewise.
7a6771
	* target.c (update_current_target): Expand parameter LEN for
7a6771
	callbacks to TO_INSERT_WATCHPOINT, TO_REMOVE_WATCHPOINT,
7a6771
	TO_CAN_ACCEL_WATCHPOINT_CONDITION, to LONGEST.
7a6771
	(default_watchpoint_addr_within_range): Expand parameter
7a6771
	LENGTH to LONGEST.
7a6771
	(debug_to_can_accel_watchpoint_condition): Expand parameter LEN
7a6771
	to LONGEST.  Use plongest to format print LEN.
7a6771
	(debug_to_watchpoint_addr_within_range): Expand parameter LENGTH
7a6771
	to LONGEST.  Use plongest to format print LENGTH.
7a6771
	(debug_to_insert_watchpoint): Expand parameter LEN to LONGEST.
7a6771
	Use plongest to format print LEN.
7a6771
	(debug_to_remove_watchpoint): Likewise.
7a6771
	* target.h (struct target_ops): Expand parameter LEN of
7a6771
	TO_REMOVE_WATCHPOINT, TO_INSERT_WATCHPOINT,
7a6771
	TO_WATCHPOINT_ADDR_WITHIN_RANGE and
7a6771
	TO_CAN_ACCEL_WATCHPOINT_CONDITION to LONGEST.
7a6771
7a6771
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
7a6771
Content-Type: text/x-patch
7a6771
Content-Transfer-Encoding: 7bit
7a6771
Content-Disposition: attachment; filename=bitpos-wp.patch
7a6771
7a6771
Index: gdb-7.10.50.20151027/gdb/arm-linux-nat.c
7a6771
===================================================================
7a6771
--- gdb-7.10.50.20151027.orig/gdb/arm-linux-nat.c	2015-11-08 10:36:33.050071812 +0100
7a6771
+++ gdb-7.10.50.20151027/gdb/arm-linux-nat.c	2015-11-08 10:36:33.094072110 +0100
7a6771
@@ -1209,7 +1209,7 @@ arm_linux_stopped_by_watchpoint (struct
7a6771
 static int
7a6771
 arm_linux_watchpoint_addr_within_range (struct target_ops *target,
7a6771
 					CORE_ADDR addr,
7a6771
-					CORE_ADDR start, int length)
7a6771
+					CORE_ADDR start, LONGEST length)
7a6771
 {
7a6771
   return start <= addr && start + length - 1 >= addr;
7a6771
 }
7a6771
Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
7a6771
===================================================================
7a6771
--- gdb-7.10.50.20151027.orig/gdb/ppc-linux-nat.c	2015-11-08 10:36:33.064071907 +0100
7a6771
+++ gdb-7.10.50.20151027/gdb/ppc-linux-nat.c	2015-11-08 10:36:33.095072117 +0100
7a6771
@@ -1807,11 +1807,11 @@ can_use_watchpoint_cond_accel (void)
7a6771
    CONDITION_VALUE will hold the value which should be put in the
7a6771
    DVC register.  */
7a6771
 static void
7a6771
-calculate_dvc (CORE_ADDR addr, int len, CORE_ADDR data_value,
7a6771
+calculate_dvc (CORE_ADDR addr, LONGEST len, CORE_ADDR data_value,
7a6771
 	       uint32_t *condition_mode, uint64_t *condition_value)
7a6771
 {
7a6771
-  int i, num_byte_enable, align_offset, num_bytes_off_dvc,
7a6771
-      rightmost_enabled_byte;
7a6771
+  LONGEST i, num_byte_enable;
7a6771
+  int align_offset, num_bytes_off_dvc, rightmost_enabled_byte;
7a6771
   CORE_ADDR addr_end_data, addr_end_dvc;
7a6771
 
7a6771
   /* The DVC register compares bytes within fixed-length windows which
7a6771
@@ -1898,7 +1898,7 @@ num_memory_accesses (struct value *v)
7a6771
    of the constant.  */
7a6771
 static int
7a6771
 check_condition (CORE_ADDR watch_addr, struct expression *cond,
7a6771
-		 CORE_ADDR *data_value, int *len)
7a6771
+		 CORE_ADDR *data_value, LONGEST *len)
7a6771
 {
7a6771
   int pc = 1, num_accesses_left, num_accesses_right;
7a6771
   struct value *left_val, *right_val, *left_chain, *right_chain;
7a6771
@@ -1966,7 +1966,7 @@ check_condition (CORE_ADDR watch_addr, s
7a6771
    true.  */
7a6771
 static int
7a6771
 ppc_linux_can_accel_watchpoint_condition (struct target_ops *self,
7a6771
-					  CORE_ADDR addr, int len, int rw,
7a6771
+					  CORE_ADDR addr, LONGEST len, int rw,
7a6771
 					  struct expression *cond)
7a6771
 {
7a6771
   CORE_ADDR data_value;
7a6771
@@ -1983,7 +1983,7 @@ ppc_linux_can_accel_watchpoint_condition
7a6771
 
7a6771
 static void
7a6771
 create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr,
7a6771
-			   int len, enum target_hw_bp_type type,
7a6771
+			   LONGEST len, enum target_hw_bp_type type,
7a6771
 			   struct expression *cond, int insert)
7a6771
 {
7a6771
   if (len == 1
7a6771
@@ -2249,7 +2249,7 @@ ppc_linux_stopped_by_watchpoint (struct
7a6771
 static int
7a6771
 ppc_linux_watchpoint_addr_within_range (struct target_ops *target,
7a6771
 					CORE_ADDR addr,
7a6771
-					CORE_ADDR start, int length)
7a6771
+					CORE_ADDR start, LONGEST length)
7a6771
 {
7a6771
   int mask;
7a6771
 
7a6771
Index: gdb-7.10.50.20151027/gdb/procfs.c
7a6771
===================================================================
7a6771
--- gdb-7.10.50.20151027.orig/gdb/procfs.c	2015-11-08 10:36:33.065071913 +0100
7a6771
+++ gdb-7.10.50.20151027/gdb/procfs.c	2015-11-08 10:36:33.096072123 +0100
7a6771
@@ -2427,7 +2427,7 @@ procfs_address_to_host_pointer (CORE_ADD
7a6771
 #endif
7a6771
 
7a6771
 static int
7a6771
-proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags)
7a6771
+proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, LONGEST len, int wflags)
7a6771
 {
7a6771
 #if !defined (PCWATCH) && !defined (PIOCSWATCH)
7a6771
   /* If neither or these is defined, we can't support watchpoints.
7a6771
@@ -4706,7 +4706,7 @@ procfs_pid_to_str (struct target_ops *op
7a6771
 /* Insert a watchpoint.  */
7a6771
 
7a6771
 static int
7a6771
-procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
7a6771
+procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, LONGEST len, int rwflag,
7a6771
 		       int after)
7a6771
 {
7a6771
 #ifndef AIX5
7a6771
Index: gdb-7.10.50.20151027/gdb/remote.c
7a6771
===================================================================
7a6771
--- gdb-7.10.50.20151027.orig/gdb/remote.c	2015-11-08 10:36:33.067071927 +0100
7a6771
+++ gdb-7.10.50.20151027/gdb/remote.c	2015-11-08 10:36:33.097072130 +0100
7a6771
@@ -9085,7 +9085,7 @@ remote_insert_watchpoint (struct target_
7a6771
   p = strchr (rs->buf, '\0');
7a6771
   addr = remote_address_masked (addr);
7a6771
   p += hexnumstr (p, (ULONGEST) addr);
7a6771
-  xsnprintf (p, endbuf - p, ",%x", len);
7a6771
+  xsnprintf (p, endbuf - p, ",%s", phex_nz (len, sizeof (len)));
7a6771
 
7a6771
   putpkt (rs->buf);
7a6771
   getpkt (&rs->buf, &rs->buf_size, 0);
7a6771
@@ -9105,7 +9105,7 @@ remote_insert_watchpoint (struct target_
7a6771
 
7a6771
 static int
7a6771
 remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr,
7a6771
-				     CORE_ADDR start, int length)
7a6771
+				     CORE_ADDR start, LONGEST length)
7a6771
 {
7a6771
   CORE_ADDR diff = remote_address_masked (addr - start);
7a6771
 
7a6771
@@ -9134,7 +9134,7 @@ remote_remove_watchpoint (struct target_
7a6771
   p = strchr (rs->buf, '\0');
7a6771
   addr = remote_address_masked (addr);
7a6771
   p += hexnumstr (p, (ULONGEST) addr);
7a6771
-  xsnprintf (p, endbuf - p, ",%x", len);
7a6771
+  xsnprintf (p, endbuf - p, ",%s", phex_nz (len, sizeof (len)));
7a6771
   putpkt (rs->buf);
7a6771
   getpkt (&rs->buf, &rs->buf_size, 0);
7a6771
 
7a6771
Index: gdb-7.10.50.20151027/gdb/target.c
7a6771
===================================================================
7a6771
--- gdb-7.10.50.20151027.orig/gdb/target.c	2015-11-08 10:36:33.069071941 +0100
7a6771
+++ gdb-7.10.50.20151027/gdb/target.c	2015-11-08 10:36:33.098072137 +0100
7a6771
@@ -51,7 +51,7 @@ static void generic_tls_error (void) ATT
7a6771
 static void default_terminal_info (struct target_ops *, const char *, int);
7a6771
 
7a6771
 static int default_watchpoint_addr_within_range (struct target_ops *,
7a6771
-						 CORE_ADDR, CORE_ADDR, int);
7a6771
+						 CORE_ADDR, CORE_ADDR, LONGEST);
7a6771
 
7a6771
 static int default_region_ok_for_hw_watchpoint (struct target_ops *,
7a6771
 						CORE_ADDR, LONGEST);
7a6771
@@ -3140,7 +3140,7 @@ default_region_ok_for_hw_watchpoint (str
7a6771
 static int
7a6771
 default_watchpoint_addr_within_range (struct target_ops *target,
7a6771
 				      CORE_ADDR addr,
7a6771
-				      CORE_ADDR start, int length)
7a6771
+				      CORE_ADDR start, LONGEST length)
7a6771
 {
7a6771
   return addr >= start && addr < start + length;
7a6771
 }
7a6771
Index: gdb-7.10.50.20151027/gdb/target.h
7a6771
===================================================================
7a6771
--- gdb-7.10.50.20151027.orig/gdb/target.h	2015-11-08 10:36:33.069071941 +0100
7a6771
+++ gdb-7.10.50.20151027/gdb/target.h	2015-11-08 10:36:33.098072137 +0100
7a6771
@@ -543,7 +543,7 @@ struct target_ops
7a6771
     int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *)
7a6771
       TARGET_DEFAULT_RETURN (0);
7a6771
     int (*to_watchpoint_addr_within_range) (struct target_ops *,
7a6771
-					    CORE_ADDR, CORE_ADDR, int)
7a6771
+					    CORE_ADDR, CORE_ADDR, LONGEST)
7a6771
       TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range);
7a6771
 
7a6771
     /* Documentation of this routine is provided with the corresponding
7a6771
@@ -553,7 +553,7 @@ struct target_ops
7a6771
       TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
7a6771
 
7a6771
     int (*to_can_accel_watchpoint_condition) (struct target_ops *,
7a6771
-					      CORE_ADDR, int, int,
7a6771
+					      CORE_ADDR, LONGEST, int,
7a6771
 					      struct expression *)
7a6771
       TARGET_DEFAULT_RETURN (0);
7a6771
     int (*to_masked_watch_num_registers) (struct target_ops *,
7a6771
Index: gdb-7.10.50.20151027/gdb/aarch64-linux-nat.c
7a6771
===================================================================
7a6771
--- gdb-7.10.50.20151027.orig/gdb/aarch64-linux-nat.c	2015-11-08 10:36:33.074071975 +0100
7a6771
+++ gdb-7.10.50.20151027/gdb/aarch64-linux-nat.c	2015-11-08 10:36:33.098072137 +0100
7a6771
@@ -795,7 +795,7 @@ aarch64_linux_stopped_by_watchpoint (str
7a6771
 static int
7a6771
 aarch64_linux_watchpoint_addr_within_range (struct target_ops *target,
7a6771
 					    CORE_ADDR addr,
7a6771
-					    CORE_ADDR start, int length)
7a6771
+					    CORE_ADDR start, LONGEST length)
7a6771
 {
7a6771
   return start <= addr && start + length - 1 >= addr;
7a6771
 }
7a6771
Index: gdb-7.10.50.20151027/gdb/target-delegates.c
7a6771
===================================================================
7a6771
--- gdb-7.10.50.20151027.orig/gdb/target-delegates.c	2015-11-08 10:36:33.073071968 +0100
7a6771
+++ gdb-7.10.50.20151027/gdb/target-delegates.c	2015-11-08 10:36:33.099072144 +0100
7a6771
@@ -709,14 +709,14 @@ debug_stopped_data_address (struct targe
7a6771
 }
7a6771
 
7a6771
 static int
7a6771
-delegate_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
7a6771
+delegate_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, LONGEST arg3)
7a6771
 {
7a6771
   self = self->beneath;
7a6771
   return self->to_watchpoint_addr_within_range (self, arg1, arg2, arg3);
7a6771
 }
7a6771
 
7a6771
 static int
7a6771
-debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
7a6771
+debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, LONGEST arg3)
7a6771
 {
7a6771
   int result;
7a6771
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_watchpoint_addr_within_range (...)\n", debug_target.to_shortname);
7a6771
@@ -728,7 +728,7 @@ debug_watchpoint_addr_within_range (stru
7a6771
   fputs_unfiltered (", ", gdb_stdlog);
7a6771
   target_debug_print_CORE_ADDR (arg2);
7a6771
   fputs_unfiltered (", ", gdb_stdlog);
7a6771
-  target_debug_print_int (arg3);
7a6771
+  target_debug_print_LONGEST (arg3);
7a6771
   fputs_unfiltered (") = ", gdb_stdlog);
7a6771
   target_debug_print_int (result);
7a6771
   fputs_unfiltered ("\n", gdb_stdlog);
7a6771
@@ -761,20 +761,20 @@ debug_region_ok_for_hw_watchpoint (struc
7a6771
 }
7a6771
 
7a6771
 static int
7a6771
-delegate_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
7a6771
+delegate_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2, int arg3, struct expression *arg4)
7a6771
 {
7a6771
   self = self->beneath;
7a6771
   return self->to_can_accel_watchpoint_condition (self, arg1, arg2, arg3, arg4);
7a6771
 }
7a6771
 
7a6771
 static int
7a6771
-tdefault_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
7a6771
+tdefault_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2, int arg3, struct expression *arg4)
7a6771
 {
7a6771
   return 0;
7a6771
 }
7a6771
 
7a6771
 static int
7a6771
-debug_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
7a6771
+debug_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2, int arg3, struct expression *arg4)
7a6771
 {
7a6771
   int result;
7a6771
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_can_accel_watchpoint_condition (...)\n", debug_target.to_shortname);
7a6771
@@ -784,7 +784,7 @@ debug_can_accel_watchpoint_condition (st
7a6771
   fputs_unfiltered (", ", gdb_stdlog);
7a6771
   target_debug_print_CORE_ADDR (arg1);
7a6771
   fputs_unfiltered (", ", gdb_stdlog);
7a6771
-  target_debug_print_int (arg2);
7a6771
+  target_debug_print_LONGEST (arg2);
7a6771
   fputs_unfiltered (", ", gdb_stdlog);
7a6771
   target_debug_print_int (arg3);
7a6771
   fputs_unfiltered (", ", gdb_stdlog);
7a6771
Index: gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.c
7a6771
===================================================================
7a6771
--- gdb-7.10.50.20151027.orig/gdb/nat/aarch64-linux-hw-point.c	2015-10-27 02:48:31.000000000 +0100
7a6771
+++ gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.c	2015-11-08 10:36:33.099072144 +0100
7a6771
@@ -111,7 +111,7 @@ aarch64_point_encode_ctrl_reg (enum targ
7a6771
    Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise.  */
7a6771
 
7a6771
 static int
7a6771
-aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len)
7a6771
+aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, LONGEST len)
7a6771
 {
7a6771
   unsigned int alignment = 0;
7a6771
 
7a6771
@@ -180,9 +180,10 @@ aarch64_point_is_aligned (int is_watchpo
7a6771
    limitations can be largely relaxed with some further work.  */
7a6771
 
7a6771
 static void
7a6771
-aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p,
7a6771
+aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len,
7a6771
+			  CORE_ADDR *aligned_addr_p,
7a6771
 			  int *aligned_len_p, CORE_ADDR *next_addr_p,
7a6771
-			  int *next_len_p)
7a6771
+			  LONGEST *next_len_p)
7a6771
 {
7a6771
   int aligned_len;
7a6771
   unsigned int offset;
7a6771
@@ -494,7 +495,7 @@ aarch64_handle_aligned_watchpoint (enum
7a6771
 
7a6771
 static int
7a6771
 aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
7a6771
-				     CORE_ADDR addr, int len, int is_insert,
7a6771
+				     CORE_ADDR addr, LONGEST len, int is_insert,
7a6771
 				     struct aarch64_debug_reg_state *state)
7a6771
 {
7a6771
   while (len > 0)
7a6771
@@ -517,9 +518,9 @@ aarch64_handle_unaligned_watchpoint (enu
7a6771
 		      "                             "
7a6771
 		      "aligned_addr: %s, aligned_len: %d\n"
7a6771
 		      "                                "
7a6771
-		      "next_addr: %s,    next_len: %d\n",
7a6771
+		      "next_addr: %s,    next_len: %s\n",
7a6771
 		      is_insert, core_addr_to_string_nz (aligned_addr),
7a6771
-		      aligned_len, core_addr_to_string_nz (addr), len);
7a6771
+		      aligned_len, core_addr_to_string_nz (addr), plongest (len));
7a6771
 
7a6771
       if (ret != 0)
7a6771
 	return ret;
7a6771
@@ -530,7 +531,7 @@ aarch64_handle_unaligned_watchpoint (enu
7a6771
 
7a6771
 int
7a6771
 aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
7a6771
-			   int len, int is_insert,
7a6771
+			   LONGEST len, int is_insert,
7a6771
 			   struct aarch64_debug_reg_state *state)
7a6771
 {
7a6771
   if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len))
7a6771
@@ -581,14 +582,14 @@ aarch64_linux_set_debug_regs (const stru
7a6771
 void
7a6771
 aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
7a6771
 			      const char *func, CORE_ADDR addr,
7a6771
-			      int len, enum target_hw_bp_type type)
7a6771
+			      LONGEST len, enum target_hw_bp_type type)
7a6771
 {
7a6771
   int i;
7a6771
 
7a6771
   debug_printf ("%s", func);
7a6771
   if (addr || len)
7a6771
-    debug_printf (" (addr=0x%08lx, len=%d, type=%s)",
7a6771
-		  (unsigned long) addr, len,
7a6771
+    debug_printf (" (addr=0x%08lx, len=%s, type=%s)",
7a6771
+		  (unsigned long) addr, plongest (len),
7a6771
 		  type == hw_write ? "hw-write-watchpoint"
7a6771
 		  : (type == hw_read ? "hw-read-watchpoint"
7a6771
 		     : (type == hw_access ? "hw-access-watchpoint"
7a6771
Index: gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.h
7a6771
===================================================================
7a6771
--- gdb-7.10.50.20151027.orig/gdb/nat/aarch64-linux-hw-point.h	2015-10-27 02:48:31.000000000 +0100
7a6771
+++ gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.h	2015-11-08 10:36:47.656170839 +0100
7a6771
@@ -168,7 +168,7 @@ int aarch64_handle_breakpoint (enum targ
7a6771
 			       int len, int is_insert,
7a6771
 			       struct aarch64_debug_reg_state *state);
7a6771
 int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
7a6771
-			       int len, int is_insert,
7a6771
+			       LONGEST len, int is_insert,
7a6771
 			       struct aarch64_debug_reg_state *state);
7a6771
 
7a6771
 void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
7a6771
@@ -176,7 +176,7 @@ void aarch64_linux_set_debug_regs (const
7a6771
 
7a6771
 void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
7a6771
 				   const char *func, CORE_ADDR addr,
7a6771
-				   int len, enum target_hw_bp_type type);
7a6771
+				   LONGEST len, enum target_hw_bp_type type);
7a6771
 
7a6771
 void aarch64_linux_get_debug_reg_capacity (int tid);
7a6771