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

861f93
http://sourceware.org/ml/gdb-patches/2012-09/msg00629.html
861f93
Subject: [PATCH 3/4] Expand watchpoint lengths to LONGEST
861f93
861f93
861f93
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
861f93
Content-Type: text/plain; charset=US-ASCII
861f93
Content-Transfer-Encoding: 7bit
861f93
Content-Disposition: inline
861f93
861f93
Hi,
861f93
861f93
This is part three of the bitpos expansion change.  Some architectures
861f93
allow arbitrary length watchpoints and combined with the fact that type
861f93
lengths could be large enough, we need LONGEST for watchpoint lengths.
861f93
It is architecture dependent however, whether the LONGEST is needed or
861f93
not.  This patch updates the signatures of watchpoint insertion and
861f93
removal functions of all architectures (to comply with the function
861f93
signatures in the callback struct), but expands types only in
861f93
architectures that need it.  Tested on Fedora 16 x86_64.
861f93
861f93
Regards,
861f93
Siddhesh
861f93
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
861f93
Content-Type: text/plain
861f93
Content-Transfer-Encoding: quoted-printable
861f93
Content-Disposition: attachment; filename=ChangeLog-wp
861f93
861f93
gdb/ChangeLog:
861f93
861f93
	* arm-linux-nat.c (arm_linux_insert_watchpoint): Expand
861f93
	parameter LEN to LONGEST.
861f93
	(arm_linux_remove_watchpoint): Likewise.
861f93
	(arm_linux_watchpoint_addr_within_range): Expand parameter
861f93
	LENGTH to LONGEST.
861f93
	* i386-nat.c (i386_insert_watchpoint): Expand parameter LEN to
861f93
	LONGEST.
861f93
	(i386_remove_watchpoint): Likewise.
861f93
	* ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise.
861f93
	(ia64_linux_remove_watchpoint): Likewise.
861f93
	* inf-ttrace.c (inf_ttrace_insert_watchpoint): Likewise.
861f93
	Expand NUM_PAGES, PAGE to LONGEST.
861f93
	(inf_ttrace_remove_watchpoint): Likewise.
861f93
	* mips-linux-nat.c (mips_linux_insert_watchpoint): Expand
861f93
	parameter LEN to LONGEST.
861f93
	(mips_linux_remove_watchpoint): Likewise.
861f93
	* nto-procfs.c (procfs_remove_hw_watchpoint): Likewise.
861f93
	(procfs_insert_hw_watchpoint): Likewise.
861f93
	* ppc-linux-nat.c (calculate_dvc): Likewise.  Expand I,
861f93
	NUM_BYTE_ENABLE to LONGEST.
861f93
	(check_condition): Expand parameter LEN to point to LONGEST.
861f93
	(ppc_linux_can_accel_watchpoint_condition): Expand parameter
861f93
	LEN to LONGEST.
861f93
	(create_watchpoint_request): Likewise.
861f93
	(ppc_linux_insert_watchpoint): Likewise.
861f93
	(ppc_linux_remove_watchpoint): Likewise.
861f93
	(ppc_linux_watchpoint_addr_within_range): Expand parameter
861f93
	LENGTH to LONGEST.
861f93
	* procfs.c (proc_set_watchpoint): Expand parameter LEN to
861f93
	LONGEST.
861f93
	(procfs_set_watchpoint): Likewise.
861f93
	(procfs_insert_watchpoint): Likewise.
861f93
	(procfs_remove_watchpoint): Likewise.
861f93
	* remote-m32r-sdi.c (m32r_insert_watchpoint): Likewise.  Use
861f93
	plongest to format print LEN.
861f93
	(m32r_remove_watchpoint): Likewise.
861f93
	* remote-mips.c (mips_insert_watchpoint): Expand parameter LEN
861f93
	to LONGEST.
861f93
	(mips_remove_watchpoint): Likewise.
861f93
	* remote.c (remote_insert_watchpoint): Likewise.
861f93
	Use phex_nz to format print LEN.
861f93
	(remote_remove_watchpoint): Likewise.
861f93
	(remote_watchpoint_addr_within_range): Expand parameter LENGTH
861f93
	to LONGEST.
861f93
	* s390-nat.c (s390_insert_watchpoint): Expand parameter LEN to
