This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] remove target_read_memory_partial


The above-mentioned function is used in a single place, for no good reason.

OK?

- Volodya

2006-06-29  Vladimir Prus  <vladimir@codesourcery.com>

	* target.h (target_read_memory_partial): Remove declaration.
	* target.c (target_read_memory_partial): Remove.
	* mi/mi-main.c (mi_cmd_data_read_memory): Use target_read_memory.

--- mi/mi-main.c	(revision 29)
+++ mi/mi-main.c	(local)
@@ -854,16 +854,7 @@ mi_cmd_data_read_memory (char *command, 
   mbuf = xcalloc (total_bytes, 1);
   make_cleanup (xfree, mbuf);
   nr_bytes = 0;
-  while (nr_bytes < total_bytes)
-    {
-      int error;
-      long num = target_read_memory_partial (addr + nr_bytes, mbuf + nr_bytes,
-					     total_bytes - nr_bytes,
-					     &error);
-      if (num <= 0)
-	break;
-      nr_bytes += num;
-    }
+  target_read_memory (addr, mbuf, total_bytes);
 
   /* output the header information. */
   ui_out_field_core_addr (uiout, "addr", addr);
--- target.c	(revision 29)
+++ target.c	(local)
@@ -1240,35 +1240,6 @@ target_xfer_memory_partial (CORE_ADDR me
 }
 
 int
-target_read_memory_partial (CORE_ADDR memaddr, gdb_byte *buf,
-			    int len, int *err)
-{
-  if (target_xfer_partial_p ())
-    {
-      int retval;
-
-      retval = target_xfer_partial (target_stack, TARGET_OBJECT_MEMORY,
-				    NULL, buf, NULL, memaddr, len);
-
-      if (retval <= 0)
-	{
-	  if (errno)
-	    *err = errno;
-	  else
-	    *err = EIO;
-	  return -1;
-	}
-      else
-	{
-	  *err = 0;
-	  return retval;
-	}
-    }
-  else
-    return target_xfer_memory_partial (memaddr, buf, len, 0, err);
-}
-
-int
 target_write_memory_partial (CORE_ADDR memaddr, gdb_byte *buf,
 			     int len, int *err)
 {
--- target.h	(revision 29)
+++ target.h	(local)
@@ -605,9 +605,6 @@ extern int child_xfer_memory (CORE_ADDR,
    of bytes actually transfered is not defined) and ERR is set to a
    non-zero error indication.  */
 
-extern int target_read_memory_partial (CORE_ADDR addr, gdb_byte *buf,
-				       int len, int *err);
-
 extern int target_write_memory_partial (CORE_ADDR addr, gdb_byte *buf,
 					int len, int *err);
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]