This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH v2] Reset errno before PTRACE_PEEKUSER for MIPS DSP_CONTROL
- From: James Hogan <james dot hogan at imgtec dot com>
- To: "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 3 Sep 2014 13:51:11 +0100
- Subject: Re: [PATCH v2] Reset errno before PTRACE_PEEKUSER for MIPS DSP_CONTROL
- Authentication-results: sourceware.org; auth=none
- References: <1409608120-23991-1-git-send-email-james dot hogan at imgtec dot com> <alpine dot DEB dot 1 dot 10 dot 1409031340130 dot 27075 at tp dot orcam dot me dot uk>
On Wed, Sep 03, 2014 at 01:41:29PM +0100, Maciej W. Rozycki wrote:
> On Mon, 1 Sep 2014, James Hogan wrote:
> > 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.
> This is fine, go ahead and apply it. Thanks.
Thanks for reviewing it Maciej.
This is my first GDB patch submitted upstream (although I have a pile of
RFC patches for FR=1, FRE=1, MSA support I'm still getting into shape),
so I don't have push access yet. Is it easy to arrange?