public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 4/4] Change 'len''s type from LONGEST to ULONGEST: gdbarch methods core_xfer_shared_libraries and core_xfer_shared_libraries_aix
  2014-01-08  7:29 [PATCH 0/4] Change 'len' of to_xfer_partial to ULONGEST Yao Qi
@ 2014-01-08  7:29 ` Yao Qi
  2014-01-08 12:35   ` Pedro Alves
  2014-01-08  7:29 ` [PATCH 1/4] Use target_xfer_partial_ftype for rs6000_xfer_shared_libraries Yao Qi
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Yao Qi @ 2014-01-08  7:29 UTC (permalink / raw)
  To: gdb-patches

This patch changes the type of 'len' from LONGEST to ULONGEST.  'len'
is the argument of gdbarch methods core_xfer_shared_libraries and
core_xfer_shared_libraries_aix.

gdb:

2014-01-08  Yao Qi  <yao@codesourcery.com>

	* gdbarch.sh (core_xfer_shared_libraries): Change its argument
	'len''s type to ULONGEST.
	(core_xfer_shared_libraries_aix): Likewise.
	* gdbarch.c, gdbarch.h: Reenerated.
	* i386-cygwin-tdep.c (windows_core_xfer_shared_libraries):
	Change type of 'len' to ULONGEST.
	* rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise.
	(rs6000_aix_core_xfer_shared_libraries_aix): Likewise.
---
 gdb/gdbarch.c          |    4 ++--
 gdb/gdbarch.h          |    8 ++++----
 gdb/gdbarch.sh         |    4 ++--
 gdb/i386-cygwin-tdep.c |    2 +-
 gdb/rs6000-aix-tdep.c  |    2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index a605c7d..f3c0ff1 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -3479,7 +3479,7 @@ gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch)
 }
 
 LONGEST
-gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
+gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
 {
   gdb_assert (gdbarch != NULL);
   gdb_assert (gdbarch->core_xfer_shared_libraries != NULL);
@@ -3503,7 +3503,7 @@ gdbarch_core_xfer_shared_libraries_aix_p (struct gdbarch *gdbarch)
 }
 
 LONGEST
-gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
+gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
 {
   gdb_assert (gdbarch != NULL);
   gdb_assert (gdbarch->core_xfer_shared_libraries_aix != NULL);
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index ccb7e96..6ff875e 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -761,8 +761,8 @@ extern void set_gdbarch_find_memory_regions (struct gdbarch *gdbarch, gdbarch_fi
 
 extern int gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch);
 
-typedef LONGEST (gdbarch_core_xfer_shared_libraries_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len);
-extern LONGEST gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len);
+typedef LONGEST (gdbarch_core_xfer_shared_libraries_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
+extern LONGEST gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
 extern void set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries);
 
 /* Read offset OFFSET of TARGET_OBJECT_LIBRARIES_AIX formatted shared
@@ -770,8 +770,8 @@ extern void set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb
 
 extern int gdbarch_core_xfer_shared_libraries_aix_p (struct gdbarch *gdbarch);
 
-typedef LONGEST (gdbarch_core_xfer_shared_libraries_aix_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len);
-extern LONGEST gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len);
+typedef LONGEST (gdbarch_core_xfer_shared_libraries_aix_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
+extern LONGEST gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
 extern void set_gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdbarch_core_xfer_shared_libraries_aix_ftype *core_xfer_shared_libraries_aix);
 
 /* How the core target converts a PTID from a core file to a string. */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index ecbede6..e2edabe 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -656,11 +656,11 @@ M:int:find_memory_regions:find_memory_region_ftype func, void *data:func, data
 
 # Read offset OFFSET of TARGET_OBJECT_LIBRARIES formatted shared libraries list from
 # core file into buffer READBUF with length LEN.
-M:LONGEST:core_xfer_shared_libraries:gdb_byte *readbuf, ULONGEST offset, LONGEST len:readbuf, offset, len
+M:LONGEST:core_xfer_shared_libraries:gdb_byte *readbuf, ULONGEST offset, ULONGEST len:readbuf, offset, len
 
 # Read offset OFFSET of TARGET_OBJECT_LIBRARIES_AIX formatted shared
 # libraries list from core file into buffer READBUF with length LEN.
-M:LONGEST:core_xfer_shared_libraries_aix:gdb_byte *readbuf, ULONGEST offset, LONGEST len:readbuf, offset, len
+M:LONGEST:core_xfer_shared_libraries_aix:gdb_byte *readbuf, ULONGEST offset, ULONGEST len:readbuf, offset, len
 
 # How the core target converts a PTID from a core file to a string.
 M:char *:core_pid_to_str:ptid_t ptid:ptid
diff --git a/gdb/i386-cygwin-tdep.c b/gdb/i386-cygwin-tdep.c
index 103762c..4b8a00d 100644
--- a/gdb/i386-cygwin-tdep.c
+++ b/gdb/i386-cygwin-tdep.c
@@ -171,7 +171,7 @@ out:
 static LONGEST
 windows_core_xfer_shared_libraries (struct gdbarch *gdbarch,
 				  gdb_byte *readbuf,
-				  ULONGEST offset, LONGEST len)
+				  ULONGEST offset, ULONGEST len)
 {
   struct obstack obstack;
   const char *buf;
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index ed13859..aeea3ed 100644
--- a/gdb/rs6000-aix-tdep.c
+++ b/gdb/rs6000-aix-tdep.c
@@ -1013,7 +1013,7 @@ static LONGEST
 rs6000_aix_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch,
 					   gdb_byte *readbuf,
 					   ULONGEST offset,
-					   LONGEST len)
+					   ULONGEST len)
 {
   struct bfd_section *ldinfo_sec;
   int ldinfo_size;
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/4] Change to_xfer_partial 'len' type to ULONGEST.
  2014-01-08  7:29 [PATCH 0/4] Change 'len' of to_xfer_partial to ULONGEST Yao Qi
                   ` (2 preceding siblings ...)
  2014-01-08  7:29 ` [PATCH 3/4] Change 'len' of linux_common_xfer_osdata to ULONGEST Yao Qi
@ 2014-01-08  7:29 ` Yao Qi
  2014-01-08 12:34   ` Pedro Alves
  2014-01-08 12:38 ` [PATCH 0/4] Change 'len' of to_xfer_partial " Pedro Alves
  4 siblings, 1 reply; 13+ messages in thread
From: Yao Qi @ 2014-01-08  7:29 UTC (permalink / raw)
  To: gdb-patches

This patch changes to_xfer_partial's len's type to ULONGEST, and
adjust its implementations.

gdb:

