From 50275556916ee2979672cab1cfd3e8d58f3b0779 Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Tue, 6 Dec 2011 23:09:08 +0000 Subject: [PATCH] * linux-low.c (fetch_register, store_register): Make code consistent, fix formatting. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/linux-low.c | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 601decfd771..edfaebab1a4 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2011-12-06 Maciej W. Rozycki + + * linux-low.c (fetch_register, store_register): Make code + consistent, fix formatting. + 2011-12-06 Maciej W. Rozycki * linux-low.c (usr_store_inferior_registers): Factor out code diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index df711035a0a..4b5279c3f73 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -3745,10 +3745,11 @@ fetch_register (struct regcache *regcache, int regno) if (regaddr == -1) return; - pid = lwpid_of (get_thread_lwp (current_inferior)); size = ((register_size (regno) + sizeof (PTRACE_XFER_TYPE) - 1) - & - sizeof (PTRACE_XFER_TYPE)); + & -sizeof (PTRACE_XFER_TYPE)); buf = alloca (size); + + pid = lwpid_of (get_thread_lwp (current_inferior)); for (i = 0; i < size; i += sizeof (PTRACE_XFER_TYPE)) { errno = 0; @@ -3779,16 +3780,15 @@ store_register (struct regcache *regcache, int regno) if (regno >= the_low_target.num_regs) return; - - if ((*the_low_target.cannot_store_register) (regno) == 1) + if ((*the_low_target.cannot_store_register) (regno)) return; regaddr = register_addr (regno); if (regaddr == -1) return; - errno = 0; - size = (register_size (regno) + sizeof (PTRACE_XFER_TYPE) - 1) - & - sizeof (PTRACE_XFER_TYPE); + + size = ((register_size (regno) + sizeof (PTRACE_XFER_TYPE) - 1) + & -sizeof (PTRACE_XFER_TYPE)); buf = alloca (size); memset (buf, 0, size); -- 2.30.2