From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31374 invoked by alias); 3 Sep 2014 12:41:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 31360 invoked by uid 89); 3 Sep 2014 12:41:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Sep 2014 12:41:52 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XP9sd-00033V-Pw from Maciej_Rozycki@mentor.com ; Wed, 03 Sep 2014 05:41:46 -0700 Received: from localhost (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.2.247.3; Wed, 3 Sep 2014 13:41:34 +0100 Date: Wed, 03 Sep 2014 12:41:00 -0000 From: "Maciej W. Rozycki" To: James Hogan CC: Subject: Re: [PATCH v2] Reset errno before PTRACE_PEEKUSER for MIPS DSP_CONTROL In-Reply-To: <1409608120-23991-1-git-send-email-james.hogan@imgtec.com> Message-ID: References: <1409608120-23991-1-git-send-email-james.hogan@imgtec.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2014-09/txt/msg00089.txt.bz2 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. Maciej