* corelow.c (core_xfer_partial): Change type of readbuf and
authorMark Kettenis <kettenis@gnu.org>
Mon, 16 May 2005 16:36:24 +0000 (16:36 +0000)
committerMark Kettenis <kettenis@gnu.org>
Mon, 16 May 2005 16:36:24 +0000 (16:36 +0000)
writebuf to `gdb_byte *'.
* sparc-nat.c (sparc_xfer_wcookie, sparc_xfer_partial): Change
type of readbuf and writebuf to `gdb_byte *'.
* bsd-uthread.c (bsd_uthread_xfer_partial): Change type of readbuf
and writebuf to `gdb_byte *'.
* inf-ptrace.c (inf_ptrace_xfer_partial): Change type of readbuf
and writebuf to `gdb_byte *'.
* bsd-kvm.c (bsd_kvm_xfer_memory): Replace.
(bsd_kvm_xfer_partial): New function.
(bsd_kvm_add_target): Set to_xfer_partial instead of
to_xfer_memory.
* bfd-target.c (target_bfd_xfer_partial): Change type of readbuf
and writebuf to `gdb_byte *'.
* target.c (deprecated_debug_xfer_memory): Remove prototype.
(deprecated_debug_xfer_memory): Change type of second argument to
`gdb_byte *'.
* remote.c (remote_xfer_memory): Remove prototype.
(remote_xfer_memory): Change type of second argument to `gdb_byte
*'.
(remote_xfer_partial): Change type of readbuf and writebuf to
`gdb_byte *'.

gdb/ChangeLog
gdb/bfd-target.c
gdb/bsd-kvm.c
gdb/corelow.c
gdb/inf-ptrace.c
gdb/remote.c
gdb/sparc-nat.c
gdb/target.c

index 497e17c33d6edb1ed9ff5b506fa2a6c0b3d2de7f..00e5396eb3dd8c4e201b821faa3801c040b9e33c 100644 (file)
@@ -1,5 +1,28 @@
 2005-05-16  Mark Kettenis  <kettenis@gnu.org>
 
+       * corelow.c (core_xfer_partial): Change type of readbuf and
+       writebuf to `gdb_byte *'.
+       * sparc-nat.c (sparc_xfer_wcookie, sparc_xfer_partial): Change
+       type of readbuf and writebuf to `gdb_byte *'.
+       * bsd-uthread.c (bsd_uthread_xfer_partial): Change type of readbuf
+       and writebuf to `gdb_byte *'.
+       * inf-ptrace.c (inf_ptrace_xfer_partial): Change type of readbuf
+       and writebuf to `gdb_byte *'.
+       * bsd-kvm.c (bsd_kvm_xfer_memory): Replace.
+       (bsd_kvm_xfer_partial): New function.
+       (bsd_kvm_add_target): Set to_xfer_partial instead of
+       to_xfer_memory.
+       * bfd-target.c (target_bfd_xfer_partial): Change type of readbuf
+       and writebuf to `gdb_byte *'.
+       * target.c (deprecated_debug_xfer_memory): Remove prototype.
+       (deprecated_debug_xfer_memory): Change type of second argument to
+       `gdb_byte *'.
+       * remote.c (remote_xfer_memory): Remove prototype.
+       (remote_xfer_memory): Change type of second argument to `gdb_byte
+       *'.
+       (remote_xfer_partial): Change type of readbuf and writebuf to
+       `gdb_byte *'.
+
        * config/sparc/fbsd.mt (TDEPFILES): Add solib.o and solib-svr4.o.
        * config/sparc/fbsd.mh (NATDEPFILES): Remove solib.o, solib-svr4.o
        and solib-legacy.o.
