* linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
authorThiago Jung Bauermann <bauerman@br.ibm.com>
Tue, 24 Apr 2012 15:03:43 +0000 (15:03 +0000)
committerThiago Jung Bauermann <bauerman@br.ibm.com>
Tue, 24 Apr 2012 15:03:43 +0000 (15:03 +0000)
(PTRACE_ARG4_TYPE): Likewise.
(PTRACE_XFER_TYPE): Likewise.
* linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
ptrace to PTRACE_ARG3_TYPE.
* linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
(PTRACE_ARG4_TYPE): Likewise.
(PTRACE_XFER_TYPE): Likewise.
(linux_detach_one_lwp): Cast fourth argument of
ptrace to long then PTRACE_ARG4_TYPE.
(regsets_fetch_inferior_registers): Cast third argument of
ptrace to long then PTRACE_ARG3_TYPE.
(regsets_store_inferior_registers): Likewise.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-arm-low.c
gdb/gdbserver/linux-low.c
gdb/gdbserver/linux-low.h

index d584b29e7cf8a3a7e00819e59785699bcbc2d998..739b99eac56440c160b1252421b9ae7e5bd1a8e2 100644 (file)
@@ -1,3 +1,19 @@
+2012-04-24  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
+
+       * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
+       (PTRACE_ARG4_TYPE): Likewise.
+       (PTRACE_XFER_TYPE): Likewise.
+       * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
+       ptrace to PTRACE_ARG3_TYPE.
+       * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
+       (PTRACE_ARG4_TYPE): Likewise.
+       (PTRACE_XFER_TYPE): Likewise.
+       (linux_detach_one_lwp): Cast fourth argument of
+       ptrace to long then PTRACE_ARG4_TYPE.
+       (regsets_fetch_inferior_registers): Cast third argument of
+       ptrace to long then PTRACE_ARG3_TYPE.
+       (regsets_store_inferior_registers): Likewise.
+
 2012-04-20  Pedro Alves  <palves@redhat.com>
 
        * configure: Regenerate.
index bf1792bf9e08d1f6fd0a47ddfebfaebb9bffe884..c4d2000c3b179727910d61dd1b2dc335fc7b7a74 100644 (file)
@@ -709,13 +709,15 @@ arm_prepare_to_resume (struct lwp_info *lwp)
        errno = 0;
 
        if (arm_hwbp_control_is_enabled (proc_info->bpts[i].control))
-         if (ptrace (PTRACE_SETHBPREGS, pid, ((i << 1) + 1),
-             &proc_info->bpts[i].address) < 0)
+         if (ptrace (PTRACE_SETHBPREGS, pid,
+                     (PTRACE_ARG3_TYPE) ((i << 1) + 1),
+                     &proc_info->bpts[i].address) < 0)
            perror_with_name ("Unexpected error setting breakpoint address");
 
        if (arm_hwbp_control_is_initialized (proc_info->bpts[i].control))
-         if (ptrace (PTRACE_SETHBPREGS, pid, ((i << 1) + 2),
-             &proc_info->bpts[i].control) < 0)
+         if (ptrace (PTRACE_SETHBPREGS, pid,
+                     (PTRACE_ARG3_TYPE) ((i << 1) + 2),
+                     &proc_info->bpts[i].control) < 0)
            perror_with_name ("Unexpected error setting breakpoint");
 
        lwp_info->bpts_changed[i] = 0;
@@ -727,13 +729,15 @@ arm_prepare_to_resume (struct lwp_info *lwp)
        errno = 0;
 
        if (arm_hwbp_control_is_enabled (proc_info->wpts[i].control))
-         if (ptrace (PTRACE_SETHBPREGS, pid, -((i << 1) + 1),
-             &proc_info->wpts[i].address) < 0)
+         if (ptrace (PTRACE_SETHBPREGS, pid,
+                     (PTRACE_ARG3_TYPE) -((i << 1) + 1),
+                     &proc_info->wpts[i].address) < 0)
            perror_with_name ("Unexpected error setting watchpoint address");
 
        if (arm_hwbp_control_is_initialized (proc_info->wpts[i].control))
