This is the mail archive of the gdb-patches@sourceware.org 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]

PATCH: Build sh-elf with -Werror


Hi all,

Following my recent mistake with the -batch-silent patch I thought I had better check I hadn't missed anything else due to my forgetting '--enable-gdb-build-warnings=,-Werror'.

I found that I had not, but that the sh-elf debugger wouldn't build due to pre-existing problems. I guess nobody is interested in sh-elf or everybody forgets Werror.

The attached patch fixes the problems. Note that monitor.c actually did build because it is never built with Werror, but not all the warnings were unavoidable.

Andrew Stubbs
2005-11-02  Andrew Stubbs  <andrew.stubbs@st.com>

	* monitor.c (monitor_xfer_memory): Change char to gdb_byte.
	(monitor_insert_breakpoint): Likewise.
	(monitor_remove_breakpoint): Likewise.
	* remote-e7000.c (e7000_xfer_inferior_memory): Likewise.
	* sh-tdep.c (sh_return_value_nofpu): Change void to gdb_byte.
	(sh_return_value_fpu): Likewise.
	(sh_pseudo_register_read): Likewise.
	(sh_pseudo_register_write): Likewise.
	(sh_frame_prev_register): Likewise.
	* sh64-tdep.c (sh64_extract_return_value): Change char to gdb_byte.
	(sh64_return_value): Change void to gdb_byte.
	(sh64_pseudo_register_read): Likewise.
	(sh64_pseudo_register_write): Likewise.
	(sh64_frame_prev_register): Likewise.

Index: src/gdb/monitor.c
===================================================================
--- src.orig/gdb/monitor.c	2005-02-18 18:58:56.000000000 +0000
+++ src/gdb/monitor.c	2005-11-02 14:09:31.000000000 +0000
@@ -80,13 +80,13 @@ static ptid_t monitor_wait (ptid_t ptid,
 static void monitor_fetch_registers (int regno);
 static void monitor_store_registers (int regno);
 static void monitor_prepare_to_store (void);
-static int monitor_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
+static int monitor_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
 				int write, 
 				struct mem_attrib *attrib,
 				struct target_ops *target);
 static void monitor_files_info (struct target_ops *ops);
-static int monitor_insert_breakpoint (CORE_ADDR addr, char *shadow);
-static int monitor_remove_breakpoint (CORE_ADDR addr, char *shadow);
+static int monitor_insert_breakpoint (CORE_ADDR addr, gdb_byte *shadow);
+static int monitor_remove_breakpoint (CORE_ADDR addr, gdb_byte *shadow);
 static void monitor_kill (void);
 static void monitor_load (char *file, int from_tty);
 static void monitor_mourn_inferior (void);
