OSDN Git Service

* amd64-tdep.c (amd64_return_value): Change type of readbuf and
authorkettenis <kettenis>
Sat, 14 May 2005 11:27:02 +0000 (11:27 +0000)
committerkettenis <kettenis>
Sat, 14 May 2005 11:27:02 +0000 (11:27 +0000)
writebuf arguments to `gdb_byte *'.  Remove now redundant casts.
* i386-tdep.c (i386_return_value): Change type of readbuf and
writebuf arguments to `gdb_byte *'.
(i386_pseudo_register_read, i386_pseudo_register_write): Change
type of last argument to `gdb_byte *'.
(i386_register_to_value, i386_value_to_register): Change type of
last argument to `gdb_byte *'.  Simplify function a bit.
* i387-tdep.h (i387_value_to_register, i387_register_to_value):
Change type of last argument to `gdb_byte *'.
* i387-tdep.c: Likewise.

gdb/amd64-tdep.c
gdb/i386-tdep.c
gdb/i387-tdep.c
gdb/i387-tdep.h

index d967ae9..fec7fa9 100644 (file)
@@ -406,7 +406,7 @@ amd64_classify (struct type *type, enum amd64_reg_class class[2])
 static enum return_value_convention
 amd64_return_value (struct gdbarch *gdbarch, struct type *type,
                    struct regcache *regcache,
-                   void *readbuf, const void *writebuf)
+                   gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   enum amd64_reg_class class[2];
   int len = TYPE_LENGTH (type);
@@ -503,10 +503,10 @@ amd64_return_value (struct gdbarch *gdbarch, struct type *type,
 
       if (readbuf)
        regcache_raw_read_part (regcache, regnum, offset, min (len, 8),
-                               ((gdb_byte *)readbuf) + i * 8);
+                               readbuf + i * 8);
       if (writebuf)
        regcache_raw_write_part (regcache, regnum, offset, min (len, 8),
-                                ((const gdb_byte *)writebuf) + i * 8);
+                                writebuf + i * 8);
     }
 
   return RETURN_VALUE_REGISTER_CONVENTION;
index f273248..ce2ad81 100644 (file)
@@ -1438,8 +1438,8 @@ i386_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type)
 
 static enum return_value_convention
 i386_return_value (struct gdbarch *gdbarch, struct type *type,
-                  struct regcache *regcache, void *readbuf,
-                  const void *writebuf)
+                  struct regcache *regcache, gdb_byte *readbuf,
+                  const gdb_byte *writebuf)
 {
   enum type_code code = TYPE_CODE (type);
 
@@ -1603,7 +1603,7 @@ i386_mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum)
 
 static void
 i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
-                          int regnum, void *buf)
+                          int regnum, gdb_byte *buf)
 {
   if (i386_mmx_regnum_p (gdbarch, regnum))
     {
@@ -1620,7 +1620,7 @@ i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
 
 static void
 i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
-                           int regnum, const void *buf)
+                           int regnum, const gdb_byte *buf)
 {
   if (i386_mmx_regnum_p (gdbarch, regnum))
     {
@@ -1703,10 +1703,9 @@ i386_convert_register_p (int regnum, struct type *type)
 
 static void
 i386_register_to_value (struct frame_info *frame, int regnum,
-                       struct type *type, void *to)
+                       struct type *type, gdb_byte *to)
 {
   int len = TYPE_LENGTH (type);
-  gdb_byte *buf = to;
 
   /* FIXME: kettenis/20030609: What should we do if REGNUM isn't
      available in FRAME (i.e. if it wasn't saved)?  */
@@ -1726,10 +1725,10 @@ i386_register_to_value (struct frame_info *frame, int regnum,
       gdb_assert (regnum != -1);
       gdb_assert (register_size (current_gdbarch, regnum) == 4);
 
-      get_frame_register (frame, regnum, buf);
+      get_frame_register (frame, regnum, to);
       regnum = i386_next_regnum (regnum);
       len -= 4;
-      buf += 4;
+      to += 4;
     }
 }
 
@@ -1738,10 +1737,9 @@ i386_register_to_value (struct frame_info *frame, int regnum,
 
 static void
 i386_value_to_register (struct frame_info *frame, int regnum,
-                       struct type *type, const void *from)
+                       struct type *type, const gdb_byte *from)
 {
   int len = TYPE_LENGTH (type);
-  const gdb_byte *buf = from;
 
   if (i386_fp_regnum_p (regnum))
     {
@@ -1758,10 +1756,10 @@ i386_value_to_register (struct frame_info *frame, int regnum,
       gdb_assert (regnum != -1);
       gdb_assert (register_size (current_gdbarch, regnum) == 4);
 
-      put_frame_register (frame, regnum, buf);
+      put_frame_register (frame, regnum, from);
       regnum = i386_next_regnum (regnum);
       len -= 4;
-      buf += 4;
+      from += 4;
     }
 }
 \f
index 0d3c988..e48afa7 100644 (file)
@@ -292,7 +292,7 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
 
 void
 i387_register_to_value (struct frame_info *frame, int regnum,
-                       struct type *type, void *to)
+                       struct type *type, gdb_byte *to)
 {
   char from[I386_MAX_REGISTER_SIZE];
 
@@ -317,7 +317,7 @@ i387_register_to_value (struct frame_info *frame, int regnum,
 
 void
 i387_value_to_register (struct frame_info *frame, int regnum,
-                       struct type *type, const void *from)
+                       struct type *type, const gdb_byte *from)
 {
   char to[I386_MAX_REGISTER_SIZE];
 
index 38e6755..a499fcb 100644 (file)
@@ -60,13 +60,13 @@ extern void i387_print_float_info (struct gdbarch *gdbarch,
    return its contents in TO.  */
 
 extern void i387_register_to_value (struct frame_info *frame, int regnum,
-                                   struct type *type, void *to);
+                                   struct type *type, gdb_byte *to);
 
 /* Write the contents FROM of a value of type TYPE into register
    REGNUM in frame FRAME.  */
 
 extern void i387_value_to_register (struct frame_info *frame, int regnum,
-                                   struct type *type, const void *from);
+                                   struct type *type, const gdb_byte *from);
 \f
 
 /* Size of the memory area use by the 'fsave' and 'fxsave'