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]

Re: [PATCH] gnu-nat.c: Don't install a deprecated_xfer_memory method.


Hi!

On Fri, 06 Sep 2013 19:46:15 +0100, Pedro Alves <palves@redhat.com> wrote:
> Hi!  This removes another instance of a deprecated_xfer_memory user.

Thanks!

> I'm not set up for Hurd testing though.
> 
> Could perhaps one of you guys try this out?

Doing that for you.  ;-) In fact, I had already done this on the weekend
after you submitted the patch, then got interrupted, then failed to
resume...  :-/

As Yue has also found,
<http://news.gmane.org/find-root.php?message_id=%3CCAB8fV%3Di90kf3Eng9aQWb%3DJV%2BR6vPm4Bj5B3aq3X5HHzxVKbLwA%40mail.gmail.com%3E>,
this needs a small fix to make it build.  Here is my version including
additional clean-up (making the functions static avoids compiler warnings
about missing prototypes, likewise the char * -> gdb_byte mirrors your
gnu_write_inferior change and avoids warnings, too).  Will apply this
(folded into your patch) once the GDB testsuite returns (rebased against
current upstream sources).

--- gdb/gnu-nat.c
+++ gdb/gnu-nat.c
@@ -2268,8 +2268,8 @@ gnu_thread_alive (struct target_ops *ops, ptid_t ptid)
 /* Read inferior task's LEN bytes from ADDR and copy it to MYADDR in
    gdb's address space.  Return 0 on failure; number of bytes read
    otherwise.  */
-int
-gnu_read_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
+static int
+gnu_read_inferior (task_t task, CORE_ADDR addr, gdb_byte *myaddr, int length)
 {
   error_t err;
   vm_address_t low_address = (vm_address_t) trunc_page (addr);
@@ -2314,7 +2314,7 @@ struct obstack region_obstack;
 
 /* Write gdb's LEN bytes from MYADDR and copy it to ADDR in inferior
    task's address space.  */
-int
+static int
 gnu_write_inferior (task_t task, CORE_ADDR addr,
 		    const gdb_byte *myaddr, int length)
 {
@@ -2473,11 +2473,10 @@ out:
 
 
 
-/* Helper for gnu_xfer_partial that handles memory transfers.
-   Arguments are like target_xfer_partial.  */
+/* Helper for gnu_xfer_partial that handles memory transfers.  */
 
 static LONGEST
-gnu_xfer_memory (gdb_byte *readbuf, const char *writebuf,
+gnu_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
 		 CORE_ADDR memaddr, LONGEST len)
 {
   task_t task = (gnu_current_inf
@@ -2493,14 +2492,14 @@ gnu_xfer_memory (gdb_byte *readbuf, const char *writebuf,
     {
       inf_debug (gnu_current_inf, "writing %s[%s] <-- %s",
 		 paddress (target_gdbarch (), memaddr), plongest (len),
-		 host_address_to_string (myaddr));
+		 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),
-		 host_address_to_string (myaddr));
+		 host_address_to_string (readbuf));
       res = gnu_read_inferior (task, memaddr, readbuf, len);
     }
   if (res == 0)


GrÃÃe,
 Thomas

Attachment: pgpogf113oMiS.pgp
Description: PGP signature


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