MIPS ptrace build fixes
authorSimon Marchi <simon.marchi@ericsson.com>
Wed, 29 Jul 2015 21:15:46 +0000 (17:15 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Wed, 29 Jul 2015 21:16:20 +0000 (17:16 -0400)
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
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-mips-low.c
gdb/mips-linux-nat.c
gdb/nat/mips-linux-watch.c

index 0c24f0c4e32cf9a2172690fbb03881e8991543f2..8dee2da6b1bc4350093da5b0b7ba7330f119e067 100644 (file)
@@ -1,3 +1,10 @@
+2015-07-29  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * 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  <patrick@parcs.ath.cx>
 
        * top.c: Include "tui/tui.h".
index 5b4236a9ab1b457b6ac218d5b195430b7edb3686..2e039b5479e4795a4c003806fff6e9bf4c94fb41 100644 (file)
@@ -1,3 +1,8 @@
+2015-07-29  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * linux-mips-low.c (mips_linux_prepare_to_resume): Add NULL as
+       ptrace's 4th parameter.
+
 2015-07-27  Yao Qi  <yao.qi@linaro.org>
 
        * configure.srv (case aarch64*-*-linux*): Don't set
index d3b01d61f957025c78a185c4f5a7568eff71a9e2..770f0df52d503e651551c3f7c4d23ec83bcb2d19 100644 (file)
@@ -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");
        }
 
index 961cb6f8636af79fc0c35b5750fc8ef4360ec5ab..6df618d380fded8e9c384c57b2345f35ec7f1a2c 100644 (file)
@@ -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"));
 }
 
index 02d83f65bf892d1707e0e52757f892f830e12fff..231dbe02a3061502dee602bbb4de30ca816faa39 100644 (file)
@@ -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;
This page took 0.058234 seconds and 4 git commands to generate.