@@ -1982,7 +1982,7 @@ monitor_read_memory (CORE_ADDR memaddr, 
    unused. */
 
 static int
-monitor_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+monitor_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
 		     struct mem_attrib *attrib, struct target_ops *target)
 {
   int res;
@@ -2038,7 +2038,7 @@ monitor_mourn_inferior (void)
 /* Tell the monitor to add a breakpoint.  */
 
 static int
-monitor_insert_breakpoint (CORE_ADDR addr, char *shadow)
+monitor_insert_breakpoint (CORE_ADDR addr, gdb_byte *shadow)
 {
   int i;
   const unsigned char *bp;
@@ -2072,7 +2072,7 @@ monitor_insert_breakpoint (CORE_ADDR add
 /* Tell the monitor to remove a breakpoint.  */
 
 static int
-monitor_remove_breakpoint (CORE_ADDR addr, char *shadow)
+monitor_remove_breakpoint (CORE_ADDR addr, gdb_byte *shadow)
 {
   int i;
 
Index: src/gdb/remote-e7000.c
===================================================================
--- src.orig/gdb/remote-e7000.c	2005-05-01 20:58:54.000000000 +0100
+++ src/gdb/remote-e7000.c	2005-11-02 14:10:25.000000000 +0000
@@ -1478,7 +1478,7 @@ fast_but_for_the_pause_e7000_read_inferi
    Returns the number of bytes transferred. */
 
 static int
-e7000_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
+e7000_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
 			    int write, struct mem_attrib *attrib,
 			    struct target_ops *target)
 {
Index: src/gdb/sh-tdep.c
===================================================================
--- src.orig/gdb/sh-tdep.c	2005-11-02 13:36:09.000000000 +0000
+++ src/gdb/sh-tdep.c	2005-11-02 13:56:23.000000000 +0000
@@ -1286,7 +1286,7 @@ sh_store_return_value_fpu (struct type *
 static enum return_value_convention
 sh_return_value_nofpu (struct gdbarch *gdbarch, struct type *type,
 		       struct regcache *regcache,
-		       void *readbuf, const void *writebuf)
+		       gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (sh_use_struct_convention (0, type))
     return RETURN_VALUE_STRUCT_CONVENTION;
@@ -1300,7 +1300,7 @@ sh_return_value_nofpu (struct gdbarch *g
 static enum return_value_convention
 sh_return_value_fpu (struct gdbarch *gdbarch, struct type *type,
 		     struct regcache *regcache,
-		     void *readbuf, const void *writebuf)
+		     gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (sh_use_struct_convention (0, type))
     return RETURN_VALUE_STRUCT_CONVENTION;
@@ -1936,7 +1936,7 @@ dr_reg_base_num (int dr_regnum)
 
 static void
 sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
-			 int reg_nr, void *buffer)
+			 int reg_nr, gdb_byte *buffer)
 {
   int base_regnum, portion;
   char temp_buffer[MAX_REGISTER_SIZE];
@@ -1975,7 +1975,7 @@ sh_pseudo_register_read (struct gdbarch 
 
 static void
 sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
-			  int reg_nr, const void *buffer)
+			  int reg_nr, const gdb_byte *buffer)
 {
   int base_regnum, portion;
   char temp_buffer[MAX_REGISTER_SIZE];
@@ -2328,7 +2328,7 @@ static void
 sh_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 sh_frame_cache *cache = sh_frame_cache (next_frame, this_cache);
 
Index: src/gdb/sh64-tdep.c
===================================================================
--- src.orig/gdb/sh64-tdep.c	2005-05-02 16:23:37.000000000 +0100
+++ src/gdb/sh64-tdep.c	2005-11-02 14:02:11.000000000 +0000
@@ -1228,9 +1228,9 @@ sh64_extract_return_value (struct type *
 	{
 	  /* return value stored in DR0_REGNUM */
 	  DOUBLEST val;
-	  char buf[8];
+	  gdb_byte buf[8];
 
-	  regcache_cooked_read (regcache, DR0_REGNUM, &buf);
+	  regcache_cooked_read (regcache, DR0_REGNUM, buf);
 	  
 	  if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
 	    floatformat_to_doublest (&floatformat_ieee_double_littlebyte_bigword,
@@ -1313,7 +1313,7 @@ sh64_store_return_value (struct type *ty
 static enum return_value_convention
 sh64_return_value (struct gdbarch *gdbarch, struct type *type,
 		   struct regcache *regcache,
-		   void *readbuf, const void *writebuf)
+		   gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (sh64_use_struct_convention (type))
     return RETURN_VALUE_STRUCT_CONVENTION;
@@ -1575,7 +1575,7 @@ sh64_register_convert_to_raw (struct typ
 
 static void
 sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
-			   int reg_nr, void *buffer)
+			   int reg_nr, gdb_byte *buffer)
 {
   int base_regnum;
   int portion;
@@ -1744,7 +1744,7 @@ sh64_pseudo_register_read (struct gdbarc
 
 static void
 sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
-			    int reg_nr, const void *buffer)
+			    int reg_nr, const gdb_byte *buffer)
 {
   int base_regnum, portion;
   int offset;
@@ -2290,7 +2290,7 @@ static void
 sh64_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 sh64_frame_cache *cache = sh64_frame_cache (next_frame, this_cache);
 

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