]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* linux-low.c (usr_store_inferior_registers): Transfer buf in
authorJim Blandy <jimb@codesourcery.com>
Thu, 29 May 2003 19:05:50 +0000 (19:05 +0000)
committerJim Blandy <jimb@codesourcery.com>
Thu, 29 May 2003 19:05:50 +0000 (19:05 +0000)
PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
away part of the register's value.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c

index 3dfb16ca85d67504f768ad2552cf90db98ff7678..28605d149339ce4a2edb6686c6b690c50859a0ca 100644 (file)
@@ -1,5 +1,10 @@
 2003-05-29  Jim Blandy  <jimb@redhat.com>
 
+       * linux-low.c (usr_store_inferior_registers): Transfer buf in
+       PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
+       if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
+       away part of the register's value.
+
        Add support for Linux on the 64-bit PowerPC.
        * linux-ppc64-low.c: New file.
        * configure.srv (powerpc64-*-linux*): New case.
index 95bf9697739df7fd3b5178420f48e1cdaeab45e2..aad2ecdafa564f9cd639b2632198202cd2ab83cd 100644 (file)
@@ -976,7 +976,7 @@ usr_store_inferior_registers (int regno)
        {
          errno = 0;
          ptrace (PTRACE_POKEUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
-                 *(int *) (buf + i));
+                 *(PTRACE_XFER_TYPE *) (buf + i));
          if (errno != 0)
            {
              if ((*the_low_target.cannot_store_register) (regno) == 0)
@@ -989,7 +989,7 @@ usr_store_inferior_registers (int regno)
                  return;
                }
            }
-         regaddr += sizeof (int);
+         regaddr += sizeof (PTRACE_XFER_TYPE);
        }
     }
   else