861f93
	LONGEST.
861f93
	(s390_remove_watchpoint): Likewise.
861f93
	* target.c (update_current_target): Expand parameter LEN for
861f93
	callbacks to TO_INSERT_WATCHPOINT, TO_REMOVE_WATCHPOINT,
861f93
	TO_CAN_ACCEL_WATCHPOINT_CONDITION, to LONGEST.
861f93
	(default_watchpoint_addr_within_range): Expand parameter
861f93
	LENGTH to LONGEST.
861f93
	(debug_to_can_accel_watchpoint_condition): Expand parameter LEN
861f93
	to LONGEST.  Use plongest to format print LEN.
861f93
	(debug_to_watchpoint_addr_within_range): Expand parameter LENGTH
861f93
	to LONGEST.  Use plongest to format print LENGTH.
861f93
	(debug_to_insert_watchpoint): Expand parameter LEN to LONGEST.
861f93
	Use plongest to format print LEN.
861f93
	(debug_to_remove_watchpoint): Likewise.
861f93
	* target.h (struct target_ops): Expand parameter LEN of
861f93
	TO_REMOVE_WATCHPOINT, TO_INSERT_WATCHPOINT,
861f93
	TO_WATCHPOINT_ADDR_WITHIN_RANGE and
861f93
	TO_CAN_ACCEL_WATCHPOINT_CONDITION to LONGEST.
861f93
861f93
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
861f93
Content-Type: text/x-patch
861f93
Content-Transfer-Encoding: 7bit
861f93
Content-Disposition: attachment; filename=bitpos-wp.patch
861f93
861f93
Index: gdb-7.5.50.20130215/gdb/arm-linux-nat.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/arm-linux-nat.c	2013-02-15 22:40:18.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/arm-linux-nat.c	2013-02-15 22:42:45.988804306 +0100
861f93
@@ -1105,7 +1105,7 @@ arm_linux_region_ok_for_hw_watchpoint (C
861f93
 
861f93
 /* Insert a Hardware breakpoint.  */
861f93
 static int
861f93
-arm_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw,
861f93
+arm_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw,
861f93
 			     struct expression *cond)