index e7aa75bea6b6148aa55da8d251590d15d15c3afd..04ecbd87f744e6325b1edd4a9719f0c3a571c3a2 100644 (file)
@@ -1,6 +1,6 @@
 /* Very simple "bfd" target, for GDB, the GNU debugger.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2005 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -71,8 +71,9 @@ build_target_sections_from_bfd (struct target_ops *targ, struct bfd *abfd)
 LONGEST
 target_bfd_xfer_partial (struct target_ops *ops,
                         enum target_object object,
-                        const char *annex, void *readbuf,
-                        const void *writebuf, ULONGEST offset, LONGEST len)
+                        const char *annex, gdb_byte *readbuf,
+                        const gdb_byte *writebuf,
+                        ULONGEST offset, LONGEST len)
 {
   switch (object)
     {
index e9636a52a96458e64ff21560ddf58ee2321386cd..db60052eccad4efb072111a1579a6c271a2198ed 100644 (file)
@@ -1,6 +1,6 @@
 /* BSD Kernel Data Access Library (libkvm) interface.
 
-   Copyright 2004 Free Software Foundation, Inc.
+   Copyright 2004, 2005 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -103,17 +103,33 @@ bsd_kvm_close (int quitting)
     }
 }
 
-static int
-bsd_kvm_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
-                   int write, struct mem_attrib *attrib,
-                   struct target_ops *ops)
+static LONGEST
+bsd_kvm_xfer_memory (CORE_ADDR addr, ULONGEST len,
+                    gdb_byte *readbuf, const gdb_byte *writebuf)
 {
-  if (write)
-    return kvm_write (core_kd, memaddr, myaddr, len);
-  else
-    return kvm_read (core_kd, memaddr, myaddr, len);
+  ssize_t nbytes = len;
+
+  if (readbuf)
+    nbytes = kvm_read (core_kd, addr, readbuf, nbytes);
+  if (writebuf && nbytes > 0)
+    nbytes = kvm_write (core_kd, addr, writebuf, nbytes);
+  return nbytes;
+}
 
-  return -1;
+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)
+{
+  switch (object)
+    {
+    case TARGET_OBJECT_MEMORY:
+      return bsd_kvm_xfer_memory (offset, len, readbuf, writebuf);
+
+    default:
+      return -1;
+    }
 }
 
 /* Fetch process control block at address PADDR.  */
@@ -287,7 +303,7 @@ Optionally specify the filename of a core dump.");
   bsd_kvm_ops.to_open = bsd_kvm_open;
   bsd_kvm_ops.to_close = bsd_kvm_close;
   bsd_kvm_ops.to_fetch_registers = bsd_kvm_fetch_registers;
-  bsd_kvm_ops.deprecated_xfer_memory = bsd_kvm_xfer_memory;
+  bsd_kvm_ops.to_xfer_partial = bsd_kvm_xfer_partial;
   bsd_kvm_ops.to_stratum = process_stratum;
   bsd_kvm_ops.to_has_memory = 1;
   bsd_kvm_ops.to_has_stack = 1;
index ea37df5d0a0169f68f7d16a709a9827bf5be29c0..3e70ed4bfaeaa945cb5ac0aee9001143698b1d2f 100644 (file)
@@ -1,8 +1,8 @@
 /* Core dump and executable file functions below target vector, for GDB.
 
    Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
-   1997, 1998, 1999, 2000, 2001, 2003, 2004 Free Software Foundation,
-   Inc.
+   1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -532,8 +532,8 @@ core_files_info (struct target_ops *t)
 \f
 static LONGEST
 core_xfer_partial (struct target_ops *ops, enum target_object object,
-                  const char *annex, void *readbuf,
-                  const void *writebuf, ULONGEST offset, LONGEST len)
+                  const char *annex, gdb_byte *readbuf,
+                  const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 {
   switch (object)
     {
index b63b455ce2601cb2b04d939e6fc86a0efb07303a..a0ceeabd7c07af4dffc7b72efeaff83db1101c44 100644 (file)
@@ -400,8 +400,9 @@ inf_ptrace_stop (void)
 
 static LONGEST
 inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
-                        const char *annex, void *readbuf,
-                        const void *writebuf, ULONGEST offset, LONGEST len)
+                        const char *annex, gdb_byte *readbuf,
+                        const gdb_byte *writebuf,
+                        ULONGEST offset, LONGEST len)
 {
   switch (object)
     {
index 5b345b533fd87444fca454e4670db63cbf99f64e..1c1f4f6e085ef2d5b62eb044265118608b73aba6 100644 (file)
@@ -72,11 +72,6 @@ static void build_remote_gdbarch_data (void);
 
 static void remote_files_info (struct target_ops *ignore);
 
-static int remote_xfer_memory (CORE_ADDR memaddr, char *myaddr,
-                              int len, int should_write,
-                              struct mem_attrib *attrib,
-                              struct target_ops *target);
-
 static void remote_prepare_to_store (void);
 
 static void remote_fetch_registers (int regno);
@@ -3871,7 +3866,7 @@ remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len)
    read; 0 for error.  TARGET is unused.  */
 
 static int
