diff options
author | Jim Blandy <jimb@codesourcery.com> | 2003-05-29 22:56:50 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2003-05-29 22:56:50 +0000 |
commit | 2ff29de43c961c76891a4fcacf929d544ae54b6b (patch) | |
tree | af6743b0ec404e6ec77169113f7c771209d31921 | |
parent | 93ec1121ede50148a35445689eab133f4381841a (diff) | |
download | gdb-2ff29de43c961c76891a4fcacf929d544ae54b6b.zip gdb-2ff29de43c961c76891a4fcacf929d544ae54b6b.tar.gz gdb-2ff29de43c961c76891a4fcacf929d544ae54b6b.tar.bz2 |
* 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.
-rw-r--r-- | gdb/gdbserver/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/gdbserver/linux-low.c | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 9df8a2a..7e998d0 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +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. + 2003-04-24 Andrew Cagney <cagney@redhat.com> * low-nbsd.c (fetch_inferior_registers): diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 95bf969..aad2ecd 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -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 |