2014-01-08  Yao Qi  <yao@codesourcery.com>

	* target.h (target_xfer_partial_ftype): Update.
	(struct target_ops) <to_xfer_partial>: Change 'len' type to
	ULONGEST.
	* aix-thread.c (aix_thread_xfer_partial): Change type of
	argument 'len' to ULONGEST.
	* auxv.c (procfs_xfer_auxv): Likewise.
	(ld_so_xfer_auxv): Likewise.
	(memory_xfer_auxv): Likewise.
	* bfd-target.c (target_bfd_xfer_partial): Likewise.
	* bsd-kvm.c (bsd_kvm_xfer_partial): Likewise.
	* bsd-uthread.c (bsd_uthread_xfer_partial): Likewise.
	* corelow.c (core_xfer_partial): Likewise.
	* ctf.c (ctf_xfer_partial): Likewise.
	* darwin-nat.c (darwin_read_write_inferior): Likewise.  Use
	'%u'.
	(darwin_read_dyld_info): Likewise.
	(darwin_xfer_partial): Likewise.
	* exec.c (section_table_xfer_memory_partial): Likewise.
	(exec_xfer_partial): Likewise.
	* exec.h (section_table_xfer_memory_partial): Update
	declaration.
	* gnu-nat.c (gnu_xfer_memory): Likewise.  Call pulongest
	instead of plongest.
	(gnu_xfer_partial): Likewise.
	* ia64-hpux-nat.c (ia64_hpux_xfer_memory): Likewise.
	(ia64_hpux_xfer_solib_got): Likewise.
	(ia64_hpux_xfer_partial): Likewise.
	* ia64-linux-nat.c (ia64_linux_xfer_partial):
	* inf-ptrace.c (inf_ptrace_xfer_partial):
	* inf-ttrace.c (inf_ttrace_xfer_partial):
	* linux-nat.c (linux_xfer_siginfo): Likewise.
	(linux_nat_xfer_partial): Likewise.
	(spu_enumerate_spu_ids, linux_proc_xfer_spu): Likewise.
	(linux_nat_xfer_osdata, linux_xfer_partial): Likewise.
	* monitor.c (monitor_xfer_memory): Likewise.
	(monitor_xfer_partial): Likewise.
	* procfs.c (procfs_xfer_partial): Likewise.
	* record-full.c (record_full_xfer_partial): Likewise.
	(record_full_core_xfer_partial): Likewise.
	* remote-sim.c (gdbsim_xfer_memory): Likewise.  Call pulongest
	instead of plongest.
	(gdbsim_xfer_partial): Likewise.
	* remote.c (remote_xfer_partial): Likewise.
	* rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise.
	* rs6000-aix-tdep.h (rs6000_aix_ld_info_to_xml): Update
	declaration.
	* rs6000-nat.c (rs6000_xfer_partial): Likewise.
	(rs6000_xfer_shared_libraries): Likewise.
	* sol-thread.c (sol_thread_xfer_partial): Likewise.
	* sparc-nat.c (sparc_xfer_wcookie): Likewise.
	(sparc_xfer_partial): Likewise.
	* spu-linux-nat.c (spu_proc_xfer_spu): Likewise.
	(spu_xfer_partial): Likewise.
	* spu-multiarch.c (spu_xfer_partial): Likewise.
	* target.c (target_read_live_memory): Likewise.
	(memory_xfer_live_readonly_partial): Likewise.
	(memory_xfer_partial, memory_xfer_partial_1): Likewise.
	(target_xfer_partial, default_xfer_partial): Likewise.
	(current_xfer_partial): Likewise.
	* tracepoint.c (tfile_xfer_partial): Likewise.
	* windows-nat.c (windows_xfer_memory): Likewise.  Call
	pulongest instead of plongest.
	(windows_xfer_partial): Likewise.
	(windows_xfer_shared_libraries): Likewise.
---
 gdb/aix-thread.c      |    2 +-
 gdb/auxv.c            |   11 +++++++----
 gdb/bfd-target.c      |    2 +-
 gdb/bsd-kvm.c         |    2 +-
 gdb/bsd-uthread.c     |    2 +-
 gdb/corelow.c         |    2 +-
 gdb/ctf.c             |    2 +-
 gdb/darwin-nat.c      |   12 ++++++------
 gdb/exec.c            |    6 +++---
 gdb/exec.h            |    2 +-
 gdb/gnu-nat.c         |    8 ++++----
 gdb/ia64-hpux-nat.c   |    6 +++---
 gdb/ia64-linux-nat.c  |    2 +-
 gdb/inf-ptrace.c      |    2 +-
 gdb/inf-ttrace.c      |    2 +-
 gdb/linux-nat.c       |   12 ++++++------
 gdb/monitor.c         |    4 ++--
 gdb/procfs.c          |    2 +-
 gdb/record-full.c     |    4 ++--
 gdb/remote-sim.c      |   13 +++++++------
 gdb/remote.c          |    2 +-
 gdb/rs6000-aix-tdep.c |    2 +-
 gdb/rs6000-aix-tdep.h |    2 +-
 gdb/rs6000-nat.c      |    4 ++--
 gdb/sol-thread.c      |    2 +-
 gdb/sparc-nat.c       |    4 ++--
 gdb/spu-linux-nat.c   |    4 ++--
 gdb/spu-multiarch.c   |    2 +-
 gdb/target.c          |   16 ++++++++--------
 gdb/target.h          |    4 ++--
 gdb/tracepoint.c      |    2 +-
 gdb/windows-nat.c     |   10 +++++-----
 32 files changed, 78 insertions(+), 74 deletions(-)

diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 20c7872..d6f9f7b 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1686,7 +1686,7 @@ static LONGEST
 aix_thread_xfer_partial (struct target_ops *ops, enum target_object object,
 			 const char *annex, gdb_byte *readbuf,
 			 const gdb_byte *writebuf,
-			 ULONGEST offset, LONGEST len)
+			 ULONGEST offset, ULONGEST len)
 {
   struct cleanup *old_chain = save_inferior_ptid ();
   LONGEST xfer;
diff --git a/gdb/auxv.c b/gdb/auxv.c
index b08f1d5..e475bfe 100644
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -42,7 +42,7 @@ static LONGEST
 procfs_xfer_auxv (gdb_byte *readbuf,
 		  const gdb_byte *writebuf,
 		  ULONGEST offset,
-		  LONGEST len)
+		  ULONGEST len)
 {
   char *pathname;
   int fd;
@@ -73,7 +73,7 @@ static LONGEST
 ld_so_xfer_auxv (gdb_byte *readbuf,
 		 const gdb_byte *writebuf,
 		 ULONGEST offset,
-		 LONGEST len)
+		 ULONGEST len)
 {
   struct minimal_symbol *msym;
   CORE_ADDR data_address, pointer_address;
@@ -178,7 +178,10 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
 	}
 
       data_address += block;