-remote_xfer_memory (CORE_ADDR mem_addr, char *buffer, int mem_len,
+remote_xfer_memory (CORE_ADDR mem_addr, gdb_byte *buffer, int mem_len,
                    int should_write, struct mem_attrib *attrib,
                    struct target_ops *target)
 {
@@ -4954,8 +4949,8 @@ the loaded file\n"));
 
 static LONGEST
 remote_xfer_partial (struct target_ops *ops, enum target_object object,
-                    const char *annex, void *readbuf, const void *writebuf,
-                    ULONGEST offset, LONGEST len)
+                    const char *annex, gdb_byte *readbuf,
+                    const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 {
   struct remote_state *rs = get_remote_state ();
   int i;
index f2d73c0d4ea17cce83548cb675d3bd116500ee86..9ce15b514d986d6ed5cd4b1dd2b0274da68ed1b5 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for SPARC.
 
-   Copyright 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2003, 2004, 2005 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -255,8 +255,8 @@ store_inferior_registers (int regnum)
 
 LONGEST
 sparc_xfer_wcookie (struct target_ops *ops, enum target_object object,
-                   const char *annex, void *readbuf, const void *writebuf,
-                   ULONGEST offset, LONGEST len)
+                   const char *annex, gdb_byte *readbuf,
+                   const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 {
   unsigned long wcookie = 0;
   char *buf = (char *)&wcookie;
@@ -307,13 +307,13 @@ sparc_xfer_wcookie (struct target_ops *ops, enum target_object object,
 }
 
 LONGEST (*inf_ptrace_xfer_partial) (struct target_ops *, enum target_object,
-                                   const char *, void *, const void *,
+                                   const char *, gdb_byte *, const gdb_byte *,
                                    ULONGEST, LONGEST);
 
 static LONGEST
 sparc_xfer_partial (struct target_ops *ops, enum target_object object,
-                   const char *annex, void *readbuf, const void *writebuf,
-                   ULONGEST offset, LONGEST len)
+                   const char *annex, gdb_byte *readbuf,
+                   const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 {
   if (object == TARGET_OBJECT_WCOOKIE)
     return sparc_xfer_wcookie (ops, object, annex, readbuf, writebuf, 
index a905cc73a96dbc9dbf3a4804cbebd83750a8d3a9..0838a3b2f2f6e6964f9454703a054703f604bb36 100644 (file)
@@ -108,10 +108,6 @@ static void debug_to_store_registers (int);
 
 static void debug_to_prepare_to_store (void);
 
-static int deprecated_debug_xfer_memory (CORE_ADDR, char *, int, int,
-                                        struct mem_attrib *,
-                                        struct target_ops *);
-
 static void debug_to_files_info (struct target_ops *);
 
 static int debug_to_insert_breakpoint (CORE_ADDR, gdb_byte *);
@@ -2006,7 +2002,7 @@ debug_to_prepare_to_store (void)
 }
 
 static int
-deprecated_debug_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
+deprecated_debug_xfer_memory (CORE_ADDR memaddr, bfd_byte *myaddr, int len,
                              int write, struct mem_attrib *attrib,
                              struct target_ops *target)
 {
This page took 0.031444 seconds and 4 git commands to generate.