861f93
 {
861f93
   struct lwp_info *lp;
861f93
@@ -1123,7 +1123,7 @@ arm_linux_insert_watchpoint (CORE_ADDR a
861f93
 
861f93
 /* Remove a hardware breakpoint.  */
861f93
 static int
861f93
-arm_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw,
861f93
+arm_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int rw,
861f93
 			     struct expression *cond)
861f93
 {
861f93
   struct lwp_info *lp;
861f93
@@ -1180,7 +1180,7 @@ arm_linux_stopped_by_watchpoint (void)
861f93
 static int
861f93
 arm_linux_watchpoint_addr_within_range (struct target_ops *target,
861f93
 					CORE_ADDR addr,
861f93
-					CORE_ADDR start, int length)
861f93
+					CORE_ADDR start, LONGEST length)
861f93
 {
861f93
   return start <= addr && start + length - 1 >= addr;
861f93
 }
861f93
Index: gdb-7.5.50.20130215/gdb/i386-nat.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/i386-nat.c	2013-02-15 22:41:53.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/i386-nat.c	2013-02-15 22:43:14.005838741 +0100
861f93
@@ -589,7 +589,7 @@ i386_update_inferior_debug_regs (struct
861f93
    of the type TYPE.  Return 0 on success, -1 on failure.  */
861f93
 
861f93
 static int
861f93
-i386_insert_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+i386_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			struct expression *cond)
861f93
 {
861f93
   struct i386_debug_reg_state *state
861f93
@@ -627,7 +627,7 @@ i386_insert_watchpoint (CORE_ADDR addr,
861f93
    address ADDR, whose length is LEN bytes, and for accesses of the
861f93
    type TYPE.  Return 0 on success, -1 on failure.  */
861f93
 static int
861f93
-i386_remove_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+i386_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			struct expression *cond)
861f93
 {
861f93
   struct i386_debug_reg_state *state
861f93
Index: gdb-7.5.50.20130215/gdb/ia64-linux-nat.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/ia64-linux-nat.c	2013-02-15 22:34:18.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/ia64-linux-nat.c	2013-02-15 22:42:45.989804309 +0100
861f93
@@ -542,7 +542,7 @@ is_power_of_2 (int val)
861f93
 }
861f93
 
861f93
 static int
861f93
-ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw,
861f93
+ia64_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw,
861f93
 			      struct expression *cond)
861f93
 {
861f93
   struct lwp_info *lp;
861f93
@@ -596,7 +596,7 @@ ia64_linux_insert_watchpoint (CORE_ADDR
861f93
 }
861f93
 
861f93
 static int
861f93
-ia64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+ia64_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			      struct expression *cond)
861f93
 {
861f93
   int idx;
861f93
Index: gdb-7.5.50.20130215/gdb/inf-ttrace.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/inf-ttrace.c	2013-02-15 22:40:18.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/inf-ttrace.c	2013-02-15 22:42:45.989804309 +0100
861f93
@@ -313,14 +313,14 @@ inf_ttrace_disable_page_protections (pid
861f93
    type TYPE.  */
861f93
 
861f93
 static int
861f93
-inf_ttrace_insert_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+inf_ttrace_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			      struct expression *cond)
861f93
 {
861f93
   const int pagesize = inf_ttrace_page_dict.pagesize;
861f93
   pid_t pid = ptid_get_pid (inferior_ptid);
861f93
   CORE_ADDR page_addr;
861f93
-  int num_pages;
861f93
-  int page;
861f93
+  LONGEST num_pages;
861f93
+  LONGEST page;
861f93
 
861f93
   gdb_assert (type == hw_write);
861f93
 
861f93
@@ -337,14 +337,14 @@ inf_ttrace_insert_watchpoint (CORE_ADDR
861f93
    type TYPE.  */
861f93
 
861f93
 static int
861f93
-inf_ttrace_remove_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+inf_ttrace_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			      struct expression *cond)
861f93
 {
861f93
   const int pagesize = inf_ttrace_page_dict.pagesize;
861f93
   pid_t pid = ptid_get_pid (inferior_ptid);
861f93
   CORE_ADDR page_addr;
861f93
-  int num_pages;
861f93
-  int page;
861f93
+  LONGEST num_pages;
861f93
+  LONGEST page;
861f93
 
861f93
   gdb_assert (type == hw_write);
861f93
 
861f93
Index: gdb-7.5.50.20130215/gdb/mips-linux-nat.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/mips-linux-nat.c	2013-02-15 22:40:18.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/mips-linux-nat.c	2013-02-15 22:42:45.990804311 +0100
861f93
@@ -1017,7 +1017,7 @@ populate_regs_from_watches (struct pt_wa
861f93
    watch.  Return zero on success.  */
861f93
 
861f93
 static int
861f93
-mips_linux_insert_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+mips_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			      struct expression *cond)
861f93
 {
861f93
   struct pt_watch_regs regs;
861f93
@@ -1067,7 +1067,7 @@ mips_linux_insert_watchpoint (CORE_ADDR
861f93
    Return zero on success.  */
861f93
 
861f93
 static int
861f93
-mips_linux_remove_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+mips_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			      struct expression *cond)
861f93
 {
861f93
   int retval;
861f93
Index: gdb-7.5.50.20130215/gdb/nto-procfs.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/nto-procfs.c	2013-01-01 07:32:47.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/nto-procfs.c	2013-02-15 22:42:45.990804311 +0100
861f93
@@ -69,10 +69,10 @@ static ptid_t do_attach (ptid_t ptid);
861f93
 
861f93
 static int procfs_can_use_hw_breakpoint (int, int, int);
861f93
 
861f93
-static int procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+static int procfs_insert_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 					struct expression *cond);
861f93
 
861f93
-static int procfs_remove_hw_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+static int procfs_remove_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 					struct expression *cond);
861f93
 
861f93
 static int procfs_stopped_by_watchpoint (void);
861f93
@@ -1493,14 +1493,14 @@ procfs_can_use_hw_breakpoint (int type,
861f93
 }
861f93
 
861f93
 static int
861f93
-procfs_remove_hw_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+procfs_remove_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			     struct expression *cond)
861f93
 {
861f93
   return procfs_hw_watchpoint (addr, -1, type);
861f93
 }
861f93
 
861f93
 static int
861f93
-procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+procfs_insert_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			     struct expression *cond)
861f93
 {
861f93
   return procfs_hw_watchpoint (addr, len, type);
861f93
Index: gdb-7.5.50.20130215/gdb/ppc-linux-nat.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/ppc-linux-nat.c	2013-02-15 22:40:18.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/ppc-linux-nat.c	2013-02-15 22:42:45.991804313 +0100
861f93
@@ -1838,11 +1838,11 @@ can_use_watchpoint_cond_accel (void)
861f93
    CONDITION_VALUE will hold the value which should be put in the
861f93
    DVC register.  */
861f93
 static void
861f93
-calculate_dvc (CORE_ADDR addr, int len, CORE_ADDR data_value,
861f93
+calculate_dvc (CORE_ADDR addr, LONGEST len, CORE_ADDR data_value,
861f93
 	       uint32_t *condition_mode, uint64_t *condition_value)
861f93
 {
861f93
-  int i, num_byte_enable, align_offset, num_bytes_off_dvc,
861f93
-      rightmost_enabled_byte;
861f93
+  LONGEST i, num_byte_enable;
861f93
+  int align_offset, num_bytes_off_dvc, rightmost_enabled_byte;
861f93
   CORE_ADDR addr_end_data, addr_end_dvc;
861f93
 
861f93
   /* The DVC register compares bytes within fixed-length windows which
861f93
@@ -1929,7 +1929,7 @@ num_memory_accesses (struct value *v)
861f93
    of the constant.  */
861f93
 static int
861f93
 check_condition (CORE_ADDR watch_addr, struct expression *cond,
861f93
-		 CORE_ADDR *data_value, int *len)
861f93
+		 CORE_ADDR *data_value, LONGEST *len)
861f93
 {
861f93
   int pc = 1, num_accesses_left, num_accesses_right;
861f93
   struct value *left_val, *right_val, *left_chain, *right_chain;
861f93
@@ -1996,7 +1996,7 @@ check_condition (CORE_ADDR watch_addr, s
861f93
    the condition expression, thus only triggering the watchpoint when it is
861f93
    true.  */
861f93
 static int
861f93
-ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw,
861f93
+ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, LONGEST len, int rw,
861f93
 					  struct expression *cond)
861f93
 {
861f93
   CORE_ADDR data_value;
861f93
@@ -2013,7 +2013,7 @@ ppc_linux_can_accel_watchpoint_condition
861f93
 
861f93
 static void
861f93
 create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr,
861f93
-			   int len, int rw, struct expression *cond,
861f93
+			   LONGEST len, int rw, struct expression *cond,
861f93
 			   int insert)
861f93
 {
861f93
   if (len == 1
861f93
@@ -2058,7 +2058,7 @@ create_watchpoint_request (struct ppc_hw
861f93
 }
861f93
 
861f93
 static int
861f93
-ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw,
861f93
+ppc_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw,
861f93
 			     struct expression *cond)
861f93
 {
861f93
   struct lwp_info *lp;
861f93
@@ -2126,7 +2126,7 @@ ppc_linux_insert_watchpoint (CORE_ADDR a
861f93
 }
861f93
 
861f93
 static int
861f93
-ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw,
861f93
+ppc_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int rw,
861f93
 			     struct expression *cond)
861f93
 {
861f93
   struct lwp_info *lp;
861f93
@@ -2266,7 +2266,7 @@ ppc_linux_stopped_by_watchpoint (void)
861f93
 static int
861f93
 ppc_linux_watchpoint_addr_within_range (struct target_ops *target,
861f93
 					CORE_ADDR addr,
861f93
-					CORE_ADDR start, int length)
861f93
+					CORE_ADDR start, LONGEST length)
861f93
 {
861f93
   int mask;
861f93
 
861f93
Index: gdb-7.5.50.20130215/gdb/procfs.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/procfs.c	2013-02-15 22:40:18.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/procfs.c	2013-02-15 22:42:45.992804315 +0100
861f93
@@ -2433,7 +2433,7 @@ procfs_address_to_host_pointer (CORE_ADD
861f93
 #endif
861f93
 
861f93
 static int
861f93
-proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags)
861f93
+proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, LONGEST len, int wflags)
861f93
 {
861f93
 #if !defined (PCWATCH) && !defined (PIOCSWATCH)
861f93
   /* If neither or these is defined, we can't support watchpoints.
861f93
@@ -4777,7 +4777,7 @@ procfs_pid_to_str (struct target_ops *op
861f93
 /* Insert a watchpoint.  */
861f93
 
861f93
 static int
861f93
-procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
861f93
+procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, LONGEST len, int rwflag,
861f93
 		       int after)
861f93
 {
861f93
 #ifndef AIX5
861f93
@@ -4897,7 +4897,7 @@ procfs_stopped_data_address (struct targ
861f93
 }
861f93
 
861f93
 static int
861f93
-procfs_insert_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+procfs_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			  struct expression *cond)
861f93
 {
861f93
   if (!target_have_steppable_watchpoint
861f93
@@ -4919,7 +4919,7 @@ procfs_insert_watchpoint (CORE_ADDR addr
861f93
 }
861f93
 
861f93
 static int
861f93
-procfs_remove_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+procfs_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			  struct expression *cond)
861f93
 {
861f93
   return procfs_set_watchpoint (inferior_ptid, addr, 0, 0, 0);
861f93
Index: gdb-7.5.50.20130215/gdb/remote-m32r-sdi.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/remote-m32r-sdi.c	2013-01-01 07:32:50.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/remote-m32r-sdi.c	2013-02-15 22:42:45.993804317 +0100
861f93
@@ -1417,14 +1417,15 @@ m32r_can_use_hw_watchpoint (int type, in
861f93
    watchpoint.  */
861f93
 
861f93
 static int
861f93
-m32r_insert_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+m32r_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			struct expression *cond)
861f93
 {
861f93
   int i;
861f93
 
861f93
   if (remote_debug)
861f93
-    fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%d,%d)\n",
861f93
-			paddress (target_gdbarch (), addr), len, type);
861f93
+    fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%s,%d)\n",
861f93
+			paddress (target_gdbarch (), addr), plongest (len),
861f93
+			type);
861f93
 
861f93
   for (i = 0; i < MAX_ACCESS_BREAKS; i++)
861f93
     {
861f93
@@ -1442,14 +1443,15 @@ m32r_insert_watchpoint (CORE_ADDR addr,
861f93
 }
861f93
 
861f93
 static int
861f93
-m32r_remove_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+m32r_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			struct expression *cond)
861f93
 {
861f93
   int i;
861f93
 
861f93
   if (remote_debug)
861f93
-    fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%d,%d)\n",
861f93
-			paddress (target_gdbarch (), addr), len, type);
861f93
+    fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%s,%d)\n",
861f93
+			paddress (target_gdbarch (), addr), plongest (len),
861f93
+			type);
861f93
 
861f93
   for (i = 0; i < MAX_ACCESS_BREAKS; i++)
861f93
     {
861f93
Index: gdb-7.5.50.20130215/gdb/remote-mips.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/remote-mips.c	2013-01-01 07:32:50.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/remote-mips.c	2013-02-15 22:42:45.994804319 +0100
861f93
@@ -2419,7 +2419,7 @@ calculate_mask (CORE_ADDR addr, int len)
861f93
    watchpoint.  */
861f93
 
861f93
 static int
861f93
-mips_insert_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+mips_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			struct expression *cond)
861f93
 {
861f93
   if (mips_set_breakpoint (addr, len, type))
861f93
@@ -2431,7 +2431,7 @@ mips_insert_watchpoint (CORE_ADDR addr,
861f93
 /* Remove a watchpoint.  */
861f93
 
861f93
 static int
861f93
-mips_remove_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+mips_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			struct expression *cond)
861f93
 {
861f93
   if (mips_clear_breakpoint (addr, len, type))
861f93
Index: gdb-7.5.50.20130215/gdb/remote.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/remote.c	2013-02-15 22:40:18.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/remote.c	2013-02-15 22:42:45.996804323 +0100
861f93
@@ -8155,7 +8155,7 @@ watchpoint_to_Z_packet (int type)
861f93
 }
861f93
 
861f93
 static int
861f93
-remote_insert_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+remote_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			  struct expression *cond)
861f93
 {
861f93
   struct remote_state *rs = get_remote_state ();
861f93
@@ -8170,7 +8170,7 @@ remote_insert_watchpoint (CORE_ADDR addr
861f93
   p = strchr (rs->buf, '\0');
861f93
   addr = remote_address_masked (addr);
861f93
   p += hexnumstr (p, (ULONGEST) addr);
861f93
-  xsnprintf (p, endbuf - p, ",%x", len);
861f93
+  xsnprintf (p, endbuf - p, ",%s", phex_nz (len, sizeof (len)));
861f93
 
861f93
   putpkt (rs->buf);
861f93
   getpkt (&rs->buf, &rs->buf_size, 0);
861f93
@@ -8190,7 +8190,7 @@ remote_insert_watchpoint (CORE_ADDR addr
861f93
 
861f93
 static int
861f93
 remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr,
861f93
-				     CORE_ADDR start, int length)
861f93
+				     CORE_ADDR start, LONGEST length)
861f93
 {
861f93
   CORE_ADDR diff = remote_address_masked (addr - start);
861f93
 
861f93
@@ -8199,7 +8199,7 @@ remote_watchpoint_addr_within_range (str
861f93
 
861f93
 
861f93
 static int
861f93
-remote_remove_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+remote_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			  struct expression *cond)
861f93
 {
861f93
   struct remote_state *rs = get_remote_state ();
861f93
@@ -8214,7 +8214,7 @@ remote_remove_watchpoint (CORE_ADDR addr
861f93
   p = strchr (rs->buf, '\0');
861f93
   addr = remote_address_masked (addr);
861f93
   p += hexnumstr (p, (ULONGEST) addr);
861f93
-  xsnprintf (p, endbuf - p, ",%x", len);
861f93
+  xsnprintf (p, endbuf - p, ",%s", phex_nz (len, sizeof (len)));
861f93
   putpkt (rs->buf);
861f93
   getpkt (&rs->buf, &rs->buf_size, 0);
861f93
 
861f93
Index: gdb-7.5.50.20130215/gdb/s390-nat.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/s390-nat.c	2013-02-15 22:40:18.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/s390-nat.c	2013-02-15 22:42:45.997804325 +0100
861f93
@@ -516,7 +516,7 @@ s390_fix_watch_points (struct lwp_info *
861f93
 }
861f93
 
861f93
 static int
861f93
-s390_insert_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+s390_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			struct expression *cond)
861f93
 {
861f93
   struct lwp_info *lp;
861f93
@@ -537,7 +537,7 @@ s390_insert_watchpoint (CORE_ADDR addr,
861f93
 }
861f93
 
861f93
 static int
861f93
-s390_remove_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+s390_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			struct expression *cond)
861f93
 {
861f93
   struct lwp_info *lp;
861f93
Index: gdb-7.5.50.20130215/gdb/target.c
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/target.c	2013-02-15 22:40:18.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/target.c	2013-02-15 22:42:45.997804325 +0100
861f93
@@ -49,7 +49,8 @@ static void target_info (char *, int);
861f93
 static void default_terminal_info (char *, int);
861f93
 
861f93
 static int default_watchpoint_addr_within_range (struct target_ops *,
861f93
-						 CORE_ADDR, CORE_ADDR, int);
861f93
+						 CORE_ADDR, CORE_ADDR,
861f93
+						 LONGEST);
861f93
 
861f93
 static int default_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST);
861f93
 
861f93
@@ -114,10 +115,10 @@ static int debug_to_insert_hw_breakpoint
861f93
 static int debug_to_remove_hw_breakpoint (struct gdbarch *,
861f93
 					  struct bp_target_info *);
861f93
 
861f93
-static int debug_to_insert_watchpoint (CORE_ADDR, int, int,
861f93
+static int debug_to_insert_watchpoint (CORE_ADDR, LONGEST, int,
861f93
 				       struct expression *);
861f93
 
861f93
-static int debug_to_remove_watchpoint (CORE_ADDR, int, int,
861f93
+static int debug_to_remove_watchpoint (CORE_ADDR, LONGEST, int,
861f93
 				       struct expression *);
861f93
 
861f93
 static int debug_to_stopped_by_watchpoint (void);
861f93
@@ -125,11 +126,12 @@ static int debug_to_stopped_by_watchpoin
861f93
 static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *);
861f93
 
861f93
 static int debug_to_watchpoint_addr_within_range (struct target_ops *,
861f93
-						  CORE_ADDR, CORE_ADDR, int);
861f93
+						  CORE_ADDR, CORE_ADDR,
861f93
+						  LONGEST);
861f93
 
861f93
 static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST);
861f93
 
861f93
-static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, int, int,
861f93
+static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, LONGEST, int,
861f93
 						    struct expression *);
861f93
 
861f93
 static void debug_to_terminal_init (void);
861f93
@@ -751,10 +753,10 @@ update_current_target (void)
861f93
 	    (int (*) (struct gdbarch *, struct bp_target_info *))
861f93
 	    return_minus_one);
861f93
   de_fault (to_insert_watchpoint,
861f93
-	    (int (*) (CORE_ADDR, int, int, struct expression *))
861f93
+	    (int (*) (CORE_ADDR, LONGEST, int, struct expression *))
861f93
 	    return_minus_one);
861f93
   de_fault (to_remove_watchpoint,
861f93
-	    (int (*) (CORE_ADDR, int, int, struct expression *))
861f93
+	    (int (*) (CORE_ADDR, LONGEST, int, struct expression *))
861f93
 	    return_minus_one);
861f93
   de_fault (to_stopped_by_watchpoint,
861f93
 	    (int (*) (void))
861f93
@@ -767,7 +769,7 @@ update_current_target (void)
861f93
   de_fault (to_region_ok_for_hw_watchpoint,
861f93
 	    default_region_ok_for_hw_watchpoint);
861f93
   de_fault (to_can_accel_watchpoint_condition,
861f93
-            (int (*) (CORE_ADDR, int, int, struct expression *))
861f93
+            (int (*) (CORE_ADDR, LONGEST, int, struct expression *))
861f93
             return_zero);
861f93
   de_fault (to_terminal_init,
861f93
 	    (void (*) (void))
861f93
@@ -3558,7 +3560,7 @@ default_region_ok_for_hw_watchpoint (COR
861f93
 static int
861f93
 default_watchpoint_addr_within_range (struct target_ops *target,
861f93
 				      CORE_ADDR addr,
861f93
-				      CORE_ADDR start, int length)
861f93
+				      CORE_ADDR start, LONGEST length)
861f93
 {
861f93
   return addr >= start && addr < start + length;
861f93
 }
861f93
@@ -4265,7 +4267,7 @@ debug_to_region_ok_for_hw_watchpoint (CO
861f93
 }
861f93
 
861f93
 static int
861f93
-debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw,
861f93
+debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, LONGEST len, int rw,
861f93
 					 struct expression *cond)
861f93
 {
861f93
   int retval;
861f93
@@ -4275,8 +4277,8 @@ debug_to_can_accel_watchpoint_condition
861f93
 
861f93
   fprintf_unfiltered (gdb_stdlog,
861f93
 		      "target_can_accel_watchpoint_condition "
861f93
-		      "(%s, %d, %d, %s) = %ld\n",
861f93
-		      core_addr_to_string (addr), len, rw,
861f93
+		      "(%s, %s, %d, %s) = %ld\n",
861f93
+		      core_addr_to_string (addr), plongest (len), rw,
861f93
 		      host_address_to_string (cond), (unsigned long) retval);
861f93
   return retval;
861f93
 }
861f93
@@ -4311,7 +4313,7 @@ debug_to_stopped_data_address (struct ta
861f93
 static int
861f93
 debug_to_watchpoint_addr_within_range (struct target_ops *target,
861f93
 				       CORE_ADDR addr,
861f93
-				       CORE_ADDR start, int length)
861f93
+				       CORE_ADDR start, LONGEST length)
861f93
 {
861f93
   int retval;
861f93
 
861f93
@@ -4319,9 +4321,9 @@ debug_to_watchpoint_addr_within_range (s
861f93
 							 start, length);
861f93
 
861f93
   fprintf_filtered (gdb_stdlog,
861f93
-		    "target_watchpoint_addr_within_range (%s, %s, %d) = %d\n",
861f93
+		    "target_watchpoint_addr_within_range (%s, %s, %s) = %d\n",
861f93
 		    core_addr_to_string (addr), core_addr_to_string (start),
861f93
-		    length, retval);
861f93
+		    plongest (length), retval);
861f93
   return retval;
861f93
 }
861f93
 
861f93
@@ -4356,7 +4358,7 @@ debug_to_remove_hw_breakpoint (struct gd
861f93
 }
861f93
 
861f93
 static int
861f93
-debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+debug_to_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			    struct expression *cond)
861f93
 {
861f93
   int retval;
861f93
@@ -4364,14 +4366,14 @@ debug_to_insert_watchpoint (CORE_ADDR ad
861f93
   retval = debug_target.to_insert_watchpoint (addr, len, type, cond);
861f93
 
861f93
   fprintf_unfiltered (gdb_stdlog,
861f93
-		      "target_insert_watchpoint (%s, %d, %d, %s) = %ld\n",
861f93
-		      core_addr_to_string (addr), len, type,
861f93
+		      "target_insert_watchpoint (%s, %s, %d, %s) = %ld\n",
861f93
+		      core_addr_to_string (addr), plongest (len), type,
861f93
 		      host_address_to_string (cond), (unsigned long) retval);
861f93
   return retval;
861f93
 }
861f93
 
861f93
 static int
861f93
-debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type,
861f93
+debug_to_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
861f93
 			    struct expression *cond)
