Reset errno before PTRACE_PEEKUSER for MIPS DSP_CONTROL
authorJames Hogan <james.hogan@imgtec.com>
Mon, 1 Sep 2014 21:48:40 +0000 (22:48 +0100)
committerMaciej W. Rozycki <macro@codesourcery.com>
Wed, 3 Sep 2014 21:09:10 +0000 (22:09 +0100)
commitac740bc7a9103a561329ebf7aa05ff31bcab2267
tree6b3243a23c0c7bddbfcfdbe9eeaa11ee97798f67
parent7d793aa9f0986828d5dde8f3811a7adafc38b6b4
Reset errno before PTRACE_PEEKUSER for MIPS DSP_CONTROL

PTRACE_PEEKUSER can return -1, which is usually used to determine whether
a system call has reported an error, so errno must be used alone to
determine whether an error occurred. However errno isn't modified by a
successful system call so it must be reset to a known value (0) before the
syscall call.

Add the missing errno reset when reading the DSP_CONTROL register in the
native MIPS Linux backend and the MIPS gdbserver backend.

gdb/:
* mips-linux-nat.c (mips_linux_read_description): Reset errno to 0
prior to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.

gdb/gdbserver/:
* linux-mips-low.c (mips_read_description): Reset errno to 0 prior
to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
gdb/ChangeLog
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-mips-low.c
gdb/mips-linux-nat.c
This page took 0.035082 seconds and 4 git commands to generate.