-      len -= block;
+      if (len < block)
+	len = 0;
+      else
+	len -= block;
 
       /* Check terminal AT_NULL.  This function is being called
          indefinitely being extended its READBUF until it returns EOF
@@ -209,7 +212,7 @@ memory_xfer_auxv (struct target_ops *ops,
 		  gdb_byte *readbuf,
 		  const gdb_byte *writebuf,
 		  ULONGEST offset,
-		  LONGEST len)
+		  ULONGEST len)
 {
   gdb_assert (object == TARGET_OBJECT_AUXV);
   gdb_assert (readbuf || writebuf);
diff --git a/gdb/bfd-target.c b/gdb/bfd-target.c
index 4cbac20..09b6c8c 100644
--- a/gdb/bfd-target.c
+++ b/gdb/bfd-target.c
@@ -41,7 +41,7 @@ target_bfd_xfer_partial (struct target_ops *ops,
 			 enum target_object object,
 			 const char *annex, gdb_byte *readbuf,
 			 const gdb_byte *writebuf,
-			 ULONGEST offset, LONGEST len)
+			 ULONGEST offset, ULONGEST len)
 {
   switch (object)
     {
diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c
index aade96e..20d6a1c 100644
--- a/gdb/bsd-kvm.c
+++ b/gdb/bsd-kvm.c
@@ -134,7 +134,7 @@ static LONGEST
 bsd_kvm_xfer_partial (struct target_ops *ops, enum target_object object,
 		      const char *annex, gdb_byte *readbuf,
 		      const gdb_byte *writebuf,
-		      ULONGEST offset, LONGEST len)
+		      ULONGEST offset, ULONGEST len)
 {
   switch (object)
     {
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index 5757e77..088c540 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -338,7 +338,7 @@ static LONGEST
 bsd_uthread_xfer_partial (struct target_ops *ops, enum target_object object,
 			  const char *annex, gdb_byte *readbuf,
 			  const gdb_byte *writebuf,
-			  ULONGEST offset, LONGEST len)
+			  ULONGEST offset, ULONGEST len)
 {
   gdb_assert (ops->beneath->to_xfer_partial);
   return ops->beneath->to_xfer_partial (ops->beneath, object, annex, readbuf,
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 7183f62..91c75f9 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -676,7 +676,7 @@ static LONGEST
 core_xfer_partial (struct target_ops *ops, enum target_object object,
 		   const char *annex, gdb_byte *readbuf,
 		   const gdb_byte *writebuf, ULONGEST offset,
-		   LONGEST len)
+		   ULONGEST len)
 {
   switch (object)
     {
diff --git a/gdb/ctf.c b/gdb/ctf.c
index f4aa657..a22937f 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -1349,7 +1349,7 @@ static LONGEST
 ctf_xfer_partial (struct target_ops *ops, enum target_object object,
 		  const char *annex, gdb_byte *readbuf,
 		  const gdb_byte *writebuf, ULONGEST offset,
-		  LONGEST len)
+		  ULONGEST len)
 {
   /* We're only doing regular memory for now.  */
   if (object != TARGET_OBJECT_MEMORY)
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index a21bb0f..999146b 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -1760,7 +1760,7 @@ darwin_thread_alive (struct target_ops *ops, ptid_t ptid)
 static int
 darwin_read_write_inferior (task_t task, CORE_ADDR addr,
 			    gdb_byte *rdaddr, const gdb_byte *wraddr,
-			    int length)
+			    ULONGEST length)
 {
   kern_return_t kret;
   mach_vm_address_t offset = addr & (mach_page_size - 1);
@@ -1772,7 +1772,7 @@ darwin_read_write_inferior (task_t task, CORE_ADDR addr,
   mach_vm_address_t region_address;
   mach_vm_size_t region_length;
 
-  inferior_debug (8, _("darwin_read_write_inferior(task=0x%x, %s, len=%d)\n"),
+  inferior_debug (8, _("darwin_read_write_inferior(task=0x%x, %s, len=%u)\n"),
 		  task, core_addr_to_string (addr), length);
 
   /* Get memory from inferior with page aligned addresses.  */
@@ -1894,7 +1894,7 @@ out:
 /* This is not available in Darwin 9.  */
 static int
 darwin_read_dyld_info (task_t task, CORE_ADDR addr, gdb_byte *rdaddr,
-		       int length)
+		       ULONGEST length)
 {
   struct task_dyld_info task_dyld_info;
   mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT;
@@ -1922,13 +1922,13 @@ static LONGEST
 darwin_xfer_partial (struct target_ops *ops,
 		     enum target_object object, const char *annex,
 		     gdb_byte *readbuf, const gdb_byte *writebuf,
-		     ULONGEST offset, LONGEST len)
+		     ULONGEST offset, ULONGEST len)
 {
   struct inferior *inf = current_inferior ();
 
   inferior_debug
-    (8, _("darwin_xfer_partial(%s, %d, rbuf=%s, wbuf=%s) pid=%u\n"),
-     core_addr_to_string (offset), (int)len,
+    (8, _("darwin_xfer_partial(%s, %s, rbuf=%s, wbuf=%s) pid=%u\n"),
+     core_addr_to_string (offset), pulongest (len),
      host_address_to_string (readbuf), host_address_to_string (writebuf),
      inf->pid);
 
diff --git a/gdb/exec.c b/gdb/exec.c
index 2d2949f..809a0b2 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -568,7 +568,7 @@ section_table_available_memory (VEC(mem_range_s) *memory,
 
 int
 section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
-				   ULONGEST offset, LONGEST len,
+				   ULONGEST offset, ULONGEST len,
 				   struct target_section *sections,
 				   struct target_section *sections_end,
 				   const char *section_name)
@@ -578,7 +578,7 @@ section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
   ULONGEST memaddr = offset;
   ULONGEST memend = memaddr + len;
 
-  if (len <= 0)
+  if (len == 0)
     internal_error (__FILE__, __LINE__,
 		    _("failed internal consistency check"));
 
@@ -639,7 +639,7 @@ static LONGEST
 exec_xfer_partial (struct target_ops *ops, enum target_object object,
 		   const char *annex, gdb_byte *readbuf,
 		   const gdb_byte *writebuf,
-		   ULONGEST offset, LONGEST len)
+		   ULONGEST offset, ULONGEST len)
 {
   struct target_section_table *table = target_get_section_table (ops);
 
diff --git a/gdb/exec.h b/gdb/exec.h
index 4c9d624..dbe5ea7 100644
--- a/gdb/exec.h
+++ b/gdb/exec.h
@@ -75,7 +75,7 @@ extern VEC(mem_range_s) *
    One, and only one, of readbuf or writebuf must be non-NULL.  */
 
 extern int section_table_xfer_memory_partial (gdb_byte *, const gdb_byte *,
-					      ULONGEST, LONGEST,
+					      ULONGEST, ULONGEST,
 					      struct target_section *,
 					      struct target_section *,
 					      const char *);
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 3da27d3..ca61c11 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2477,7 +2477,7 @@ out:
 
 static LONGEST
 gnu_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
-		 CORE_ADDR memaddr, LONGEST len)
+		 CORE_ADDR memaddr, ULONGEST len)
 {
   task_t task = (gnu_current_inf
 		 ? (gnu_current_inf->task
@@ -2491,14 +2491,14 @@ gnu_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
   if (writebuf != NULL)
     {
       inf_debug (gnu_current_inf, "writing %s[%s] <-- %s",
-		 paddress (target_gdbarch (), memaddr), plongest (len),
+		 paddress (target_gdbarch (), memaddr), pulongest (len),
 		 host_address_to_string (writebuf));
       res = gnu_write_inferior (task, memaddr, writebuf, len);
     }
   else
     {
       inf_debug (gnu_current_inf, "reading %s[%s] --> %s",
-		 paddress (target_gdbarch (), memaddr), plongest (len),
+		 paddress (target_gdbarch (), memaddr), pulongest (len),
 		 host_address_to_string (readbuf));
       res = gnu_read_inferior (task, memaddr, readbuf, len);
     }
@@ -2512,7 +2512,7 @@ gnu_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
 static LONGEST
 gnu_xfer_partial (struct target_ops *ops, enum target_object object,
 		  const char *annex, gdb_byte *readbuf,
-		  const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		  const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   switch (object)
     {
diff --git a/gdb/ia64-hpux-nat.c b/gdb/ia64-hpux-nat.c
index fb76067..2b0e889 100644
--- a/gdb/ia64-hpux-nat.c
+++ b/gdb/ia64-hpux-nat.c
@@ -520,7 +520,7 @@ ia64_hpux_get_register_from_save_state_t (int regnum, int reg_size)
 static LONGEST
 ia64_hpux_xfer_memory (struct target_ops *ops, const char *annex,
 		       gdb_byte *readbuf, const gdb_byte *writebuf,
-		       CORE_ADDR addr, LONGEST len)
+		       CORE_ADDR addr, ULONGEST len)
 {
   CORE_ADDR bsp, bspstore;
   CORE_ADDR start_addr, short_len;
@@ -643,7 +643,7 @@ ia64_hpux_xfer_uregs (struct target_ops *ops, const char *annex,
 static LONGEST
 ia64_hpux_xfer_solib_got (struct target_ops *ops, const char *annex,
 			  gdb_byte *readbuf, const gdb_byte *writebuf,
-			  ULONGEST offset, LONGEST len)
+			  ULONGEST offset, ULONGEST len)
 {
   CORE_ADDR fun_addr;
   /* The linkage pointer.  We use a uint64_t to make sure that the size
@@ -673,7 +673,7 @@ ia64_hpux_xfer_solib_got (struct target_ops *ops, const char *annex,
 static LONGEST
 ia64_hpux_xfer_partial (struct target_ops *ops, enum target_object object,
 			const char *annex, gdb_byte *readbuf,
-			const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+			const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   LONGEST val;
 
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index af35829..072c8fd 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -840,7 +840,7 @@ ia64_linux_xfer_partial (struct target_ops *ops,
 			 enum target_object object,
 			 const char *annex,
 			 gdb_byte *readbuf, const gdb_byte *writebuf,
-			 ULONGEST offset, LONGEST len)
+			 ULONGEST offset, ULONGEST len)
 {
   if (object == TARGET_OBJECT_UNWIND_TABLE && writebuf == NULL && offset == 0)
     return syscall (__NR_getunwind, readbuf, len);
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index e0d198f..a64c876 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -463,7 +463,7 @@ static LONGEST
 inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
 			 const char *annex, gdb_byte *readbuf,
 			 const gdb_byte *writebuf,
-			 ULONGEST offset, LONGEST len)
+			 ULONGEST offset, ULONGEST len)
 {
   pid_t pid = ptid_get_pid (inferior_ptid);
 
diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c
index a1c761b..5d27d44 100644
--- a/gdb/inf-ttrace.c
+++ b/gdb/inf-ttrace.c
@@ -1226,7 +1226,7 @@ static LONGEST
 inf_ttrace_xfer_partial (struct target_ops *ops, enum target_object object,
 			 const char *annex, gdb_byte *readbuf,
 			 const gdb_byte *writebuf,
-			 ULONGEST offset, LONGEST len)
+			 ULONGEST offset, ULONGEST len)
 {
   switch (object)
     {
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 4dfb3ff..2371ad4 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -3865,7 +3865,7 @@ siginfo_fixup (siginfo_t *siginfo, gdb_byte *inf_siginfo, int direction)
 static LONGEST
 linux_xfer_siginfo (struct target_ops *ops, enum target_object object,
                     const char *annex, gdb_byte *readbuf,
-		    const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		    const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   int pid;
   siginfo_t siginfo;
@@ -3919,7 +3919,7 @@ static LONGEST
 linux_nat_xfer_partial (struct target_ops *ops, enum target_object object,
 			const char *annex, gdb_byte *readbuf,
 			const gdb_byte *writebuf,
-			ULONGEST offset, LONGEST len)
+			ULONGEST offset, ULONGEST len)
 {
   struct cleanup *old_chain;
   LONGEST xfer;
@@ -4155,7 +4155,7 @@ linux_proc_xfer_partial (struct target_ops *ops, enum target_object object,
 
 /* Enumerate spufs IDs for process PID.  */
 static LONGEST
-spu_enumerate_spu_ids (int pid, gdb_byte *buf, ULONGEST offset, LONGEST len)
+spu_enumerate_spu_ids (int pid, gdb_byte *buf, ULONGEST offset, ULONGEST len)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
   LONGEST pos = 0;
@@ -4209,7 +4209,7 @@ static LONGEST
 linux_proc_xfer_spu (struct target_ops *ops, enum target_object object,
 		     const char *annex, gdb_byte *readbuf,
 		     const gdb_byte *writebuf,
-		     ULONGEST offset, LONGEST len)
+		     ULONGEST offset, ULONGEST len)
 {
   char buf[128];
   int fd = 0;
@@ -4332,7 +4332,7 @@ linux_proc_pending_signals (int pid, sigset_t *pending,
 static LONGEST
 linux_nat_xfer_osdata (struct target_ops *ops, enum target_object object,
 		       const char *annex, gdb_byte *readbuf,
-		       const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		       const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   gdb_assert (object == TARGET_OBJECT_OSDATA);
 
@@ -4342,7 +4342,7 @@ linux_nat_xfer_osdata (struct target_ops *ops, enum target_object object,
 static LONGEST
 linux_xfer_partial (struct target_ops *ops, enum target_object object,
                     const char *annex, gdb_byte *readbuf,
-		    const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		    const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   LONGEST xfer;
 
diff --git a/gdb/monitor.c b/gdb/monitor.c
index c86f040b..94b3a75 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -2020,7 +2020,7 @@ monitor_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
 
 static LONGEST
 monitor_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
-		     ULONGEST memaddr, LONGEST len)
+		     ULONGEST memaddr, ULONGEST len)
 {
   int res;
 
@@ -2046,7 +2046,7 @@ monitor_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
 static LONGEST
 monitor_xfer_partial (struct target_ops *ops, enum target_object object,
 		      const char *annex, gdb_byte *readbuf,
-		      const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		      const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   switch (object)
     {
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 4fa520a..0ed788e 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -3976,7 +3976,7 @@ wait_again:
 static LONGEST
 procfs_xfer_partial (struct target_ops *ops, enum target_object object,
 		     const char *annex, gdb_byte *readbuf,
-		     const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		     const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   switch (object)
     {
diff --git a/gdb/record-full.c b/gdb/record-full.c
index 3fb77ef..a9fc018 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -1627,7 +1627,7 @@ static LONGEST
 record_full_xfer_partial (struct target_ops *ops, enum target_object object,
 			  const char *annex, gdb_byte *readbuf,
 			  const gdb_byte *writebuf, ULONGEST offset,
-			  LONGEST len)
+			  ULONGEST len)
 {
   if (!record_full_gdb_operation_disable
       && (object == TARGET_OBJECT_MEMORY
@@ -2160,7 +2160,7 @@ record_full_core_xfer_partial (struct target_ops *ops,
 			       enum target_object object,
 			       const char *annex, gdb_byte *readbuf,
 			       const gdb_byte *writebuf, ULONGEST offset,
-			       LONGEST len)
+			       ULONGEST len)
 {
   if (object == TARGET_OBJECT_MEMORY)
     {
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index b0f4922..afdb3d3 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -1063,10 +1063,11 @@ gdbsim_prepare_to_store (struct regcache *regcache)
 static LONGEST
 gdbsim_xfer_memory (struct target_ops *target,
 		    gdb_byte *readbuf, const gdb_byte *writebuf,
-		    ULONGEST memaddr, LONGEST len)
+		    ULONGEST memaddr, ULONGEST len)
 {
   struct sim_inferior_data *sim_data
     = get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NOT_NEEDED);
+  int l;
 
   /* If this target doesn't have memory yet, return 0 causing the
      request to be passed to a lower target, hopefully an exec
@@ -1092,21 +1093,21 @@ gdbsim_xfer_memory (struct target_ops *target,
 			host_address_to_string (readbuf),
 			host_address_to_string (writebuf),
 			paddress (target_gdbarch (), memaddr),
-			plongest (len));
+			pulongest (len));
 
   if (writebuf)
     {
       if (remote_debug && len > 0)
 	dump_mem (writebuf, len);
-      len = sim_write (sim_data->gdbsim_desc, memaddr, writebuf, len);
+      l = sim_write (sim_data->gdbsim_desc, memaddr, writebuf, len);
     }
   else
     {
-      len = sim_read (sim_data->gdbsim_desc, memaddr, readbuf, len);
+      l = sim_read (sim_data->gdbsim_desc, memaddr, readbuf, len);
       if (remote_debug && len > 0)
 	dump_mem (readbuf, len);
     }
-  return len;
+  return l;
 }
 
 /* Target to_xfer_partial implementation.  */
@@ -1114,7 +1115,7 @@ gdbsim_xfer_memory (struct target_ops *target,
 static LONGEST
 gdbsim_xfer_partial (struct target_ops *ops, enum target_object object,
 		     const char *annex, gdb_byte *readbuf,
-		     const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		     const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   switch (object)
     {
diff --git a/gdb/remote.c b/gdb/remote.c
index 8366c5d..f5176c9 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -8802,7 +8802,7 @@ remote_read_qxfer (struct target_ops *ops, const char *object_name,
 static LONGEST
 remote_xfer_partial (struct target_ops *ops, enum target_object object,
 		     const char *annex, gdb_byte *readbuf,
-		     const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		     const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   struct remote_state *rs;
   int i;
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index b6bb3ed..ed13859 100644
--- a/gdb/rs6000-aix-tdep.c
+++ b/gdb/rs6000-aix-tdep.c
@@ -967,7 +967,7 @@ rs6000_aix_shared_library_to_xml (struct ld_info *ldi,
 
 LONGEST
 rs6000_aix_ld_info_to_xml (struct gdbarch *gdbarch, const gdb_byte *ldi_buf,
-			   gdb_byte *readbuf, ULONGEST offset, LONGEST len,
+			   gdb_byte *readbuf, ULONGEST offset, ULONGEST len,
 			   int close_ldinfo_fd)
 {
   struct obstack obstack;
diff --git a/gdb/rs6000-aix-tdep.h b/gdb/rs6000-aix-tdep.h
index c856b42..76765f1 100644
--- a/gdb/rs6000-aix-tdep.h
+++ b/gdb/rs6000-aix-tdep.h
@@ -22,7 +22,7 @@ extern LONGEST rs6000_aix_ld_info_to_xml (struct gdbarch *gdbarch,
 					  const gdb_byte *ldi_buf,
 					  gdb_byte *readbuf,
 					  ULONGEST offset,
-					  LONGEST len,
+					  ULONGEST len,
 					  int close_ldinfo_fd);
 
 #endif /* RS6000_AIX_TDEP_H */
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index da17b94..676edd9 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -383,7 +383,7 @@ static LONGEST
 rs6000_xfer_partial (struct target_ops *ops, enum target_object object,
 		     const char *annex, gdb_byte *readbuf,
 		     const gdb_byte *writebuf,
-		     ULONGEST offset, LONGEST len)
+		     ULONGEST offset, ULONGEST len)
 {
   pid_t pid = ptid_get_pid (inferior_ptid);
   int arch64 = ARCH64 ();
@@ -686,7 +686,7 @@ static LONGEST
 rs6000_xfer_shared_libraries
   (struct target_ops *ops, enum target_object object,
    const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf,
-   ULONGEST offset, LONGEST len)
+   ULONGEST offset, ULONGEST len)
 {
   gdb_byte *ldi_buf;
   ULONGEST result;
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index f193349..f39f8bb 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -546,7 +546,7 @@ static LONGEST
 sol_thread_xfer_partial (struct target_ops *ops, enum target_object object,
 			  const char *annex, gdb_byte *readbuf,
 			  const gdb_byte *writebuf,
-			 ULONGEST offset, LONGEST len)
+			 ULONGEST offset, ULONGEST len)
 {
   int retval;
   struct cleanup *old_chain;
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index ca4b3bb..2953c7c 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -261,7 +261,7 @@ sparc_store_inferior_registers (struct target_ops *ops,
 static LONGEST
 sparc_xfer_wcookie (struct target_ops *ops, enum target_object object,
 		    const char *annex, gdb_byte *readbuf,
-		    const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		    const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   unsigned long wcookie = 0;
   char *buf = (char *)&wcookie;
@@ -318,7 +318,7 @@ target_xfer_partial_ftype *inf_ptrace_xfer_partial;
 static LONGEST
 sparc_xfer_partial (struct target_ops *ops, enum target_object object,
 		    const char *annex, gdb_byte *readbuf,
-		    const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		    const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   if (object == TARGET_OBJECT_WCOOKIE)
     return sparc_xfer_wcookie (ops, object, annex, readbuf, writebuf, 
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index 4c62ec7..784939b 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -231,7 +231,7 @@ parse_spufs_run (int *fd, ULONGEST *addr)
 static LONGEST
 spu_proc_xfer_spu (const char *annex, gdb_byte *readbuf,
 		   const gdb_byte *writebuf,
-		   ULONGEST offset, LONGEST len)
+		   ULONGEST offset, ULONGEST len)
 {
   char buf[128];
   int fd = 0;
@@ -563,7 +563,7 @@ static LONGEST
 spu_xfer_partial (struct target_ops *ops,
 		  enum target_object object, const char *annex,
 		  gdb_byte *readbuf, const gdb_byte *writebuf,
-		  ULONGEST offset, LONGEST len)
+		  ULONGEST offset, ULONGEST len)
 {
   if (object == TARGET_OBJECT_SPU)
     return spu_proc_xfer_spu (annex, readbuf, writebuf, offset, len);
diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c
index 9b6f0a6..11a566a 100644
--- a/gdb/spu-multiarch.c
+++ b/gdb/spu-multiarch.c
@@ -248,7 +248,7 @@ spu_store_registers (struct target_ops *ops,
 static LONGEST
 spu_xfer_partial (struct target_ops *ops, enum target_object object,
 		  const char *annex, gdb_byte *readbuf,
-		  const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		  const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   struct target_ops *ops_beneath = find_target_beneath (ops);
   while (ops_beneath && !ops_beneath->to_xfer_partial)
diff --git a/gdb/target.c b/gdb/target.c
index 42a8741..25002b3 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1317,7 +1317,7 @@ target_section_by_addr (struct target_ops *target, CORE_ADDR addr)
 
 static LONGEST
 target_read_live_memory (enum target_object object,
-			 ULONGEST memaddr, gdb_byte *myaddr, LONGEST len)
+			 ULONGEST memaddr, gdb_byte *myaddr, ULONGEST len)
 {
   LONGEST ret;
   struct cleanup *cleanup;
@@ -1347,7 +1347,7 @@ static LONGEST
 memory_xfer_live_readonly_partial (struct target_ops *ops,
 				   enum target_object object,
 				   gdb_byte *readbuf, ULONGEST memaddr,
-				   LONGEST len)
+				   ULONGEST len)
 {
   struct target_section *secp;
   struct target_section_table *table;
@@ -1427,7 +1427,7 @@ raw_memory_xfer_partial (struct target_ops *ops, void *readbuf,
 static LONGEST
 memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
 		       void *readbuf, const void *writebuf, ULONGEST memaddr,
-		       LONGEST len)
+		       ULONGEST len)
 {
   LONGEST res;
   int reg_len;
@@ -1625,7 +1625,7 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
 static LONGEST
 memory_xfer_partial (struct target_ops *ops, enum target_object object,
 		     void *readbuf, const void *writebuf, ULONGEST memaddr,
-		     LONGEST len)
+		     ULONGEST len)
 {
   int res;
 
@@ -1690,7 +1690,7 @@ LONGEST
 target_xfer_partial (struct target_ops *ops,
 		     enum target_object object, const char *annex,
 		     gdb_byte *readbuf, const gdb_byte *writebuf,
-		     ULONGEST offset, LONGEST len)
+		     ULONGEST offset, ULONGEST len)
 {
   LONGEST retval;
 
@@ -1729,7 +1729,7 @@ target_xfer_partial (struct target_ops *ops,
 			  host_address_to_string (readbuf),
 			  host_address_to_string (writebuf),
 			  core_addr_to_string_nz (offset),
-			  plongest (len), plongest (retval));
+			  pulongest (len), plongest (retval));
 
       if (readbuf)
 	myaddr = readbuf;
@@ -1964,7 +1964,7 @@ show_trust_readonly (struct ui_file *file, int from_tty,
 static LONGEST
 default_xfer_partial (struct target_ops *ops, enum target_object object,
 		      const char *annex, gdb_byte *readbuf,
-		      const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		      const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   if (object == TARGET_OBJECT_MEMORY
       && ops->deprecated_xfer_memory != NULL)
@@ -2010,7 +2010,7 @@ default_xfer_partial (struct target_ops *ops, enum target_object object,
 static LONGEST
 current_xfer_partial (struct target_ops *ops, enum target_object object,
 		      const char *annex, gdb_byte *readbuf,
-		      const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		      const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   if (ops->beneath != NULL)
     return ops->beneath->to_xfer_partial (ops->beneath, object, annex,
diff --git a/gdb/target.h b/gdb/target.h
index 4b52fb6..5fb5d92 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -245,7 +245,7 @@ typedef LONGEST
 			     gdb_byte *readbuf,
 			     const gdb_byte *writebuf,
 			     ULONGEST offset,
-			     LONGEST len);
+			     ULONGEST len);
 
 /* Request that OPS transfer up to LEN 8-bit bytes of the target's
    OBJECT.  The OFFSET, for a seekable object, specifies the
@@ -537,7 +537,7 @@ struct target_ops
     LONGEST (*to_xfer_partial) (struct target_ops *ops,
 				enum target_object object, const char *annex,
 				gdb_byte *readbuf, const gdb_byte *writebuf,
-				ULONGEST offset, LONGEST len);
+				ULONGEST offset, ULONGEST len);
 
     /* Returns the memory map for the target.  A return value of NULL
        means that no memory map is available.  If a memory address
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 582c284..18b35b1 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -5094,7 +5094,7 @@ tfile_fetch_registers (struct target_ops *ops,
 static LONGEST
 tfile_xfer_partial (struct target_ops *ops, enum target_object object,
 		    const char *annex, gdb_byte *readbuf,
-		    const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		    const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   /* We're only doing regular memory for now.  */
   if (object != TARGET_OBJECT_MEMORY)
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 6cd2c46..d9b06d9 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -2415,7 +2415,7 @@ windows_stop (ptid_t ptid)
 
 static LONGEST
 windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
-		     ULONGEST memaddr, LONGEST len)
+		     ULONGEST memaddr, ULONGEST len)
 {
   SIZE_T done = 0;
   BOOL success;
@@ -2424,7 +2424,7 @@ windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
   if (writebuf != NULL)
     {
       DEBUG_MEM (("gdb: write target memory, %s bytes at %s\n",
-		  plongest (len), core_addr_to_string (memaddr)));
+		  pulongest (len), core_addr_to_string (memaddr)));
       success = WriteProcessMemory (current_process_handle,
 				    (LPVOID) (uintptr_t) memaddr, writebuf,
 				    len, &done);
@@ -2436,7 +2436,7 @@ windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
   else
     {
       DEBUG_MEM (("gdb: read target memory, %s bytes at %s\n",
-		  plongest (len), core_addr_to_string (memaddr)));
+		  pulongest (len), core_addr_to_string (memaddr)));
       success = ReadProcessMemory (current_process_handle,
 				   (LPCVOID) (uintptr_t) memaddr, readbuf,
 				   len, &done);
@@ -2506,7 +2506,7 @@ static LONGEST
 windows_xfer_shared_libraries (struct target_ops *ops,
 			     enum target_object object, const char *annex,
 			     gdb_byte *readbuf, const gdb_byte *writebuf,
-			     ULONGEST offset, LONGEST len)
+			     ULONGEST offset, ULONGEST len)
 {
   struct obstack obstack;
   const char *buf;
@@ -2542,7 +2542,7 @@ windows_xfer_shared_libraries (struct target_ops *ops,
 static LONGEST
 windows_xfer_partial (struct target_ops *ops, enum target_object object,
 		    const char *annex, gdb_byte *readbuf,
-		    const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
+		    const gdb_byte *writebuf, ULONGEST offset, ULONGEST len)
 {
   switch (object)
     {
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 0/4] Change 'len' of to_xfer_partial to ULONGEST
@ 2014-01-08  7:29 Yao Qi
  2014-01-08  7:29 ` [PATCH 4/4] Change 'len''s type from LONGEST to ULONGEST: gdbarch methods core_xfer_shared_libraries and core_xfer_shared_libraries_aix Yao Qi
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Yao Qi @ 2014-01-08  7:29 UTC (permalink / raw)
  To: gdb-patches

Hi,
This patch series is a preparation for the changes mentioned in the
discussion on changing target_ops method to_xfer_partial [1], in which,
the expected change would be

    LONGEST (*to_xfer_partial) (struct target_ops *ops,
				enum target_object object, const char *annex,
				gdb_byte *readbuf, const gdb_byte *writebuf,
				ULONGEST offset, LONGEST len);

to

    enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops,
				enum target_object object, const char *annex,
				gdb_byte *readbuf, const gdb_byte *writebuf,
				ULONGEST offset, ULONGEST len, ULONGEST *xfered_len);

I started from the 'len' "LONGEST -> ULONGEST" transition, and that
is what this patch series tries to do.  This change is quite mechanical.
Regression tested on x86_64-linux with both native and gdbserver.  I
also rebuilt GDB in the following ways:

 - on x86-linux, with all targets enabled,
 - cross build native mingw32,mips-linux,hurd,sparc-linux, gdb on
   linux,
 - build native powerpc-linux gdb on gcc110
 - build spu-elf target on gcc110
 - build aix native gdb on gcc111
 - build native gdb for netbsd on gcc70

There are still some native targets uncovered, such as darwin, but it
should be easy to fix the build error.  Patch 2 is major part of this
series.  Patch 3 adjusts linux_common_xfer_osdata and patch 4 adjusts
two gdbarch methods.

I tried to turn -Wconversion on to help me to check some signed/unsigned
conversion, but it gives me thousands of errors in a clean build
(without my patches.  Looks signed/unsigned types are used freely in GDB
code base, so I didn't take much care of signed/unsigned conversion.

I'll finish the interface to_xfer_partial change in next step, and
adjust its implementations on some targets, such as tfile and ctf
targets.

[1] supporting all kinds of partially-<unavailable> enum target_object types
    https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html

*** BLURB HERE ***

Yao Qi (4):
  Use target_xfer_partial_ftype for rs6000_xfer_shared_libraries
  Change to_xfer_partial 'len' type to ULONGEST.
  Change 'len' of linux_common_xfer_osdata to ULONGEST.
  Change 'len''s type from LONGEST to ULONGEST: gdbarch methods
    core_xfer_shared_libraries and core_xfer_shared_libraries_aix

 gdb/aix-thread.c          |    2 +-
 gdb/auxv.c                |   11 +++++++----
 gdb/bfd-target.c          |    2 +-
 gdb/bsd-kvm.c             |    2 +-
 gdb/bsd-uthread.c         |    2 +-
 gdb/common/linux-osdata.c |   22 +++++++++++-----------
 gdb/common/linux-osdata.h |    2 +-
 gdb/corelow.c             |    2 +-
 gdb/ctf.c                 |    2 +-
 gdb/darwin-nat.c          |   12 ++++++------
 gdb/exec.c                |    6 +++---
 gdb/exec.h                |    2 +-
 gdb/gdbarch.c             |    4 ++--
 gdb/gdbarch.h             |    8 ++++----
 gdb/gdbarch.sh            |    4 ++--
 gdb/gnu-nat.c             |    8 ++++----
 gdb/i386-cygwin-tdep.c    |    2 +-
 gdb/ia64-hpux-nat.c       |    6 +++---
 gdb/ia64-linux-nat.c      |    2 +-
 gdb/inf-ptrace.c          |    2 +-
 gdb/inf-ttrace.c          |    2 +-
 gdb/linux-nat.c           |   12 ++++++------
 gdb/monitor.c             |    4 ++--
 gdb/procfs.c              |    2 +-
 gdb/record-full.c         |    4 ++--
 gdb/remote-sim.c          |   13 +++++++------
 gdb/remote.c              |    2 +-
 gdb/rs6000-aix-tdep.c     |    4 ++--
 gdb/rs6000-aix-tdep.h     |    2 +-
 gdb/rs6000-nat.c          |    9 +++------
 gdb/sol-thread.c          |    2 +-
 gdb/sparc-nat.c           |    4 ++--
 gdb/spu-linux-nat.c       |    4 ++--
 gdb/spu-multiarch.c       |    2 +-
 gdb/target.c              |   16 ++++++++--------
 gdb/target.h              |    4 ++--
 gdb/tracepoint.c          |    2 +-
 gdb/windows-nat.c         |   10 +++++-----
 38 files changed, 101 insertions(+), 100 deletions(-)

-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/4] Change 'len' of linux_common_xfer_osdata to ULONGEST.
  2014-01-08  7:29 [PATCH 0/4] Change 'len' of to_xfer_partial to ULONGEST Yao Qi
  2014-01-08  7:29 ` [PATCH 4/4] Change 'len''s type from LONGEST to ULONGEST: gdbarch methods core_xfer_shared_libraries and core_xfer_shared_libraries_aix Yao Qi
  2014-01-08  7:29 ` [PATCH 1/4] Use target_xfer_partial_ftype for rs6000_xfer_shared_libraries Yao Qi
@ 2014-01-08  7:29 ` Yao Qi
  2014-01-08 12:35   ` Pedro Alves
  2014-01-08  7:29 ` [PATCH 2/4] Change to_xfer_partial 'len' type " Yao Qi
  2014-01-08 12:38 ` [PATCH 0/4] Change 'len' of to_xfer_partial " Pedro Alves
  4 siblings, 1 reply; 13+ messages in thread
From: Yao Qi @ 2014-01-08  7:29 UTC (permalink / raw)
  To: gdb-patches

gdb:

2014-01-08  Yao Qi  <yao@codesourcery.com>

	* common/linux-osdata.c (linux_xfer_osdata_processes): Change
	type of 'len' to ULONGEST.
	(linux_xfer_osdata_processgroups): Likewise.
	(linux_xfer_osdata_threads): Likewise.
	(linux_xfer_osdata_fds): Likewise.
	(linux_xfer_osdata_isockets): Likewise.
	(linux_xfer_osdata_shm): Likewise.
	(linux_xfer_osdata_sem): Likewise.
	(linux_xfer_osdata_msg): Likewise.
	(linux_common_xfer_osdata): Likewise.
	(struct osdata_type) <getter>: Likewise.
	* common/linux-osdata.h (linux_common_xfer_osdata): Update
	the declaration.
---
 gdb/common/linux-osdata.c |   22 +++++++++++-----------
 gdb/common/linux-osdata.h |    2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gdb/common/linux-osdata.c b/gdb/common/linux-osdata.c
index 359ab18..805850c 100644
--- a/gdb/common/linux-osdata.c
+++ b/gdb/common/linux-osdata.c
@@ -301,7 +301,7 @@ get_cores_used_by_process (PID_T pid, int *cores)
 
 static LONGEST
 linux_xfer_osdata_processes (gdb_byte *readbuf,
-			     ULONGEST offset, LONGEST len)
+			     ULONGEST offset, ULONGEST len)
 {
   /* We make the process list snapshot when the object starts to be read.  */
   static const char *buf;
@@ -449,7 +449,7 @@ compare_processes (const void *process1, const void *process2)
 
 static LONGEST
 linux_xfer_osdata_processgroups (gdb_byte *readbuf,
-				 ULONGEST offset, LONGEST len)
+				 ULONGEST offset, ULONGEST len)
 {
   /* We make the process list snapshot when the object starts to be read.  */
   static const char *buf;
@@ -565,7 +565,7 @@ linux_xfer_osdata_processgroups (gdb_byte *readbuf,
 
 static LONGEST
 linux_xfer_osdata_threads (gdb_byte *readbuf,
-			   ULONGEST offset, LONGEST len)
+			   ULONGEST offset, ULONGEST len)
 {
   /* We make the process list snapshot when the object starts to be read.  */
   static const char *buf;
@@ -679,7 +679,7 @@ linux_xfer_osdata_threads (gdb_byte *readbuf,
 
 static LONGEST
 linux_xfer_osdata_fds (gdb_byte *readbuf,
-		       ULONGEST offset, LONGEST len)
+		       ULONGEST offset, ULONGEST len)
 {
   /* We make the process list snapshot when the object starts to be read.  */
   static const char *buf;
@@ -986,7 +986,7 @@ print_sockets (unsigned short family, int tcp, struct buffer *buffer)
 
 static LONGEST
 linux_xfer_osdata_isockets (gdb_byte *readbuf,
-			    ULONGEST offset, LONGEST len)
+			    ULONGEST offset, ULONGEST len)
 {
   static const char *buf;
   static LONGEST len_avail = -1;
@@ -1067,7 +1067,7 @@ group_from_gid (char *group, int maxlen, gid_t gid)
 
 static LONGEST
 linux_xfer_osdata_shm (gdb_byte *readbuf,
-		       ULONGEST offset, LONGEST len)
+		       ULONGEST offset, ULONGEST len)
 {
   static const char *buf;
   static LONGEST len_avail = -1;
@@ -1195,7 +1195,7 @@ linux_xfer_osdata_shm (gdb_byte *readbuf,
 
 static LONGEST
 linux_xfer_osdata_sem (gdb_byte *readbuf,
-		       ULONGEST offset, LONGEST len)
+		       ULONGEST offset, ULONGEST len)
 {
   static const char *buf;
   static LONGEST len_avail = -1;
@@ -1307,7 +1307,7 @@ linux_xfer_osdata_sem (gdb_byte *readbuf,
 
 static LONGEST
 linux_xfer_osdata_msg (gdb_byte *readbuf,
-		       ULONGEST offset, LONGEST len)
+		       ULONGEST offset, ULONGEST len)
 {
   static const char *buf;
   static LONGEST len_avail = -1;
@@ -1433,7 +1433,7 @@ linux_xfer_osdata_msg (gdb_byte *readbuf,
 
 static LONGEST
 linux_xfer_osdata_modules (gdb_byte *readbuf,
-			   ULONGEST offset, LONGEST len)
+			   ULONGEST offset, ULONGEST len)
 {
   static const char *buf;
   static LONGEST len_avail = -1;
@@ -1542,7 +1542,7 @@ struct osdata_type {
   char *type;
   char *title;
   char *description;
-  LONGEST (*getter) (gdb_byte *readbuf, ULONGEST offset, LONGEST len);
+  LONGEST (*getter) (gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
 } osdata_table[] = {
   { "processes", "Processes", "Listing of all processes",
     linux_xfer_osdata_processes },
@@ -1567,7 +1567,7 @@ struct osdata_type {
 
 LONGEST
 linux_common_xfer_osdata (const char *annex, gdb_byte *readbuf,
-			  ULONGEST offset, LONGEST len)
+			  ULONGEST offset, ULONGEST len)
 {
   if (!annex || *annex == '\0')
     {
diff --git a/gdb/common/linux-osdata.h b/gdb/common/linux-osdata.h
index 73def86..e9d4f3c 100644
--- a/gdb/common/linux-osdata.h
+++ b/gdb/common/linux-osdata.h
@@ -24,6 +24,6 @@
 
 extern int linux_common_core_of_thread (ptid_t ptid);
 extern LONGEST linux_common_xfer_osdata (const char *annex, gdb_byte *readbuf,
-					 ULONGEST offset, LONGEST len);
+					 ULONGEST offset, ULONGEST len);
 
 #endif
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/4] Use target_xfer_partial_ftype for rs6000_xfer_shared_libraries
  2014-01-08  7:29 [PATCH 0/4] Change 'len' of to_xfer_partial to ULONGEST Yao Qi
  2014-01-08  7:29 ` [PATCH 4/4] Change 'len''s type from LONGEST to ULONGEST: gdbarch methods core_xfer_shared_libraries and core_xfer_shared_libraries_aix Yao Qi
@ 2014-01-08  7:29 ` Yao Qi
  2014-01-08  7:49   ` Joel Brobecker
  2014-01-08  7:29 ` [PATCH 3/4] Change 'len' of linux_common_xfer_osdata to ULONGEST Yao Qi
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Yao Qi @ 2014-01-08  7:29 UTC (permalink / raw)
  To: gdb-patches

Hi,
We can use target_xfer_partial_ftype here for
rs6000_xfer_shared_libraries declaration.

gdb:

2014-01-08  Yao Qi  <yao@codesourcery.com>

	* rs6000-nat.c (rs6000_xfer_shared_libraries): Use
	target_xfer_partial_ftype.
---
 gdb/rs6000-nat.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index a297376..da17b94 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -79,10 +79,7 @@
 
 static void exec_one_dummy_insn (struct regcache *);
 
-static LONGEST rs6000_xfer_shared_libraries
-  (struct target_ops *ops, enum target_object object,
-   const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf,
-   ULONGEST offset, LONGEST len);
+static target_xfer_partial_ftype rs6000_xfer_shared_libraries;
 
 /* Given REGNO, a gdb register number, return the corresponding
    number suitable for use as a ptrace() parameter.  Return -1 if
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/4] Use target_xfer_partial_ftype for rs6000_xfer_shared_libraries
  2014-01-08  7:29 ` [PATCH 1/4] Use target_xfer_partial_ftype for rs6000_xfer_shared_libraries Yao Qi
@ 2014-01-08  7:49   ` Joel Brobecker
  0 siblings, 0 replies; 13+ messages in thread
From: Joel Brobecker @ 2014-01-08  7:49 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

> 2014-01-08  Yao Qi  <yao@codesourcery.com>
> 
> 	* rs6000-nat.c (rs6000_xfer_shared_libraries): Use
> 	target_xfer_partial_ftype.

This one is a nice cleanup on its own, and can go in now, regardless
of the rest of the patch series. You can treat other changes of this
kind as obvious.

An option, if we want to get rid of the advance declaration, is to
move the function's body ahead of rs6000_xfer_partial (not sure if
that triggers other issues, though).

> ---
>  gdb/rs6000-nat.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
> index a297376..da17b94 100644
> --- a/gdb/rs6000-nat.c
> +++ b/gdb/rs6000-nat.c
> @@ -79,10 +79,7 @@
>  
>  static void exec_one_dummy_insn (struct regcache *);
>  
> -static LONGEST rs6000_xfer_shared_libraries
> -  (struct target_ops *ops, enum target_object object,
> -   const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf,
> -   ULONGEST offset, LONGEST len);
> +static target_xfer_partial_ftype rs6000_xfer_shared_libraries;
>  
>  /* Given REGNO, a gdb register number, return the corresponding
>     number suitable for use as a ptrace() parameter.  Return -1 if
> -- 
> 1.7.7.6

-- 
Joel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/4] Change to_xfer_partial 'len' type to ULONGEST.
  2014-01-08  7:29 ` [PATCH 2/4] Change to_xfer_partial 'len' type " Yao Qi
@ 2014-01-08 12:34   ` Pedro Alves
  2014-01-08 15:31     ` Yao Qi
  0 siblings, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2014-01-08 12:34 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 01/08/2014 07:27 AM, Yao Qi wrote:
> @@ -178,7 +178,10 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
>  	}
>  
>        data_address += block;
> -      len -= block;
> +      if (len < block)
> +	len = 0;
> +      else
> +	len -= block;

Is this a bug fix (if so, it should go is separately)?

But, AFAICS, we have:

      if (block > len)
	block = len;

above, so it shouldn't be necessary.

>  darwin_read_write_inferior (task_t task, CORE_ADDR addr,
>  			    gdb_byte *rdaddr, const gdb_byte *wraddr,
> -			    int length)
> +			    ULONGEST length)
>  {

...

> @@ -1772,7 +1772,7 @@ darwin_read_write_inferior (task_t task, CORE_ADDR addr,
>    mach_vm_address_t region_address;
>    mach_vm_size_t region_length;
>
> -  inferior_debug (8, _("darwin_read_write_inferior(task=0x%x, %s, len=%d)\n"),
> +  inferior_debug (8, _("darwin_read_write_inferior(task=0x%x, %s, len=%u)\n"),
>  		  task, core_addr_to_string (addr), length);

Should be %s/pulongest.

Otherwise looks good to me.

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] Change 'len''s type from LONGEST to ULONGEST: gdbarch methods core_xfer_shared_libraries and core_xfer_shared_libraries_aix
  2014-01-08  7:29 ` [PATCH 4/4] Change 'len''s type from LONGEST to ULONGEST: gdbarch methods core_xfer_shared_libraries and core_xfer_shared_libraries_aix Yao Qi
@ 2014-01-08 12:35   ` Pedro Alves
  0 siblings, 0 replies; 13+ messages in thread
From: Pedro Alves @ 2014-01-08 12:35 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 01/08/2014 07:27 AM, Yao Qi wrote:
> This patch changes the type of 'len' from LONGEST to ULONGEST.  'len'
> is the argument of gdbarch methods core_xfer_shared_libraries and
> core_xfer_shared_libraries_aix.
> 
> gdb:
> 
> 2014-01-08  Yao Qi  <yao@codesourcery.com>
> 
> 	* gdbarch.sh (core_xfer_shared_libraries): Change its argument
> 	'len''s type to ULONGEST.
> 	(core_xfer_shared_libraries_aix): Likewise.
> 	* gdbarch.c, gdbarch.h: Reenerated.
> 	* i386-cygwin-tdep.c (windows_core_xfer_shared_libraries):
> 	Change type of 'len' to ULONGEST.
> 	* rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise.
> 	(rs6000_aix_core_xfer_shared_libraries_aix): Likewise.

Looks fine to me.

Thanks,
-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/4] Change 'len' of linux_common_xfer_osdata to ULONGEST.
  2014-01-08  7:29 ` [PATCH 3/4] Change 'len' of linux_common_xfer_osdata to ULONGEST Yao Qi
@ 2014-01-08 12:35   ` Pedro Alves
  0 siblings, 0 replies; 13+ messages in thread
From: Pedro Alves @ 2014-01-08 12:35 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 01/08/2014 07:27 AM, Yao Qi wrote:
> gdb:
> 
> 2014-01-08  Yao Qi  <yao@codesourcery.com>
> 
> 	* common/linux-osdata.c (linux_xfer_osdata_processes): Change
> 	type of 'len' to ULONGEST.
> 	(linux_xfer_osdata_processgroups): Likewise.
> 	(linux_xfer_osdata_threads): Likewise.
> 	(linux_xfer_osdata_fds): Likewise.
> 	(linux_xfer_osdata_isockets): Likewise.
> 	(linux_xfer_osdata_shm): Likewise.
> 	(linux_xfer_osdata_sem): Likewise.
> 	(linux_xfer_osdata_msg): Likewise.
> 	(linux_common_xfer_osdata): Likewise.
> 	(struct osdata_type) <getter>: Likewise.
> 	* common/linux-osdata.h (linux_common_xfer_osdata): Update
> 	the declaration.

Looks fine to me.

Thanks,
-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/4] Change 'len' of to_xfer_partial to ULONGEST
  2014-01-08  7:29 [PATCH 0/4] Change 'len' of to_xfer_partial to ULONGEST Yao Qi
                   ` (3 preceding siblings ...)
  2014-01-08  7:29 ` [PATCH 2/4] Change to_xfer_partial 'len' type " Yao Qi
@ 2014-01-08 12:38 ` Pedro Alves
  2014-01-08 15:29   ` Yao Qi
  4 siblings, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2014-01-08 12:38 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 01/08/2014 07:27 AM, Yao Qi wrote:
> Hi,
> This patch series is a preparation for the changes mentioned in the
> discussion on changing target_ops method to_xfer_partial [1], in which,
> the expected change would be
> 
>     LONGEST (*to_xfer_partial) (struct target_ops *ops,
> 				enum target_object object, const char *annex,
> 				gdb_byte *readbuf, const gdb_byte *writebuf,
> 				ULONGEST offset, LONGEST len);
> 
> to
> 
>     enum target_xfer_status (*to_xfer_partial) (struct target_ops *ops,
> 				enum target_object object, const char *annex,
> 				gdb_byte *readbuf, const gdb_byte *writebuf,
> 				ULONGEST offset, ULONGEST len, ULONGEST *xfered_len);
> 
> I started from the 'len' "LONGEST -> ULONGEST" transition, and that
> is what this patch series tries to do.  This change is quite mechanical.
> Regression tested on x86_64-linux with both native and gdbserver.  I
> also rebuilt GDB in the following ways:
> 
>  - on x86-linux, with all targets enabled,
>  - cross build native mingw32,mips-linux,hurd,sparc-linux, gdb on
>    linux,
>  - build native powerpc-linux gdb on gcc110
>  - build spu-elf target on gcc110
>  - build aix native gdb on gcc111
>  - build native gdb for netbsd on gcc70
> 
> There are still some native targets uncovered, such as darwin, but it
> should be easy to fix the build error.  

I assume you mean "any build error", as you did touch darwin.
Could be helpful to put this in a test branch to make it super easy
for others to test.

> Patch 2 is major part of this
> series.  Patch 3 adjusts linux_common_xfer_osdata and patch 4 adjusts
> two gdbarch methods.
> 
> I tried to turn -Wconversion on to help me to check some signed/unsigned
> conversion, but it gives me thousands of errors in a clean build
> (without my patches.  Looks signed/unsigned types are used freely in GDB
> code base, so I didn't take much care of signed/unsigned conversion.
> 
> I'll finish the interface to_xfer_partial change in next step, and
> adjust its implementations on some targets, such as tfile and ctf
> targets.
> 
> [1] supporting all kinds of partially-<unavailable> enum target_object types
>     https://sourceware.org/ml/gdb-patches/2013-10/msg00761.html

Thanks a lot for following through with this!

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/4] Change 'len' of to_xfer_partial to ULONGEST
  2014-01-08 12:38 ` [PATCH 0/4] Change 'len' of to_xfer_partial " Pedro Alves
@ 2014-01-08 15:29   ` Yao Qi
  2014-01-14 14:31     ` Yao Qi
  0 siblings, 1 reply; 13+ messages in thread
From: Yao Qi @ 2014-01-08 15:29 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On 01/08/2014 08:38 PM, Pedro Alves wrote:
>> There are still some native targets uncovered, such as darwin, but it
>> > should be easy to fix the build error.  
> I assume you mean "any build error", as you did touch darwin.

I meant any build errors on some native targets I didn't test, such as
darwin.

> Could be helpful to put this in a test branch to make it super easy
> for others to test.
> 

I've pushed them into this branch below,
https://github.com/qiyao/gdb/tree/to_xfer_partial-len-to-ULONGEST

Test to rebuild this tree on platforms darwin, djgpp and freebsd
are welcome.

I'll push this series next week.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/4] Change to_xfer_partial 'len' type to ULONGEST.
  2014-01-08 12:34   ` Pedro Alves
@ 2014-01-08 15:31     ` Yao Qi
  0 siblings, 0 replies; 13+ messages in thread
From: Yao Qi @ 2014-01-08 15:31 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On 01/08/2014 08:34 PM, Pedro Alves wrote:
> Is this a bug fix (if so, it should go is separately)?
> 

It is not a bug fix, just make sure 'len' can't be negative when we
change it unsigned type.

> But, AFAICS, we have:
> 
>       if (block > len)
> 	block = len;
> 
> above, so it shouldn't be necessary.

Right, this chunk of change is unnecessary.  I'll remove it from the
patch.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/4] Change 'len' of to_xfer_partial to ULONGEST
  2014-01-08 15:29   ` Yao Qi
@ 2014-01-14 14:31     ` Yao Qi
  0 siblings, 0 replies; 13+ messages in thread
From: Yao Qi @ 2014-01-14 14:31 UTC (permalink / raw)
  To: gdb-patches

On 01/08/2014 11:27 PM, Yao Qi wrote:
> I'll push this series next week.

Patches are pushed.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-01-14 14:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-08  7:29 [PATCH 0/4] Change 'len' of to_xfer_partial to ULONGEST Yao Qi
2014-01-08  7:29 ` [PATCH 4/4] Change 'len''s type from LONGEST to ULONGEST: gdbarch methods core_xfer_shared_libraries and core_xfer_shared_libraries_aix Yao Qi
2014-01-08 12:35   ` Pedro Alves
2014-01-08  7:29 ` [PATCH 1/4] Use target_xfer_partial_ftype for rs6000_xfer_shared_libraries Yao Qi
2014-01-08  7:49   ` Joel Brobecker
2014-01-08  7:29 ` [PATCH 3/4] Change 'len' of linux_common_xfer_osdata to ULONGEST Yao Qi
2014-01-08 12:35   ` Pedro Alves
2014-01-08  7:29 ` [PATCH 2/4] Change to_xfer_partial 'len' type " Yao Qi
2014-01-08 12:34   ` Pedro Alves
2014-01-08 15:31     ` Yao Qi
2014-01-08 12:38 ` [PATCH 0/4] Change 'len' of to_xfer_partial " Pedro Alves
2014-01-08 15:29   ` Yao Qi
2014-01-14 14:31     ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).