861f93
 {
861f93
   int retval;
861f93
@@ -4379,8 +4381,8 @@ debug_to_remove_watchpoint (CORE_ADDR ad
861f93
   retval = debug_target.to_remove_watchpoint (addr, len, type, cond);
861f93
 
861f93
   fprintf_unfiltered (gdb_stdlog,
861f93
-		      "target_remove_watchpoint (%s, %d, %d, %s) = %ld\n",
861f93
-		      core_addr_to_string (addr), len, type,
861f93
+		      "target_remove_watchpoint (%s, %s, %d, %s) = %ld\n",
861f93
+		      core_addr_to_string (addr), plongest (len), type,
861f93
 		      host_address_to_string (cond), (unsigned long) retval);
861f93
   return retval;
861f93
 }
861f93
Index: gdb-7.5.50.20130215/gdb/target.h
861f93
===================================================================
861f93
--- gdb-7.5.50.20130215.orig/gdb/target.h	2013-02-15 22:40:18.000000000 +0100
861f93
+++ gdb-7.5.50.20130215/gdb/target.h	2013-02-15 22:42:45.998804328 +0100
861f93
@@ -466,8 +466,8 @@ struct target_ops
861f93
 
861f93
     /* Documentation of what the two routines below are expected to do is
861f93
        provided with the corresponding target_* macros.  */
861f93
-    int (*to_remove_watchpoint) (CORE_ADDR, int, int, struct expression *);
861f93
-    int (*to_insert_watchpoint) (CORE_ADDR, int, int, struct expression *);
861f93
+    int (*to_remove_watchpoint) (CORE_ADDR, LONGEST, int, struct expression *);
861f93
+    int (*to_insert_watchpoint) (CORE_ADDR, LONGEST, int, struct expression *);
861f93
 
861f93
     int (*to_insert_mask_watchpoint) (struct target_ops *,
861f93
 				      CORE_ADDR, CORE_ADDR, int);
861f93
@@ -478,13 +478,13 @@ struct target_ops
861f93
     int to_have_continuable_watchpoint;
861f93
     int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *);
861f93
     int (*to_watchpoint_addr_within_range) (struct target_ops *,
861f93
-					    CORE_ADDR, CORE_ADDR, int);
861f93
+					    CORE_ADDR, CORE_ADDR, LONGEST);
861f93
 
861f93
     /* Documentation of this routine is provided with the corresponding
861f93
        target_* macro.  */
861f93
     int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, LONGEST);
861f93
 
861f93
-    int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int,
861f93
+    int (*to_can_accel_watchpoint_condition) (CORE_ADDR, LONGEST, int,
861f93
 					      struct expression *);
861f93
     int (*to_masked_watch_num_registers) (struct target_ops *,
861f93
 					  CORE_ADDR, CORE_ADDR);