From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59243 invoked by alias); 29 Jul 2015 21:26:31 -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 59228 invoked by uid 89); 29 Jul 2015 21:26:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg21.ericsson.net Received: from usevmg21.ericsson.net (HELO usevmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 29 Jul 2015 21:26:29 +0000 Received: from EUSAAHC004.ericsson.se (Unknown_Domain [147.117.188.84]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id BB.BD.00712.79CD8B55; Wed, 29 Jul 2015 16:00:55 +0200 (CEST) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.86) with Microsoft SMTP Server id 14.3.210.2; Wed, 29 Jul 2015 17:26:26 -0400 Message-ID: <55B94502.4080000@ericsson.com> Date: Wed, 29 Jul 2015 21:26:00 -0000 From: Simon Marchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: CC: , Brendan Kirby , Sergio Durigan Junior Subject: Re: [PATCH obv/pushed] MIPS ptrace build fixes References: <1438204741-24808-1-git-send-email-simon.marchi@ericsson.com> In-Reply-To: <1438204741-24808-1-git-send-email-simon.marchi@ericsson.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00887.txt.bz2 On 15-07-29 05:19 PM, Simon Marchi wrote: > FYI, I am pushing this as obvious. > > Since Pedro's ptrace cleanups, the MIPS buildbot compilation fails. > Code in MIPS native uses ptrace with 3 arguments, where ptrace requires > 4. When looking at the definition of ptrace in > /usr/include/sys/ptrace.h, it shows that it takes a variable number of > arguments. The wrapper macro in nat/gdb_ptrace.h takes a fixed number > of arguments (4). That would explain why it used to work and stopped. > > I am pushing this as obvious, tell me if there is any problem. > > I built-tested this with a MIPS toolchain (ct-ng), but I don't have any > setup to test it. At least it should put back the buildbot builder in a > better shape. > > gdb/ChangeLog: > > * mips-linux-nat.c (write_watchpoint_regs): Add NULL as ptrace's 4th > parameter. > (mips_linux_new_thread): Likewise. > * nat/mips-linux-watch.c (mips_linux_read_watch_registers): Likewise. > > gdb/gdbserver/ChangeLog: > > * linux-mips-low.c (mips_linux_prepare_to_resume): Add NULL as > ptrace's 4th parameter. > --- > gdb/ChangeLog | 7 +++++++ > gdb/gdbserver/ChangeLog | 5 +++++ > gdb/gdbserver/linux-mips-low.c | 2 +- > gdb/mips-linux-nat.c | 4 ++-- > gdb/nat/mips-linux-watch.c | 2 +- > 5 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index 0c24f0c..8dee2da 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,10 @@ > +2015-07-29 Simon Marchi > + > + * mips-linux-nat.c (write_watchpoint_regs): Add NULL as ptrace's 4th > + parameter. > + (mips_linux_new_thread): Likewise. > + * nat/mips-linux-watch.c (mips_linux_read_watch_registers): Likewise. > + > 2015-07-29 Patrick Palka > > * top.c: Include "tui/tui.h". > diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog > index 5b4236a..2e039b5 100644 > --- a/gdb/gdbserver/ChangeLog > +++ b/gdb/gdbserver/ChangeLog > @@ -1,3 +1,8 @@ > +2015-07-29 Simon Marchi > + > + * linux-mips-low.c (mips_linux_prepare_to_resume): Add NULL as > + ptrace's 4th parameter. > + > 2015-07-27 Yao Qi > > * configure.srv (case aarch64*-*-linux*): Don't set > diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c > index d3b01d6..770f0df 100644 > --- a/gdb/gdbserver/linux-mips-low.c > +++ b/gdb/gdbserver/linux-mips-low.c > @@ -427,7 +427,7 @@ mips_linux_prepare_to_resume (struct lwp_info *lwp) > int tid = ptid_get_lwp (ptid); > > if (-1 == ptrace (PTRACE_SET_WATCH_REGS, tid, > - &priv->watch_mirror)) > + &priv->watch_mirror, NULL)) > perror_with_name ("Couldn't write watch register"); > } > > diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c > index 961cb6f..6df618d 100644 > --- a/gdb/mips-linux-nat.c > +++ b/gdb/mips-linux-nat.c > @@ -614,7 +614,7 @@ write_watchpoint_regs (void) > ALL_LWPS (lp) > { > tid = ptid_get_lwp (lp->ptid); > - if (ptrace (PTRACE_SET_WATCH_REGS, tid, &watch_mirror) == -1) > + if (ptrace (PTRACE_SET_WATCH_REGS, tid, &watch_mirror, NULL) == -1) > perror_with_name (_("Couldn't write debug register")); > } > return 0; > @@ -634,7 +634,7 @@ mips_linux_new_thread (struct lwp_info *lp) > return; > > tid = ptid_get_lwp (lp->ptid); > - if (ptrace (PTRACE_SET_WATCH_REGS, tid, &watch_mirror) == -1) > + if (ptrace (PTRACE_SET_WATCH_REGS, tid, &watch_mirror, NULL) == -1) > perror_with_name (_("Couldn't write debug register")); > } > > diff --git a/gdb/nat/mips-linux-watch.c b/gdb/nat/mips-linux-watch.c > index 02d83f6..231dbe0 100644 > --- a/gdb/nat/mips-linux-watch.c > +++ b/gdb/nat/mips-linux-watch.c > @@ -164,7 +164,7 @@ mips_linux_read_watch_registers (long lwpid, > { > if (force || *watch_readback_valid == 0) > { > - if (ptrace (PTRACE_GET_WATCH_REGS, lwpid, watch_readback) == -1) > + if (ptrace (PTRACE_GET_WATCH_REGS, lwpid, watch_readback, NULL) == -1) > { > *watch_readback_valid = -1; > return 0; Also, I cancelled the current build as well as all pending builds before this commit on the MIPS builder, in case you were wondering where they all went. There is no point in spending over 24 hours building code we know won't build. Simon