* inf-ptrace.c: Include "gdb_stdint.h".
authorUlrich Weigand <uweigand@de.ibm.com>
Fri, 27 Apr 2007 13:20:59 +0000 (13:20 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Fri, 27 Apr 2007 13:20:59 +0000 (13:20 +0000)
(inf_ptrace_xfer_partial): Use "uintptr_t" instead of "long" as
intermediate type when casting CORE_ADDR to PTRACE_TYPE_ARG3.
(inf_ptrace_fetch_register): Add intermediate cast to "uintptr_t"
before casting CORE_ADDR to PTRACE_TYPE_ARG3.
(inf_ptrace_store_register): Likewise.
* Makefile.in (inf-ptrace.o): Update dependencies.

gdb/ChangeLog
gdb/Makefile.in
gdb/inf-ptrace.c

index 7cc195fcac9e0eda09d3d58db225f733a8cae864..9d8b79f3f54c787853257e9eb96a31946f5f6f46 100644 (file)
@@ -1,3 +1,13 @@
+2007-04-27  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * inf-ptrace.c: Include "gdb_stdint.h".
+       (inf_ptrace_xfer_partial): Use "uintptr_t" instead of "long" as 
+       intermediate type when casting CORE_ADDR to PTRACE_TYPE_ARG3.
+       (inf_ptrace_fetch_register): Add intermediate cast to "uintptr_t"
+       before casting CORE_ADDR to PTRACE_TYPE_ARG3.
+       (inf_ptrace_store_register): Likewise.
+       * Makefile.in (inf-ptrace.o): Update dependencies.
+
 2007-04-27  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * configure.host (rs6000-*-*): Merge with powerpc-*-aix* rules.
index 7cabd60fa61f45a2d0212171fd7ff316d04905c3..2551ea1f8c79f1fc1222c2625d2e3da9bef4346c 100644 (file)
@@ -2170,7 +2170,7 @@ inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \
        $(serial_h) $(terminal_h) $(target_h) $(gdbthread_h) $(gdb_string_h) \
        $(inflow_h) $(gdb_select_h)
 inf-ptrace.o: inf-ptrace.c $(defs_h) $(command_h) $(inferior_h) $(inflow_h) \
-       $(gdbcore_h) $(regcache_h) $(gdb_assert_h) \
+       $(gdbcore_h) $(regcache_h) $(gdb_stdint_h) $(gdb_assert_h) \
        $(gdb_string_h) $(gdb_ptrace_h) $(gdb_wait_h) $(inf_child_h)
 infptrace.o: infptrace.c $(defs_h) $(command_h) $(frame_h) $(gdbcore_h) \
        $(inferior_h) $(regcache_h) $(target_h) $(gdb_assert_h) \
index 16524ad83eeaf3cf9f3a8717055b42138ccf6d4c..bef45b58ca1a2676ff4cdd1a2a69ea0ee1648197 100644 (file)
@@ -28,6 +28,7 @@
 #include "gdbcore.h"
 #include "regcache.h"
 
+#include "gdb_stdint.h"
 #include "gdb_assert.h"
 #include "gdb_string.h"
 #include "gdb_ptrace.h"
@@ -504,7 +505,8 @@ inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
                    < rounded_offset + sizeof (PTRACE_TYPE_RET)))
              /* Need part of initial word -- fetch it.  */
              buffer.word = ptrace (PT_READ_I, pid,
-                                   (PTRACE_TYPE_ARG3)(long)rounded_offset, 0);
+                                   (PTRACE_TYPE_ARG3)(uintptr_t)
+                                   rounded_offset, 0);
 
            /* Copy data to be written over corresponding part of
               buffer.  */
@@ -513,14 +515,16 @@ inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
 
            errno = 0;
            ptrace (PT_WRITE_D, pid,
-                   (PTRACE_TYPE_ARG3)(long)rounded_offset, buffer.word);
+                   (PTRACE_TYPE_ARG3)(uintptr_t)rounded_offset,
+                   buffer.word);
            if (errno)
              {
                /* Using the appropriate one (I or D) is necessary for
                   Gould NP1, at least.  */
                errno = 0;
                ptrace (PT_WRITE_I, pid,
-                       (PTRACE_TYPE_ARG3)(long)rounded_offset, buffer.word);
+                       (PTRACE_TYPE_ARG3)(uintptr_t)rounded_offset,
+                       buffer.word);
                if (errno)
                  return 0;
              }
@@ -530,7 +534,8 @@ inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
          {
            errno = 0;
            buffer.word = ptrace (PT_READ_I, pid,
-                                 (PTRACE_TYPE_ARG3)(long)rounded_offset, 0);
+                                 (PTRACE_TYPE_ARG3)(uintptr_t)rounded_offset,
+                                 0);
            if (errno)
              return 0;
            /* Copy appropriate bytes out of the buffer.  */
@@ -642,7 +647,7 @@ inf_ptrace_fetch_register (int regnum)
   for (i = 0; i < size / sizeof (PTRACE_TYPE_RET); i++)
     {
       errno = 0;
-      buf[i] = ptrace (PT_READ_U, pid, (PTRACE_TYPE_ARG3)addr, 0);
+      buf[i] = ptrace (PT_READ_U, pid, (PTRACE_TYPE_ARG3)(uintptr_t)addr, 0);
       if (errno != 0)
        error (_("Couldn't read register %s (#%d): %s."),
               REGISTER_NAME (regnum), regnum, safe_strerror (errno));
@@ -696,7 +701,7 @@ inf_ptrace_store_register (int regnum)
   for (i = 0; i < size / sizeof (PTRACE_TYPE_RET); i++)
     {
       errno = 0;
-      ptrace (PT_WRITE_U, pid, (PTRACE_TYPE_ARG3)addr, buf[i]);
+      ptrace (PT_WRITE_U, pid, (PTRACE_TYPE_ARG3)(uintptr_t)addr, buf[i]);
       if (errno != 0)
        error (_("Couldn't write register %s (#%d): %s."),
               REGISTER_NAME (regnum), regnum, safe_strerror (errno));