This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ob] Fix up some gcc 3.3.x warnings that have crept in to i686-pc-linux-gnu


It would be nice if we could fix the new GCC 4.x warnings without
introducing lots of new warnings at the same time... A lot of GCC 3.3.x
warnings have appeared in the last couple of weeks.  I realize this is
sometimes hard to do, and basically impossible for the *-nat.c files,
so I'll just tag along and fix them as I notice them.

The major culprits in this batch were the changed prototypes for
to_insert_hw_breakpoint, to_remove_hw_breakpoint, and
frame_unwind:prev_register.  The last one probably affects all targets.

This patch fixes -Werror for native i386-pc-linux-gnu.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

2005-05-28  Daniel Jacobowitz  <dan@codesourcery.com>

	* dwarf2-frame.c (dwarf2_frame_prev_register): Use gdb_byte.
	* i386-linux-nat.c (fetch_register, store_register, supply_gregset)
	(fill_gregset): Likewise.
	* i386-tdep.c (i386_frame_prev_register)
	(i386_sigtramp_frame_prev_register): Likewise.
	* linux-nat.c (linux_nat_xfer_memory, linux_nat_make_corefile_notes):
	Likewise.
	* linux-thread-db.c (thread_db_xfer_memory): Likewise.
	* remote.c (remote_insert_hw_breakpoint, remote_remove_hw_breakpoint):
	Likewise.
	* target.c (debug_to_insert_hw_breakpoint)
	(debug_to_remove_hw_breakpoint, update_current_target): Likewise.

Index: dwarf2-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
retrieving revision 1.51
diff -u -p -r1.51 dwarf2-frame.c
--- dwarf2-frame.c	8 Apr 2005 12:10:21 -0000	1.51
+++ dwarf2-frame.c	28 May 2005 16:39:35 -0000
@@ -821,7 +821,7 @@ static void
 dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
 			    int regnum, int *optimizedp,
 			    enum lval_type *lvalp, CORE_ADDR *addrp,
-			    int *realnump, void *valuep)
+			    int *realnump, gdb_byte *valuep)
 {
   struct gdbarch *gdbarch = get_frame_arch (next_frame);
   struct dwarf2_frame_cache *cache =
Index: i386-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v
retrieving revision 1.63
diff -u -p -r1.63 i386-linux-nat.c
--- i386-linux-nat.c	11 Feb 2005 18:13:50 -0000	1.63
+++ i386-linux-nat.c	28 May 2005 16:39:36 -0000
@@ -183,7 +183,7 @@ fetch_register (int regno)
     error (_("Couldn't read register %s (#%d): %s."), REGISTER_NAME (regno),
 	   regno, safe_strerror (errno));
 
-  regcache_raw_supply (current_regcache, regno, &val);
+  regcache_raw_supply (current_regcache, regno, (gdb_byte *) &val);
 }
 
 /* Store one register. */
@@ -204,7 +204,7 @@ store_register (int regno)
     tid = PIDGET (inferior_ptid); /* Not a threaded program.  */
 
   errno = 0;
-  regcache_raw_collect (current_regcache, regno, &val);
+  regcache_raw_collect (current_regcache, regno, (gdb_byte *) &val);
   ptrace (PTRACE_POKEUSER, tid, register_addr (regno, 0), val);
   if (errno != 0)
     error (_("Couldn't write register %s (#%d): %s."), REGISTER_NAME (regno),
@@ -225,11 +225,11 @@ supply_gregset (elf_gregset_t *gregsetp)
   int i;
 
   for (i = 0; i < I386_NUM_GREGS; i++)
-    regcache_raw_supply (current_regcache, i, regp + regmap[i]);
+    regcache_raw_supply (current_regcache, i, (gdb_byte *) (regp + regmap[i]));
 
   if (I386_LINUX_ORIG_EAX_REGNUM < NUM_REGS)
     regcache_raw_supply (current_regcache, I386_LINUX_ORIG_EAX_REGNUM,
-			 regp + ORIG_EAX);
+			 (gdb_byte *) (regp + ORIG_EAX));
 }
 
 /* Fill register REGNO (if it is a general-purpose register) in
@@ -244,12 +244,12 @@ fill_gregset (elf_gregset_t *gregsetp, i
 
   for (i = 0; i < I386_NUM_GREGS; i++)
     if (regno == -1 || regno == i)
-      regcache_raw_collect (current_regcache, i, regp + regmap[i]);
+      regcache_raw_collect (current_regcache, i, (gdb_byte *) (regp + regmap[i]));
 
   if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
       && I386_LINUX_ORIG_EAX_REGNUM < NUM_REGS)
     regcache_raw_collect (current_regcache, I386_LINUX_ORIG_EAX_REGNUM,
-			  regp + ORIG_EAX);
+			  (gdb_byte *) (regp + ORIG_EAX));
 }
 
 #ifdef HAVE_PTRACE_GETREGS
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.212
diff -u -p -r1.212 i386-tdep.c
--- i386-tdep.c	14 May 2005 19:46:10 -0000	1.212
+++ i386-tdep.c	28 May 2005 16:39:37 -0000
@@ -937,7 +937,7 @@ static void
 i386_frame_prev_register (struct frame_info *next_frame, void **this_cache,
 			  int regnum, int *optimizedp,
 			  enum lval_type *lvalp, CORE_ADDR *addrp,
-			  int *realnump, void *valuep)
+			  int *realnump, gdb_byte *valuep)
 {
   struct i386_frame_cache *cache = i386_frame_cache (next_frame, this_cache);
 
@@ -1099,7 +1099,7 @@ i386_sigtramp_frame_prev_register (struc
 				   void **this_cache,
 				   int regnum, int *optimizedp,
 				   enum lval_type *lvalp, CORE_ADDR *addrp,
-				   int *realnump, void *valuep)
+				   int *realnump, gdb_byte *valuep)
 {
   /* Make sure we've initialized the cache.  */
   i386_sigtramp_frame_cache (next_frame, this_cache);
