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

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