-         if (ptrace (PTRACE_SETHBPREGS, pid, -((i << 1) + 2),
-             &proc_info->wpts[i].control) < 0)
+         if (ptrace (PTRACE_SETHBPREGS, pid,
+                     (PTRACE_ARG3_TYPE) -((i << 1) + 2),
+                     &proc_info->wpts[i].control) < 0)
            perror_with_name ("Unexpected error setting watchpoint");
 
        lwp_info->wpts_changed[i] = 0;
index 35d7e69f865c049c236bcdd2c90ba6fd15973a82..bbb06934024669ab292e6affbfe68aa0976bee20 100644 (file)
@@ -241,10 +241,6 @@ struct pending_signals
   struct pending_signals *prev;
 };
 
-#define PTRACE_ARG3_TYPE void *
-#define PTRACE_ARG4_TYPE void *
-#define PTRACE_XFER_TYPE long
-
 #ifdef HAVE_LINUX_REGSETS
 static char *disabled_regsets;
 static int num_regsets;
@@ -1157,7 +1153,8 @@ linux_detach_one_lwp (struct inferior_list_entry *entry, void *args)
   /* Finally, let it resume.  */
   if (the_low_target.prepare_to_resume != NULL)
     the_low_target.prepare_to_resume (lwp);
-  if (ptrace (PTRACE_DETACH, lwpid_of (lwp), 0, sig) < 0)
+  if (ptrace (PTRACE_DETACH, lwpid_of (lwp), 0,
+             (PTRACE_ARG4_TYPE) (long) sig) < 0)
     error (_("Can't detach %s: %s"),
           target_pid_to_str (ptid_of (lwp)),
           strerror (errno));
@@ -3997,7 +3994,8 @@ regsets_fetch_inferior_registers (struct regcache *regcache)
        data = buf;
 
 #ifndef __sparc__
-      res = ptrace (regset->get_request, pid, nt_type, data);
+      res = ptrace (regset->get_request, pid,
+                   (PTRACE_ARG3_TYPE) (long) nt_type, data);
 #else
       res = ptrace (regset->get_request, pid, data, nt_type);
 #endif
@@ -4070,7 +4068,8 @@ regsets_store_inferior_registers (struct regcache *regcache)
        data = buf;
 
 #ifndef __sparc__
-      res = ptrace (regset->get_request, pid, nt_type, data);
+      res = ptrace (regset->get_request, pid,
+                   (PTRACE_ARG3_TYPE) (long) nt_type, data);
 #else
       res = ptrace (regset->get_request, pid, data, nt_type);
 #endif
@@ -4082,7 +4081,8 @@ regsets_store_inferior_registers (struct regcache *regcache)
 
          /* Only now do we write the register set.  */
 #ifndef __sparc__
-         res = ptrace (regset->set_request, pid, nt_type, data);
+         res = ptrace (regset->set_request, pid,
+                       (PTRACE_ARG3_TYPE) (long) nt_type, data);
 #else
          res = ptrace (regset->set_request, pid, data, nt_type);
 #endif
index a1a6777ddc8d88e357cf1e09474f53a9171199d4..82b33998ba5aed692e50cc9ac89f737af7bd3d41 100644 (file)
 
 #include "gdb_proc_service.h"
 
+#define PTRACE_ARG3_TYPE void *
+#define PTRACE_ARG4_TYPE void *
+#define PTRACE_XFER_TYPE long
+
 #ifdef HAVE_LINUX_REGSETS
 typedef void (*regset_fill_func) (struct regcache *, void *);
 typedef void (*regset_store_func) (struct regcache *, const void *);
This page took 0.034978 seconds and 4 git commands to generate.