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