Index: linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.29
diff -u -p -r1.29 linux-nat.c
--- linux-nat.c	23 May 2005 21:19:48 -0000	1.29
+++ linux-nat.c	28 May 2005 16:39:38 -0000
@@ -2326,8 +2326,9 @@ linux_nat_mourn_inferior (void)
 }
 
 static int
-linux_nat_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
-		     struct mem_attrib *attrib, struct target_ops *target)
+linux_nat_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
+		       int write, struct mem_attrib *attrib,
+		       struct target_ops *target)
 {
   struct cleanup *old_chain = save_inferior_ptid ();
   int xfer;
@@ -2621,7 +2622,7 @@ linux_nat_make_corefile_notes (bfd *obfd
   char psargs[80] = { '\0' };
   char *note_data = NULL;
   ptid_t current_ptid = inferior_ptid;
-  char *auxv;
+  gdb_byte *auxv;
   int auxv_len;
 
   if (get_exec_file (0))
Index: linux-thread-db.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-thread-db.c,v
retrieving revision 1.8
diff -u -p -r1.8 linux-thread-db.c
--- linux-thread-db.c	26 Apr 2005 14:57:21 -0000	1.8
+++ linux-thread-db.c	28 May 2005 16:39:38 -0000
@@ -962,7 +962,7 @@ thread_db_wait (ptid_t ptid, struct targ
 }
 
 static int
-thread_db_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+thread_db_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
 		       struct mem_attrib *attrib, struct target_ops *target)
 {
   struct cleanup *old_chain = save_inferior_ptid ();
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.190
diff -u -p -r1.190 remote.c
--- remote.c	16 May 2005 16:36:24 -0000	1.190
+++ remote.c	28 May 2005 16:39:41 -0000
@@ -4728,7 +4728,7 @@ remote_stopped_data_address (struct targ
 
 
 static int
-remote_insert_hw_breakpoint (CORE_ADDR addr, char *shadow)
+remote_insert_hw_breakpoint (CORE_ADDR addr, gdb_byte *shadow)
 {
   int len = 0;
   struct remote_state *rs = get_remote_state ();
@@ -4770,7 +4770,7 @@ remote_insert_hw_breakpoint (CORE_ADDR a
 
 
 static int
-remote_remove_hw_breakpoint (CORE_ADDR addr, char *shadow)
+remote_remove_hw_breakpoint (CORE_ADDR addr, gdb_byte *shadow)
 {
   int len;
   struct remote_state *rs = get_remote_state ();
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.108
diff -u -p -r1.108 target.c
--- target.c	16 May 2005 16:36:24 -0000	1.108
+++ target.c	28 May 2005 16:39:43 -0000
@@ -116,9 +116,9 @@ static int debug_to_remove_breakpoint (C
 
 static int debug_to_can_use_hw_breakpoint (int, int, int);
 
-static int debug_to_insert_hw_breakpoint (CORE_ADDR, char *);
+static int debug_to_insert_hw_breakpoint (CORE_ADDR, gdb_byte *);
 
-static int debug_to_remove_hw_breakpoint (CORE_ADDR, char *);
+static int debug_to_remove_hw_breakpoint (CORE_ADDR, gdb_byte *);
 
 static int debug_to_insert_watchpoint (CORE_ADDR, int, int);
 
@@ -514,10 +514,10 @@ update_current_target (void)
 	    (int (*) (int, int, int))
 	    return_zero);
   de_fault (to_insert_hw_breakpoint,
-	    (int (*) (CORE_ADDR, char *))
+	    (int (*) (CORE_ADDR, gdb_byte *))
 	    return_minus_one);
   de_fault (to_remove_hw_breakpoint,
-	    (int (*) (CORE_ADDR, char *))
+	    (int (*) (CORE_ADDR, gdb_byte *))
 	    return_minus_one);
   de_fault (to_insert_watchpoint,
 	    (int (*) (CORE_ADDR, int, int))
@@ -2136,7 +2136,7 @@ debug_to_stopped_data_address (struct ta
 }
 
 static int
-debug_to_insert_hw_breakpoint (CORE_ADDR addr, char *save)
+debug_to_insert_hw_breakpoint (CORE_ADDR addr, gdb_byte *save)
 {
   int retval;
 
@@ -2150,7 +2150,7 @@ debug_to_insert_hw_breakpoint (CORE_ADDR
 }
 
 static int
-debug_to_remove_hw_breakpoint (CORE_ADDR addr, char *save)
+debug_to_remove_hw_breakpoint (CORE_ADDR addr, gdb_byte *save)
 {
   int retval;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]