public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH c++ 04/12] target_ops masK_watchpoint: change int to target_hw_bp_type
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
  2015-11-03 14:26 ` [PATCH c++ 02/12] linux-ppc-low.c: Add casts Simon Marchi
  2015-11-03 14:26 ` [PATCH c++ 03/12] remote-sim.c: " Simon Marchi
@ 2015-11-03 14:26 ` Simon Marchi
  2015-11-03 16:14   ` Pedro Alves
  2015-11-03 14:27 ` [PATCH c++ 09/12] linux-mips-low.c: Fix type of mips_add_watchpoint parameter Simon Marchi
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

Fixes:

/home/simark/src/binutils-gdb/gdb/ppc-linux-nat.c: In function ‘int ppc_linux_insert_mask_watchpoint(target_ops*, CORE_ADDR, CORE_ADDR, int)’:
/home/simark/src/binutils-gdb/gdb/ppc-linux-nat.c:1730:40: error: invalid conversion from ‘int’ to ‘target_hw_bp_type’ [-fpermissive]
   p.trigger_type = get_trigger_type (rw);
                                        ^

gdb/ChangeLog:

	* ppc-linux-nat.c (ppc_linux_insert_mask_watchpoint): Change
	type of rw to enum target_hw_bp_type.
	(ppc_linux_remove_mask_watchpoint): Likewise.
	* target.c (target_insert_mask_watchpoint): Likewise.
	(target_remove_mask_watchpoint): Likewise.
	* target.h (target_insert_mask_watchpoint): Likewise.
	(target_remove_mask_watchpoint): Likewise.
	(struct target_ops) <to_insert_mask_watchpoint>: Likewise.
	(struct target_ops) <to_remove_mask_watchpoint>: Likewise.
	* target-delegates.c: Regenerate.
---
 gdb/ppc-linux-nat.c    |  4 ++--
 gdb/target-delegates.c | 16 ++++++++--------
 gdb/target.c           |  6 ++++--
 gdb/target.h           | 12 ++++++++----
 4 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 55aec00..14ad68e 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -1719,7 +1719,7 @@ get_trigger_type (enum target_hw_bp_type type)
 
 static int
 ppc_linux_insert_mask_watchpoint (struct target_ops *ops, CORE_ADDR addr,
-				  CORE_ADDR mask, int rw)
+				  CORE_ADDR mask, enum target_hw_bp_type rw)
 {
   struct lwp_info *lp;
   struct ppc_hw_breakpoint p;
@@ -1747,7 +1747,7 @@ ppc_linux_insert_mask_watchpoint (struct target_ops *ops, CORE_ADDR addr,
 
 static int
 ppc_linux_remove_mask_watchpoint (struct target_ops *ops, CORE_ADDR addr,
-				  CORE_ADDR mask, int rw)
+				  CORE_ADDR mask, enum target_hw_bp_type rw)
 {
   struct lwp_info *lp;
   struct ppc_hw_breakpoint p;
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index a7271fa..253c9d7 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -587,20 +587,20 @@ debug_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, enum
 }
 
 static int
-delegate_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
+delegate_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, enum target_hw_bp_type arg3)
 {
   self = self->beneath;
   return self->to_insert_mask_watchpoint (self, arg1, arg2, arg3);
 }
 
 static int
-tdefault_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
+tdefault_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, enum target_hw_bp_type arg3)
 {
   return 1;
 }
 
 static int
-debug_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
+debug_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, enum target_hw_bp_type arg3)
 {
   int result;
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_insert_mask_watchpoint (...)\n", debug_target.to_shortname);
@@ -612,7 +612,7 @@ debug_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_CORE_ADDR (arg2);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_int (arg3);
+  target_debug_print_enum_target_hw_bp_type (arg3);
   fputs_unfiltered (") = ", gdb_stdlog);
   target_debug_print_int (result);
   fputs_unfiltered ("\n", gdb_stdlog);
@@ -620,20 +620,20 @@ debug_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR
 }
 
 static int
-delegate_remove_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
+delegate_remove_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, enum target_hw_bp_type arg3)
 {
   self = self->beneath;
   return self->to_remove_mask_watchpoint (self, arg1, arg2, arg3);
 }
 
 static int
-tdefault_remove_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
+tdefault_remove_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, enum target_hw_bp_type arg3)
 {
   return 1;
 }
 
 static int
-debug_remove_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
+debug_remove_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, enum target_hw_bp_type arg3)
 {
   int result;
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_remove_mask_watchpoint (...)\n", debug_target.to_shortname);
@@ -645,7 +645,7 @@ debug_remove_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_CORE_ADDR (arg2);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_int (arg3);
+  target_debug_print_enum_target_hw_bp_type (arg3);
   fputs_unfiltered (") = ", gdb_stdlog);
   target_debug_print_int (result);
   fputs_unfiltered ("\n", gdb_stdlog);
diff --git a/gdb/target.c b/gdb/target.c
index 7ad2330..93786c3 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3529,7 +3529,8 @@ target_verify_memory (const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
    target.h.  */
 
 int
-target_insert_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask, int rw)
+target_insert_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask,
+			       enum target_hw_bp_type rw)
 {
   return current_target.to_insert_mask_watchpoint (&current_target,
 						   addr, mask, rw);
@@ -3539,7 +3540,8 @@ target_insert_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask, int rw)
    target.h.  */
 
 int
-target_remove_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask, int rw)
+target_remove_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask,
+			       enum target_hw_bp_type rw)
 {
   return current_target.to_remove_mask_watchpoint (&current_target,
 						   addr, mask, rw);
diff --git a/gdb/target.h b/gdb/target.h
index 2b2db45..0105db2 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -531,10 +531,12 @@ struct target_ops
       TARGET_DEFAULT_RETURN (-1);
 
     int (*to_insert_mask_watchpoint) (struct target_ops *,
-				      CORE_ADDR, CORE_ADDR, int)
+				      CORE_ADDR, CORE_ADDR,
+				      enum target_hw_bp_type)
       TARGET_DEFAULT_RETURN (1);
     int (*to_remove_mask_watchpoint) (struct target_ops *,
-				      CORE_ADDR, CORE_ADDR, int)
+				      CORE_ADDR, CORE_ADDR,
+				      enum target_hw_bp_type)
       TARGET_DEFAULT_RETURN (1);
     int (*to_stopped_by_watchpoint) (struct target_ops *)
       TARGET_DEFAULT_RETURN (0);
@@ -1947,14 +1949,16 @@ extern char *target_thread_name (struct thread_info *);
    or hw_access for an access watchpoint.  Returns 0 for success, 1 if
    masked watchpoints are not supported, -1 for failure.  */
 
-extern int target_insert_mask_watchpoint (CORE_ADDR, CORE_ADDR, int);
+extern int target_insert_mask_watchpoint (CORE_ADDR, CORE_ADDR,
+					  enum target_hw_bp_type);
 
 /* Remove a masked watchpoint at ADDR with the mask MASK.
    RW may be hw_read for a read watchpoint, hw_write for a write watchpoint
    or hw_access for an access watchpoint.  Returns 0 for success, non-zero
    for failure.  */
 
-extern int target_remove_mask_watchpoint (CORE_ADDR, CORE_ADDR, int);
+extern int target_remove_mask_watchpoint (CORE_ADDR, CORE_ADDR,
+					  enum target_hw_bp_type);
 
 /* Insert a hardware breakpoint at address BP_TGT->placed_address in
    the target machine.  Returns 0 for success, and returns non-zero or
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH c++ 02/12] linux-ppc-low.c: Add casts
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
@ 2015-11-03 14:26 ` Simon Marchi
  2015-11-03 16:06   ` Pedro Alves
  2015-11-03 14:26 ` [PATCH c++ 03/12] remote-sim.c: " Simon Marchi
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

Trivial casts for C++.

gdb/gdbserver/ChangeLog:

	* linux-ppc-low.c (ppc_get_hwcap): Add cast.
	(ppc_fill_vsxregset): Likewise.
	(ppc_store_vsxregset): Likewise.
	(ppc_fill_vrregset): Likewise.
	(ppc_store_vrregset): Likewise.
	(ppc_fill_evrregset): Likewise.
	(ppc_store_evrregset): Likewise.
---
 gdb/gdbserver/linux-ppc-low.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 3840e40..995a725 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -346,7 +346,7 @@ ppc_get_hwcap (unsigned long *valp)
 {
   const struct target_desc *tdesc = current_process ()->tdesc;
   int wordsize = register_size (tdesc, 0);
-  unsigned char *data = alloca (2 * wordsize);
+  unsigned char *data = (unsigned char *) alloca (2 * wordsize);
   int offset = 0;
 
   while ((*the_target->read_auxv) (offset, data, 2 * wordsize) == 2 * wordsize)
@@ -446,7 +446,7 @@ static void
 ppc_fill_vsxregset (struct regcache *regcache, void *buf)
 {
   int i, base;
-  char *regset = buf;
+  char *regset = (char *) buf;
 
   if (!(ppc_hwcap & PPC_FEATURE_HAS_VSX))
     return;
@@ -460,7 +460,7 @@ static void
 ppc_store_vsxregset (struct regcache *regcache, const void *buf)
 {
   int i, base;
-  const char *regset = buf;
+  const char *regset = (const char *) buf;
 
   if (!(ppc_hwcap & PPC_FEATURE_HAS_VSX))
     return;
@@ -476,7 +476,7 @@ static void
 ppc_fill_vrregset (struct regcache *regcache, void *buf)
 {
   int i, base;
-  char *regset = buf;
+  char *regset = (char *) buf;
 
   if (!(ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC))
     return;
@@ -493,7 +493,7 @@ static void
 ppc_store_vrregset (struct regcache *regcache, const void *buf)
 {
   int i, base;
-  const char *regset = buf;
+  const char *regset = (const char *) buf;
 
   if (!(ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC))
     return;
@@ -517,7 +517,7 @@ static void
 ppc_fill_evrregset (struct regcache *regcache, void *buf)
 {
   int i, ev0;
-  struct gdb_evrregset_t *regset = buf;
+  struct gdb_evrregset_t *regset = (struct gdb_evrregset_t *) buf;
 
   if (!(ppc_hwcap & PPC_FEATURE_HAS_SPE))
     return;
@@ -534,7 +534,7 @@ static void
 ppc_store_evrregset (struct regcache *regcache, const void *buf)
 {
   int i, ev0;
-  const struct gdb_evrregset_t *regset = buf;
+  const struct gdb_evrregset_t *regset = (const struct gdb_evrregset_t *) buf;
 
   if (!(ppc_hwcap & PPC_FEATURE_HAS_SPE))
     return;
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH c++ 03/12] remote-sim.c: Add casts
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
  2015-11-03 14:26 ` [PATCH c++ 02/12] linux-ppc-low.c: Add casts Simon Marchi
@ 2015-11-03 14:26 ` Simon Marchi
  2015-11-03 16:12   ` Pedro Alves
  2015-11-03 14:26 ` [PATCH c++ 04/12] target_ops masK_watchpoint: change int to target_hw_bp_type Simon Marchi
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

Mostly some casts from "generic arg" void* to the actual type.

There are two (enum gdb_signal) casts.  I tried to see if it would have
been better to change the type of sigrc, but it has a double role, as an
enum and as an integer, so I left it as is.

gdb/ChangeLog:

	* remote-sim.c (check_for_duplicate_sim_descriptor): Add casts.
	(get_sim_inferior_data): Likewise.
	(sim_inferior_data_cleanup): Likewise.
	(gdbsim_close_inferior): Likewise.
	(gdbsim_resume_inferior): Likewise.
	(gdbsim_wait): Likewise.
	(simulator_command): Likewise.
	(sim_command_completer): Likewise.
---
 gdb/remote-sim.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 8bd1a65..5e27114 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -152,9 +152,10 @@ static int
 check_for_duplicate_sim_descriptor (struct inferior *inf, void *arg)
 {
   struct sim_inferior_data *sim_data;
-  SIM_DESC new_sim_desc = arg;
+  SIM_DESC new_sim_desc = (SIM_DESC) arg;
 
-  sim_data = inferior_data (inf, sim_inferior_data_key);
+  sim_data = ((struct sim_inferior_data *)
+	      inferior_data (inf, sim_inferior_data_key));
 
   return (sim_data != NULL && sim_data->gdbsim_desc == new_sim_desc);
 }
@@ -172,7 +173,7 @@ get_sim_inferior_data (struct inferior *inf, int sim_instance_needed)
 {
   SIM_DESC sim_desc = NULL;
   struct sim_inferior_data *sim_data
-    = inferior_data (inf, sim_inferior_data_key);
+    = (struct sim_inferior_data *) inferior_data (inf, sim_inferior_data_key);
 
   /* Try to allocate a new sim instance, if needed.  We do this ahead of
      a potential allocation of a sim_inferior_data struct in order to
@@ -257,7 +258,7 @@ get_sim_inferior_data_by_ptid (ptid_t ptid, int sim_instance_needed)
 static void
 sim_inferior_data_cleanup (struct inferior *inf, void *data)
 {
-  struct sim_inferior_data *sim_data = data;
+  struct sim_inferior_data *sim_data = (struct sim_inferior_data *) data;
 
   if (sim_data != NULL)
     {
@@ -766,8 +767,8 @@ gdbsim_open (const char *args, int from_tty)
 static int
 gdbsim_close_inferior (struct inferior *inf, void *arg)
 {
-  struct sim_inferior_data *sim_data = inferior_data (inf,
-						      sim_inferior_data_key);
+  struct sim_inferior_data *sim_data
+    = (struct sim_inferior_data *) inferior_data (inf, sim_inferior_data_key);
   if (sim_data != NULL)
     {
       ptid_t ptid = sim_data->remote_sim_ptid;
@@ -849,7 +850,7 @@ gdbsim_resume_inferior (struct inferior *inf, void *arg)
 {
   struct sim_inferior_data *sim_data
     = get_sim_inferior_data (inf, SIM_INSTANCE_NOT_NEEDED);
-  struct resume_data *rd = arg;
+  struct resume_data *rd = (struct resume_data *) arg;
 
   if (sim_data)
     {
@@ -1034,13 +1035,13 @@ gdbsim_wait (struct target_ops *ops,
 	case GDB_SIGNAL_TRAP:
 	default:
 	  status->kind = TARGET_WAITKIND_STOPPED;
-	  status->value.sig = sigrc;
+	  status->value.sig = (enum gdb_signal) sigrc;
 	  break;
 	}
       break;
     case sim_signalled:
       status->kind = TARGET_WAITKIND_SIGNALLED;
-      status->value.sig = sigrc;
+      status->value.sig = (enum gdb_signal) sigrc;
       break;
     case sim_running:
     case sim_polling:
@@ -1198,7 +1199,8 @@ simulator_command (char *args, int from_tty)
      thus allocating memory that would not be garbage collected until
      the ultimate destruction of the associated inferior.  */
 
-  sim_data  = inferior_data (current_inferior (), sim_inferior_data_key);
+  sim_data  = ((struct sim_inferior_data *)
+	       inferior_data (current_inferior (), sim_inferior_data_key));
   if (sim_data == NULL || sim_data->gdbsim_desc == NULL)
     {
 
@@ -1231,7 +1233,8 @@ sim_command_completer (struct cmd_list_element *ignore, const char *text,
   int i;
   VEC (char_ptr) *result = NULL;
 
-  sim_data = inferior_data (current_inferior (), sim_inferior_data_key);
+  sim_data = ((struct sim_inferior_data *)
+	      inferior_data (current_inferior (), sim_inferior_data_key));
   if (sim_data == NULL || sim_data->gdbsim_desc == NULL)
     return NULL;
 
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower
@ 2015-11-03 14:26 Simon Marchi
  2015-11-03 14:26 ` [PATCH c++ 02/12] linux-ppc-low.c: Add casts Simon Marchi
                   ` (11 more replies)
  0 siblings, 12 replies; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

g++ doesn't like that we forward-declare a variable that is initialized
later in the file.  It's easy enough to re-order things to fix it.

Fixes

/home/simark/src/binutils-gdb/gdb/gdbserver/linux-ppc-low.c:663:28: error: redefinition of ‘usrregs_info ppc_usrregs_info’
 static struct usrregs_info ppc_usrregs_info =
                            ^
/home/simark/src/binutils-gdb/gdb/gdbserver/linux-ppc-low.c:381:28: note: ‘usrregs_info ppc_usrregs_info’ previously declared here
 static struct usrregs_info ppc_usrregs_info;
                            ^

gdb/gdbserver/ChangeLog:

	* linux-ppc-low.c (ppc_usrregs_info): Remove
	forward-declaration.
	(ppc_arch_setup): Move lower in file.
---
 gdb/gdbserver/linux-ppc-low.c | 195 +++++++++++++++++++++---------------------
 1 file changed, 97 insertions(+), 98 deletions(-)

diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 9e223ea..3840e40 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -377,108 +377,10 @@ ppc_get_hwcap (unsigned long *valp)
   return 0;
 }
 
-/* Forward declaration.  */
-static struct usrregs_info ppc_usrregs_info;
 #ifndef __powerpc64__
 static int ppc_regmap_adjusted;
 #endif
 
-static void
-ppc_arch_setup (void)
-{
-  const struct target_desc *tdesc;
-#ifdef __powerpc64__
-  long msr;
-  struct regcache *regcache;
-
-  /* On a 64-bit host, assume 64-bit inferior process with no
-     AltiVec registers.  Reset ppc_hwcap to ensure that the
-     collect_register call below does not fail.  */
-  tdesc = tdesc_powerpc_64l;
-  current_process ()->tdesc = tdesc;
-  ppc_hwcap = 0;
-
-  regcache = new_register_cache (tdesc);
-  fetch_inferior_registers (regcache, find_regno (tdesc, "msr"));
-  collect_register_by_name (regcache, "msr", &msr);
-  free_register_cache (regcache);
-  if (ppc64_64bit_inferior_p (msr))
-    {
-      ppc_get_hwcap (&ppc_hwcap);
-      if (ppc_hwcap & PPC_FEATURE_CELL)
-	tdesc = tdesc_powerpc_cell64l;
-      else if (ppc_hwcap & PPC_FEATURE_HAS_VSX)
-	{
-	  /* Power ISA 2.05 (implemented by Power 6 and newer processors)
-	     increases the FPSCR from 32 bits to 64 bits. Even though Power 7
-	     supports this ISA version, it doesn't have PPC_FEATURE_ARCH_2_05
-	     set, only PPC_FEATURE_ARCH_2_06.  Since for now the only bits
-	     used in the higher half of the register are for Decimal Floating
-	     Point, we check if that feature is available to decide the size
-	     of the FPSCR.  */
-	  if (ppc_hwcap & PPC_FEATURE_HAS_DFP)
-	    tdesc = tdesc_powerpc_isa205_vsx64l;
-	  else
-	    tdesc = tdesc_powerpc_vsx64l;
-	}
-      else if (ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC)
-	{
-	  if (ppc_hwcap & PPC_FEATURE_HAS_DFP)
-	    tdesc = tdesc_powerpc_isa205_altivec64l;
-	  else
-	    tdesc = tdesc_powerpc_altivec64l;
-	}
-
-      current_process ()->tdesc = tdesc;
-      return;
-    }
-#endif
-
-  /* OK, we have a 32-bit inferior.  */
-  tdesc = tdesc_powerpc_32l;
-  current_process ()->tdesc = tdesc;
-
-  ppc_get_hwcap (&ppc_hwcap);
-  if (ppc_hwcap & PPC_FEATURE_CELL)
-    tdesc = tdesc_powerpc_cell32l;
-  else if (ppc_hwcap & PPC_FEATURE_HAS_VSX)
-    {
-      if (ppc_hwcap & PPC_FEATURE_HAS_DFP)
-	tdesc = tdesc_powerpc_isa205_vsx32l;
-      else
-	tdesc = tdesc_powerpc_vsx32l;
-    }
-  else if (ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC)
-    {
-      if (ppc_hwcap & PPC_FEATURE_HAS_DFP)
-	tdesc = tdesc_powerpc_isa205_altivec32l;
-      else
-	tdesc = tdesc_powerpc_altivec32l;
-    }
-
-  /* On 32-bit machines, check for SPE registers.
-     Set the low target's regmap field as appropriately.  */
-#ifndef __powerpc64__
-  if (ppc_hwcap & PPC_FEATURE_HAS_SPE)
-    tdesc = tdesc_powerpc_e500l;
-
-  if (!ppc_regmap_adjusted)
-    {
-      if (ppc_hwcap & PPC_FEATURE_HAS_SPE)
-	ppc_usrregs_info.regmap = ppc_regmap_e500;
-
-      /* If the FPSCR is 64-bit wide, we need to fetch the whole
-	 64-bit slot and not just its second word.  The PT_FPSCR
-	 supplied in a 32-bit GDB compilation doesn't reflect
-	 this.  */
-      if (register_size (tdesc, 70) == 8)
-	ppc_regmap[70] = (48 + 2*32) * sizeof (long);
-
-      ppc_regmap_adjusted = 1;
-   }
-#endif
-  current_process ()->tdesc = tdesc;
-}
 
 /* Correct in either endianness.
    This instruction is "twge r2, r2", which GDB uses as a software
@@ -686,6 +588,103 @@ ppc_regs_info (void)
   return &regs_info;
 }
 
+static void
+ppc_arch_setup (void)
+{
+  const struct target_desc *tdesc;
+#ifdef __powerpc64__
+  long msr;
+  struct regcache *regcache;
+
+  /* On a 64-bit host, assume 64-bit inferior process with no
+     AltiVec registers.  Reset ppc_hwcap to ensure that the
+     collect_register call below does not fail.  */
+  tdesc = tdesc_powerpc_64l;
+  current_process ()->tdesc = tdesc;
+  ppc_hwcap = 0;
+
+  regcache = new_register_cache (tdesc);
+  fetch_inferior_registers (regcache, find_regno (tdesc, "msr"));
+  collect_register_by_name (regcache, "msr", &msr);
+  free_register_cache (regcache);
+  if (ppc64_64bit_inferior_p (msr))
+    {
+      ppc_get_hwcap (&ppc_hwcap);
+      if (ppc_hwcap & PPC_FEATURE_CELL)
+	tdesc = tdesc_powerpc_cell64l;
+      else if (ppc_hwcap & PPC_FEATURE_HAS_VSX)
+	{
+	  /* Power ISA 2.05 (implemented by Power 6 and newer processors)
+	     increases the FPSCR from 32 bits to 64 bits. Even though Power 7
+	     supports this ISA version, it doesn't have PPC_FEATURE_ARCH_2_05
+	     set, only PPC_FEATURE_ARCH_2_06.  Since for now the only bits
+	     used in the higher half of the register are for Decimal Floating
+	     Point, we check if that feature is available to decide the size
+	     of the FPSCR.  */
+	  if (ppc_hwcap & PPC_FEATURE_HAS_DFP)
+	    tdesc = tdesc_powerpc_isa205_vsx64l;
+	  else
+	    tdesc = tdesc_powerpc_vsx64l;
+	}
+      else if (ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC)
+	{
+	  if (ppc_hwcap & PPC_FEATURE_HAS_DFP)
+	    tdesc = tdesc_powerpc_isa205_altivec64l;
+	  else
+	    tdesc = tdesc_powerpc_altivec64l;
+	}
+
+      current_process ()->tdesc = tdesc;
+      return;
+    }
+#endif
+
+  /* OK, we have a 32-bit inferior.  */
+  tdesc = tdesc_powerpc_32l;
+  current_process ()->tdesc = tdesc;
+
+  ppc_get_hwcap (&ppc_hwcap);
+  if (ppc_hwcap & PPC_FEATURE_CELL)
+    tdesc = tdesc_powerpc_cell32l;
+  else if (ppc_hwcap & PPC_FEATURE_HAS_VSX)
+    {
+      if (ppc_hwcap & PPC_FEATURE_HAS_DFP)
+	tdesc = tdesc_powerpc_isa205_vsx32l;
+      else
+	tdesc = tdesc_powerpc_vsx32l;
+    }
+  else if (ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC)
+    {
+      if (ppc_hwcap & PPC_FEATURE_HAS_DFP)
+	tdesc = tdesc_powerpc_isa205_altivec32l;
+      else
+	tdesc = tdesc_powerpc_altivec32l;
+    }
+
+  /* On 32-bit machines, check for SPE registers.
+     Set the low target's regmap field as appropriately.  */
+#ifndef __powerpc64__
+  if (ppc_hwcap & PPC_FEATURE_HAS_SPE)
+    tdesc = tdesc_powerpc_e500l;
+
+  if (!ppc_regmap_adjusted)
+    {
+      if (ppc_hwcap & PPC_FEATURE_HAS_SPE)
+	ppc_usrregs_info.regmap = ppc_regmap_e500;
+
+      /* If the FPSCR is 64-bit wide, we need to fetch the whole
+	 64-bit slot and not just its second word.  The PT_FPSCR
+	 supplied in a 32-bit GDB compilation doesn't reflect
+	 this.  */
+      if (register_size (tdesc, 70) == 8)
+	ppc_regmap[70] = (48 + 2*32) * sizeof (long);
+
+      ppc_regmap_adjusted = 1;
+   }
+#endif
+  current_process ()->tdesc = tdesc;
+}
+
 struct linux_target_ops the_low_target = {
   ppc_arch_setup,
   ppc_regs_info,
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH c++ 11/12] linux-mips-low.c: Add casts
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
                   ` (5 preceding siblings ...)
  2015-11-03 14:27 ` [PATCH c++ 10/12] linux-mips-low.c: Change "private" variable name Simon Marchi
@ 2015-11-03 14:27 ` Simon Marchi
  2015-11-03 16:18   ` Pedro Alves
  2015-11-03 14:27 ` [PATCH c++ 05/12] linux-aarch32-low.c: Use NULL_REGSET Simon Marchi
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

Fixes a bunch of:

/home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c: In function ‘void mips_store_fpregset(regcache*, const void*)’:
/home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c:809:39: error: invalid conversion from ‘const void*’ to ‘const mips_register*’ [-fpermissive]
   const union mips_register *regset = buf;
                                       ^

gdb/gdbserver/ChangeLog:

	* linux-mips-low.c (mips_fill_gregset): Add cast.
	(mips_store_gregset): Likewise.
	(mips_fill_fpregset): Likewise.
	(mips_store_fpregset): Likewise.
---
 gdb/gdbserver/linux-mips-low.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c
index 0525522..459f4fc 100644
--- a/gdb/gdbserver/linux-mips-low.c
+++ b/gdb/gdbserver/linux-mips-low.c
@@ -724,7 +724,7 @@ mips_supply_register_32bit (struct regcache *regcache,
 static void
 mips_fill_gregset (struct regcache *regcache, void *buf)
 {
-  union mips_register *regset = buf;
+  union mips_register *regset = (union mips_register *) buf;
   int i, use_64bit;
   const struct target_desc *tdesc = regcache->tdesc;
 
@@ -753,7 +753,7 @@ mips_fill_gregset (struct regcache *regcache, void *buf)
 static void
 mips_store_gregset (struct regcache *regcache, const void *buf)
 {
-  const union mips_register *regset = buf;
+  const union mips_register *regset = (const union mips_register *) buf;
   int i, use_64bit;
 
   use_64bit = (register_size (regcache->tdesc, 0) == 8);
@@ -781,7 +781,7 @@ mips_store_gregset (struct regcache *regcache, const void *buf)
 static void
 mips_fill_fpregset (struct regcache *regcache, void *buf)
 {
-  union mips_register *regset = buf;
+  union mips_register *regset = (union mips_register *) buf;
   int i, use_64bit, first_fp, big_endian;
 
   use_64bit = (register_size (regcache->tdesc, 0) == 8);
@@ -806,7 +806,7 @@ mips_fill_fpregset (struct regcache *regcache, void *buf)
 static void
 mips_store_fpregset (struct regcache *regcache, const void *buf)
 {
-  const union mips_register *regset = buf;
+  const union mips_register *regset = (const union mips_register *) buf;
   int i, use_64bit, first_fp, big_endian;
 
   use_64bit = (register_size (regcache->tdesc, 0) == 8);
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH c++ 06/12] gdbserver arm: Add casts
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
                   ` (8 preceding siblings ...)
  2015-11-03 14:27 ` [PATCH c++ 08/12] arm-linux-nat.c: Add cast Simon Marchi
@ 2015-11-03 14:27 ` Simon Marchi
  2015-11-03 16:15   ` Pedro Alves
  2015-11-03 14:27 ` [PATCH c++ 12/12] xtensa: Add missing statics Simon Marchi
  2015-11-03 16:06 ` [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Pedro Alves
  11 siblings, 1 reply; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

Trivial casts for C++.

Fixes things like

In file included from /home/simark/src/binutils-gdb/gdb/gdbserver/../common/common-defs.h:39:0,
                 from /home/simark/src/binutils-gdb/gdb/gdbserver/server.h:22,
                 from /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c:19:
/home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c: In function ‘int arm_get_hwcap(long unsigned int*)’:
/home/simark/src/binutils-gdb/gdb/gdbserver/../../include/libiberty.h:711:38: error: invalid conversion from ‘void*’ to ‘unsigned char*’ [-fpermissive]
 # define alloca(x) __builtin_alloca(x)
                                      ^
/home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c:807:25: note: in expansion of macro ‘alloca’
   unsigned char *data = alloca (8);
                         ^

gdb/gdbserver/ChangeLog:

	* linux-aarch32-low.c (arm_fill_gregset): Add cast.
	(arm_store_gregset): Likewise.
	* linux-arm-low.c (arm_get_hwcap): Likewise.
	(arm_read_description): Likewise.
---
 gdb/gdbserver/linux-aarch32-low.c | 4 ++--
 gdb/gdbserver/linux-arm-low.c     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/gdbserver/linux-aarch32-low.c b/gdb/gdbserver/linux-aarch32-low.c
index 891f8cd..221b5b9 100644
--- a/gdb/gdbserver/linux-aarch32-low.c
+++ b/gdb/gdbserver/linux-aarch32-low.c
@@ -39,7 +39,7 @@ void
 arm_fill_gregset (struct regcache *regcache, void *buf)
 {
   int i;
-  uint32_t *regs = buf;
+  uint32_t *regs = (uint32_t *) buf;
 
   for (i = ARM_A1_REGNUM; i <= ARM_PC_REGNUM; i++)
     collect_register (regcache, i, &regs[i]);
@@ -54,7 +54,7 @@ arm_store_gregset (struct regcache *regcache, const void *buf)
 {
   int i;
   char zerobuf[8];
-  const uint32_t *regs = buf;
+  const uint32_t *regs = (const uint32_t *) buf;
 
   memset (zerobuf, 0, 8);
   for (i = ARM_A1_REGNUM; i <= ARM_PC_REGNUM; i++)
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index e10955f..ae659dd 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -804,7 +804,7 @@ arm_prepare_to_resume (struct lwp_info *lwp)
 static int
 arm_get_hwcap (unsigned long *valp)
 {
-  unsigned char *data = alloca (8);
+  unsigned char *data = (unsigned char *) alloca (8);
   int offset = 0;
 
   while ((*the_target->read_auxv) (offset, data, 8) == 8)
@@ -855,7 +855,7 @@ arm_read_description (void)
       /* Now make sure that the kernel supports reading these
 	 registers.  Support was added in 2.6.30.  */
       errno = 0;
-      buf = xmalloc (32 * 8 + 4);
+      buf = (char *) xmalloc (32 * 8 + 4);
       if (ptrace (PTRACE_GETVFPREGS, pid, 0, buf) < 0
 	  && errno == EIO)
 	result = tdesc_arm;
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH c++ 09/12] linux-mips-low.c: Fix type of mips_add_watchpoint parameter
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
                   ` (2 preceding siblings ...)
  2015-11-03 14:26 ` [PATCH c++ 04/12] target_ops masK_watchpoint: change int to target_hw_bp_type Simon Marchi
@ 2015-11-03 14:27 ` Simon Marchi
  2015-11-03 16:17   ` Pedro Alves
  2015-11-03 14:27 ` [PATCH c++ 07/12] Change return type of raw_bkpt_type_to_arm_hwbp_type Simon Marchi
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

Fixes

/home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c: In function ‘void mips_add_watchpoint(arch_process_info*, CORE_ADDR, int, int)’:
/home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c:368:19: error: invalid conversion from ‘int’ to ‘target_hw_bp_type’ [-fpermissive]
   new_watch->type = watch_type;
                   ^

gdb/gdbserver/ChangeLog:

	* linux-mips-low.c (mips_linux_new_thread): Change type of
	watch_type to enum target_hw_bp_type.
---
 gdb/gdbserver/linux-mips-low.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c
index 86f7962..2cfa7c2 100644
--- a/gdb/gdbserver/linux-mips-low.c
+++ b/gdb/gdbserver/linux-mips-low.c
@@ -356,8 +356,8 @@ mips_linux_new_thread (struct lwp_info *lwp)
 /* Create a new mips_watchpoint and add it to the list.  */
 
 static void
-mips_add_watchpoint (struct arch_process_info *private, CORE_ADDR addr,
-		     int len, int watch_type)
+mips_add_watchpoint (struct arch_process_info *private, CORE_ADDR addr, int len,
+		     enum target_hw_bp_type watch_type)
 {
   struct mips_watchpoint *new_watch;
   struct mips_watchpoint **pw;
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH c++ 07/12] Change return type of raw_bkpt_type_to_arm_hwbp_type
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
                   ` (3 preceding siblings ...)
  2015-11-03 14:27 ` [PATCH c++ 09/12] linux-mips-low.c: Fix type of mips_add_watchpoint parameter Simon Marchi
@ 2015-11-03 14:27 ` Simon Marchi
  2015-11-03 16:16   ` Pedro Alves
  2015-11-03 14:27 ` [PATCH c++ 10/12] linux-mips-low.c: Change "private" variable name Simon Marchi
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

Fixes:

/home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c: In function ‘int arm_linux_hw_point_initialize(raw_bkpt_type, CORE_ADDR, int, arm_linux_hw_breakpoint*)’:
/home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c:459:55: error: invalid conversion from ‘int’ to ‘arm_hwbp_type’ [-fpermissive]
   hwbp_type = raw_bkpt_type_to_arm_hwbp_type (raw_type);
                                                       ^

gdb/gdbserver/ChangeLog:

		* linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type):
		Change return type to arm_hwbp_type.
---
 gdb/gdbserver/linux-arm-low.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index ae659dd..dda37cb 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -426,7 +426,7 @@ arm_linux_hw_breakpoint_equal (const struct arm_linux_hw_breakpoint *p1,
 
 /* Convert a raw breakpoint type to an enum arm_hwbp_type.  */
 
-static int
+static arm_hwbp_type
 raw_bkpt_type_to_arm_hwbp_type (enum raw_bkpt_type raw_type)
 {
   switch (raw_type)
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH c++ 05/12] linux-aarch32-low.c: Use NULL_REGSET
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
                   ` (6 preceding siblings ...)
  2015-11-03 14:27 ` [PATCH c++ 11/12] linux-mips-low.c: Add casts Simon Marchi
@ 2015-11-03 14:27 ` Simon Marchi
  2015-11-03 16:14   ` Pedro Alves
  2015-11-03 14:27 ` [PATCH c++ 08/12] arm-linux-nat.c: Add cast Simon Marchi
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

Fixes

/home/simark/src/binutils-gdb/gdb/gdbserver/linux-aarch32-low.c:124:1: error: invalid conversion from ‘int’ to ‘regset_type’ [-fpermissive]
 };
 ^

gdb/gdbserver/ChangeLog:

	* linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.
---
 gdb/gdbserver/linux-aarch32-low.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/gdbserver/linux-aarch32-low.c b/gdb/gdbserver/linux-aarch32-low.c
index 5876b13..891f8cd 100644
--- a/gdb/gdbserver/linux-aarch32-low.c
+++ b/gdb/gdbserver/linux-aarch32-low.c
@@ -120,7 +120,7 @@ static struct regset_info aarch32_regsets[] = {
   { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_VFP, 32 * 8 + 4,
     EXTENDED_REGS,
     arm_fill_vfpregset, arm_store_vfpregset },
-  { 0, 0, 0, -1, -1, NULL, NULL }
+  NULL_REGSET
 };
 
 static struct regsets_info aarch32_regsets_info =
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH c++ 10/12] linux-mips-low.c: Change "private" variable name
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
                   ` (4 preceding siblings ...)
  2015-11-03 14:27 ` [PATCH c++ 07/12] Change return type of raw_bkpt_type_to_arm_hwbp_type Simon Marchi
@ 2015-11-03 14:27 ` Simon Marchi
  2015-11-03 16:17   ` Pedro Alves
  2015-11-03 14:27 ` [PATCH c++ 11/12] linux-mips-low.c: Add casts Simon Marchi
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

Fixes:

/home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c:359:48: error: expected ‘,’ or ‘...’ before ‘private’
 mips_add_watchpoint (struct arch_process_info *private, CORE_ADDR addr,
                                                ^

gdb/gdbserver/ChangeLog:

	* linux-mips-low.c (mips_add_watchpoint): Rename private to
	priv.
---
 gdb/gdbserver/linux-mips-low.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c
index 2cfa7c2..0525522 100644
--- a/gdb/gdbserver/linux-mips-low.c
+++ b/gdb/gdbserver/linux-mips-low.c
@@ -356,7 +356,7 @@ mips_linux_new_thread (struct lwp_info *lwp)
 /* Create a new mips_watchpoint and add it to the list.  */
 
 static void
-mips_add_watchpoint (struct arch_process_info *private, CORE_ADDR addr, int len,
+mips_add_watchpoint (struct arch_process_info *priv, CORE_ADDR addr, int len,
 		     enum target_hw_bp_type watch_type)
 {
   struct mips_watchpoint *new_watch;
@@ -368,7 +368,7 @@ mips_add_watchpoint (struct arch_process_info *private, CORE_ADDR addr, int len,
   new_watch->type = watch_type;
   new_watch->next = NULL;
 
-  pw = &private->current_watches;
+  pw = &priv->current_watches;
   while (*pw != NULL)
     pw = &(*pw)->next;
   *pw = new_watch;
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH c++ 08/12] arm-linux-nat.c: Add cast
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
                   ` (7 preceding siblings ...)
  2015-11-03 14:27 ` [PATCH c++ 05/12] linux-aarch32-low.c: Use NULL_REGSET Simon Marchi
@ 2015-11-03 14:27 ` Simon Marchi
  2015-11-03 16:16   ` Pedro Alves
  2015-11-03 14:27 ` [PATCH c++ 06/12] gdbserver arm: Add casts Simon Marchi
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

Fixes:

/home/simark/src/binutils-gdb/gdb/arm-linux-nat.c: In function ‘const target_desc* arm_linux_read_description(target_ops*)’:
/home/simark/src/binutils-gdb/gdb/../include/libiberty.h:711:38: error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
 # define alloca(x) __builtin_alloca(x)
                                      ^
/home/simark/src/binutils-gdb/gdb/arm-linux-nat.c:578:13: note: in expansion of macro ‘alloca’
       buf = alloca (VFP_REGS_SIZE);
             ^

gdb/ChangeLog:

	* arm-linux-nat.c (arm_linux_read_description): Add cast.
---
 gdb/arm-linux-nat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index a63b181..63fdae1 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -575,7 +575,7 @@ arm_linux_read_description (struct target_ops *ops)
 	 registers.  Support was added in 2.6.30.  */
       pid = ptid_get_lwp (inferior_ptid);
       errno = 0;
-      buf = alloca (VFP_REGS_SIZE);
+      buf = (char *) alloca (VFP_REGS_SIZE);
       if (ptrace (PTRACE_GETVFPREGS, pid, 0, buf) < 0
 	  && errno == EIO)
 	result = NULL;
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH c++ 12/12] xtensa: Add missing statics
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
                   ` (9 preceding siblings ...)
  2015-11-03 14:27 ` [PATCH c++ 06/12] gdbserver arm: Add casts Simon Marchi
@ 2015-11-03 14:27 ` Simon Marchi
  2015-11-03 16:19   ` Pedro Alves
  2015-11-03 16:06 ` [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Pedro Alves
  11 siblings, 1 reply; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 14:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

This actually fixes the build in C:

/home/simark/src/binutils-gdb/gdb/xtensa-linux-nat.c:100:1: error: no previous prototype for ‘supply_gregset_reg’ [-Werror=missing-prototypes]
 supply_gregset_reg (struct regcache *regcache,
 ^
/home/simark/src/binutils-gdb/gdb/xtensa-linux-nat.c:257:1: error: no previous prototype for ‘xtensa_linux_fetch_inferior_registers’ [-Werror=missing-prototypes]
 xtensa_linux_fetch_inferior_registers (struct target_ops *ops,
 ^
/home/simark/src/binutils-gdb/gdb/xtensa-linux-nat.c:272:1: error: no previous prototype for ‘xtensa_linux_store_inferior_registers’ [-Werror=missing-prototypes]
 xtensa_linux_store_inferior_registers (struct target_ops *ops,
 ^
cc1: all warnings being treated as errors

These functions are local to this file, so they should be static.

gdb/ChangeLog:

	* xtensa-linux-nat.c (supply_gregset_reg): Make static.
	(xtensa_linux_fetch_inferior_registers): Likewise.
	(xtensa_linux_store_inferior_registers): Likewise.
---
 gdb/xtensa-linux-nat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
index 5538d5b..d024408 100644
--- a/gdb/xtensa-linux-nat.c
+++ b/gdb/xtensa-linux-nat.c
@@ -96,7 +96,7 @@ fill_gregset (const struct regcache *regcache,
     }
 }
 
-void
+static void
 supply_gregset_reg (struct regcache *regcache,
 		    const gdb_gregset_t *gregsetp, int regnum)
 {
@@ -253,7 +253,7 @@ store_xtregs (struct regcache *regcache, int regnum)
     perror_with_name (_("Couldn't write extended registers"));
 }
 
-void
+static void
 xtensa_linux_fetch_inferior_registers (struct target_ops *ops,
 				       struct regcache *regcache, int regnum)
 {
@@ -268,7 +268,7 @@ xtensa_linux_fetch_inferior_registers (struct target_ops *ops,
     fetch_xtregs (regcache, regnum);
 }
 
-void
+static void
 xtensa_linux_store_inferior_registers (struct target_ops *ops,
 				       struct regcache *regcache, int regnum)
 {
-- 
2.5.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 02/12] linux-ppc-low.c: Add casts
  2015-11-03 14:26 ` [PATCH c++ 02/12] linux-ppc-low.c: Add casts Simon Marchi
@ 2015-11-03 16:06   ` Pedro Alves
  0 siblings, 0 replies; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:06 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> Trivial casts for C++.
> 
> gdb/gdbserver/ChangeLog:
> 
> 	* linux-ppc-low.c (ppc_get_hwcap): Add cast.
> 	(ppc_fill_vsxregset): Likewise.
> 	(ppc_store_vsxregset): Likewise.
> 	(ppc_fill_vrregset): Likewise.
> 	(ppc_store_vrregset): Likewise.
> 	(ppc_fill_evrregset): Likewise.
> 	(ppc_store_evrregset): Likewise.

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower
  2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
                   ` (10 preceding siblings ...)
  2015-11-03 14:27 ` [PATCH c++ 12/12] xtensa: Add missing statics Simon Marchi
@ 2015-11-03 16:06 ` Pedro Alves
  2015-11-03 18:35   ` Simon Marchi
  11 siblings, 1 reply; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:06 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> g++ doesn't like that we forward-declare a variable that is initialized
> later in the file.  It's easy enough to re-order things to fix it.

Yeah, doesn't work in C either with -fno-common.

> 
> Fixes
> 
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-ppc-low.c:663:28: error: redefinition of ‘usrregs_info ppc_usrregs_info’
>  static struct usrregs_info ppc_usrregs_info =
>                             ^
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-ppc-low.c:381:28: note: ‘usrregs_info ppc_usrregs_info’ previously declared here
>  static struct usrregs_info ppc_usrregs_info;
>                             ^
> 
> gdb/gdbserver/ChangeLog:
> 
> 	* linux-ppc-low.c (ppc_usrregs_info): Remove
> 	forward-declaration.
> 	(ppc_arch_setup): Move lower in file.

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 03/12] remote-sim.c: Add casts
  2015-11-03 14:26 ` [PATCH c++ 03/12] remote-sim.c: " Simon Marchi
@ 2015-11-03 16:12   ` Pedro Alves
  0 siblings, 0 replies; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:12 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> Mostly some casts from "generic arg" void* to the actual type.
> 
> There are two (enum gdb_signal) casts.  I tried to see if it would have
> been better to change the type of sigrc, but it has a double role, as an
> enum and as an integer, so I left it as is.

I think the sim's sim_stop_reason 'int *sigrc' parameter should be
adjusted to gdb_signal* instead of int*.  AFAICS, the sims do write
a gdb_signal to it.  (And if they didn't, it would look like a bug
to me).

> 
> gdb/ChangeLog:
> 
> 	* remote-sim.c (check_for_duplicate_sim_descriptor): Add casts.
> 	(get_sim_inferior_data): Likewise.
> 	(sim_inferior_data_cleanup): Likewise.
> 	(gdbsim_close_inferior): Likewise.
> 	(gdbsim_resume_inferior): Likewise.
> 	(gdbsim_wait): Likewise.
> 	(simulator_command): Likewise.
> 	(sim_command_completer): Likewise.

In any case, this is OK.  We can fix the sim some other day.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 04/12] target_ops masK_watchpoint: change int to target_hw_bp_type
  2015-11-03 14:26 ` [PATCH c++ 04/12] target_ops masK_watchpoint: change int to target_hw_bp_type Simon Marchi
@ 2015-11-03 16:14   ` Pedro Alves
  0 siblings, 0 replies; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:14 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> Fixes:
> 
> /home/simark/src/binutils-gdb/gdb/ppc-linux-nat.c: In function ‘int ppc_linux_insert_mask_watchpoint(target_ops*, CORE_ADDR, CORE_ADDR, int)’:
> /home/simark/src/binutils-gdb/gdb/ppc-linux-nat.c:1730:40: error: invalid conversion from ‘int’ to ‘target_hw_bp_type’ [-fpermissive]
>    p.trigger_type = get_trigger_type (rw);
>                                         ^
> 
> gdb/ChangeLog:
> 
> 	* ppc-linux-nat.c (ppc_linux_insert_mask_watchpoint): Change
> 	type of rw to enum target_hw_bp_type.
> 	(ppc_linux_remove_mask_watchpoint): Likewise.
> 	* target.c (target_insert_mask_watchpoint): Likewise.
> 	(target_remove_mask_watchpoint): Likewise.
> 	* target.h (target_insert_mask_watchpoint): Likewise.
> 	(target_remove_mask_watchpoint): Likewise.
> 	(struct target_ops) <to_insert_mask_watchpoint>: Likewise.
> 	(struct target_ops) <to_remove_mask_watchpoint>: Likewise.
> 	* target-delegates.c: Regenerate.

OK.  (nit: typo in subject)

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 05/12] linux-aarch32-low.c: Use NULL_REGSET
  2015-11-03 14:27 ` [PATCH c++ 05/12] linux-aarch32-low.c: Use NULL_REGSET Simon Marchi
@ 2015-11-03 16:14   ` Pedro Alves
  0 siblings, 0 replies; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:14 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> Fixes
> 
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-aarch32-low.c:124:1: error: invalid conversion from ‘int’ to ‘regset_type’ [-fpermissive]
>  };
>  ^
> 
> gdb/gdbserver/ChangeLog:
> 
> 	* linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 06/12] gdbserver arm: Add casts
  2015-11-03 14:27 ` [PATCH c++ 06/12] gdbserver arm: Add casts Simon Marchi
@ 2015-11-03 16:15   ` Pedro Alves
  0 siblings, 0 replies; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:15 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> Trivial casts for C++.
> 
> Fixes things like
> 
> In file included from /home/simark/src/binutils-gdb/gdb/gdbserver/../common/common-defs.h:39:0,
>                  from /home/simark/src/binutils-gdb/gdb/gdbserver/server.h:22,
>                  from /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c:19:
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c: In function ‘int arm_get_hwcap(long unsigned int*)’:
> /home/simark/src/binutils-gdb/gdb/gdbserver/../../include/libiberty.h:711:38: error: invalid conversion from ‘void*’ to ‘unsigned char*’ [-fpermissive]
>  # define alloca(x) __builtin_alloca(x)
>                                       ^
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c:807:25: note: in expansion of macro ‘alloca’
>    unsigned char *data = alloca (8);
>                          ^
> 
> gdb/gdbserver/ChangeLog:
> 
> 	* linux-aarch32-low.c (arm_fill_gregset): Add cast.
> 	(arm_store_gregset): Likewise.
> 	* linux-arm-low.c (arm_get_hwcap): Likewise.
> 	(arm_read_description): Likewise.

<rubberstamp>OK</rubberstamp>

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 08/12] arm-linux-nat.c: Add cast
  2015-11-03 14:27 ` [PATCH c++ 08/12] arm-linux-nat.c: Add cast Simon Marchi
@ 2015-11-03 16:16   ` Pedro Alves
  0 siblings, 0 replies; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:16 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> Fixes:
> 
> /home/simark/src/binutils-gdb/gdb/arm-linux-nat.c: In function ‘const target_desc* arm_linux_read_description(target_ops*)’:
> /home/simark/src/binutils-gdb/gdb/../include/libiberty.h:711:38: error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
>  # define alloca(x) __builtin_alloca(x)
>                                       ^
> /home/simark/src/binutils-gdb/gdb/arm-linux-nat.c:578:13: note: in expansion of macro ‘alloca’
>        buf = alloca (VFP_REGS_SIZE);
>              ^
> 
> gdb/ChangeLog:
> 
> 	* arm-linux-nat.c (arm_linux_read_description): Add cast.

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 07/12] Change return type of raw_bkpt_type_to_arm_hwbp_type
  2015-11-03 14:27 ` [PATCH c++ 07/12] Change return type of raw_bkpt_type_to_arm_hwbp_type Simon Marchi
@ 2015-11-03 16:16   ` Pedro Alves
  0 siblings, 0 replies; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:16 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> Fixes:
> 
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c: In function ‘int arm_linux_hw_point_initialize(raw_bkpt_type, CORE_ADDR, int, arm_linux_hw_breakpoint*)’:
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c:459:55: error: invalid conversion from ‘int’ to ‘arm_hwbp_type’ [-fpermissive]
>    hwbp_type = raw_bkpt_type_to_arm_hwbp_type (raw_type);
>                                                        ^
> 
> gdb/gdbserver/ChangeLog:
> 
> 		* linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type):
> 		Change return type to arm_hwbp_type.

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 10/12] linux-mips-low.c: Change "private" variable name
  2015-11-03 14:27 ` [PATCH c++ 10/12] linux-mips-low.c: Change "private" variable name Simon Marchi
@ 2015-11-03 16:17   ` Pedro Alves
  0 siblings, 0 replies; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:17 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> Fixes:
> 
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c:359:48: error: expected ‘,’ or ‘...’ before ‘private’
>  mips_add_watchpoint (struct arch_process_info *private, CORE_ADDR addr,
>                                                 ^
> 
> gdb/gdbserver/ChangeLog:
> 
> 	* linux-mips-low.c (mips_add_watchpoint): Rename private to
> 	priv.

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 09/12] linux-mips-low.c: Fix type of mips_add_watchpoint parameter
  2015-11-03 14:27 ` [PATCH c++ 09/12] linux-mips-low.c: Fix type of mips_add_watchpoint parameter Simon Marchi
@ 2015-11-03 16:17   ` Pedro Alves
  0 siblings, 0 replies; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:17 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> Fixes
> 
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c: In function ‘void mips_add_watchpoint(arch_process_info*, CORE_ADDR, int, int)’:
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c:368:19: error: invalid conversion from ‘int’ to ‘target_hw_bp_type’ [-fpermissive]
>    new_watch->type = watch_type;
>                    ^
> 
> gdb/gdbserver/ChangeLog:
> 
> 	* linux-mips-low.c (mips_linux_new_thread): Change type of
> 	watch_type to enum target_hw_bp_type.

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 11/12] linux-mips-low.c: Add casts
  2015-11-03 14:27 ` [PATCH c++ 11/12] linux-mips-low.c: Add casts Simon Marchi
@ 2015-11-03 16:18   ` Pedro Alves
  0 siblings, 0 replies; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:18 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> Fixes a bunch of:
> 
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c: In function ‘void mips_store_fpregset(regcache*, const void*)’:
> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c:809:39: error: invalid conversion from ‘const void*’ to ‘const mips_register*’ [-fpermissive]
>    const union mips_register *regset = buf;
>                                        ^
> 
> gdb/gdbserver/ChangeLog:
> 
> 	* linux-mips-low.c (mips_fill_gregset): Add cast.
> 	(mips_store_gregset): Likewise.
> 	(mips_fill_fpregset): Likewise.
> 	(mips_store_fpregset): Likewise.

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 12/12] xtensa: Add missing statics
  2015-11-03 14:27 ` [PATCH c++ 12/12] xtensa: Add missing statics Simon Marchi
@ 2015-11-03 16:19   ` Pedro Alves
  0 siblings, 0 replies; 25+ messages in thread
From: Pedro Alves @ 2015-11-03 16:19 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches; +Cc: Simon Marchi

On 11/03/2015 02:26 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> This actually fixes the build in C:
> 
> /home/simark/src/binutils-gdb/gdb/xtensa-linux-nat.c:100:1: error: no previous prototype for ‘supply_gregset_reg’ [-Werror=missing-prototypes]
>  supply_gregset_reg (struct regcache *regcache,
>  ^
> /home/simark/src/binutils-gdb/gdb/xtensa-linux-nat.c:257:1: error: no previous prototype for ‘xtensa_linux_fetch_inferior_registers’ [-Werror=missing-prototypes]
>  xtensa_linux_fetch_inferior_registers (struct target_ops *ops,
>  ^
> /home/simark/src/binutils-gdb/gdb/xtensa-linux-nat.c:272:1: error: no previous prototype for ‘xtensa_linux_store_inferior_registers’ [-Werror=missing-prototypes]
>  xtensa_linux_store_inferior_registers (struct target_ops *ops,
>  ^
> cc1: all warnings being treated as errors
> 
> These functions are local to this file, so they should be static.
> 
> gdb/ChangeLog:
> 
> 	* xtensa-linux-nat.c (supply_gregset_reg): Make static.
> 	(xtensa_linux_fetch_inferior_registers): Likewise.
> 	(xtensa_linux_store_inferior_registers): Likewise.

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower
  2015-11-03 16:06 ` [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Pedro Alves
@ 2015-11-03 18:35   ` Simon Marchi
  0 siblings, 0 replies; 25+ messages in thread
From: Simon Marchi @ 2015-11-03 18:35 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches; +Cc: Simon Marchi

On 15-11-03 11:05 AM, Pedro Alves wrote:
> On 11/03/2015 02:26 PM, Simon Marchi wrote:
>> From: Simon Marchi <simon.marchi@polymtl.ca>
>>
>> g++ doesn't like that we forward-declare a variable that is initialized
>> later in the file.  It's easy enough to re-order things to fix it.
> 
> Yeah, doesn't work in C either with -fno-common.
> 
>>
>> Fixes
>>
>> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-ppc-low.c:663:28: error: redefinition of ‘usrregs_info ppc_usrregs_info’
>>  static struct usrregs_info ppc_usrregs_info =
>>                             ^
>> /home/simark/src/binutils-gdb/gdb/gdbserver/linux-ppc-low.c:381:28: note: ‘usrregs_info ppc_usrregs_info’ previously declared here
>>  static struct usrregs_info ppc_usrregs_info;
>>                             ^
>>
>> gdb/gdbserver/ChangeLog:
>>
>> 	* linux-ppc-low.c (ppc_usrregs_info): Remove
>> 	forward-declaration.
>> 	(ppc_arch_setup): Move lower in file.
> 
> OK.
> 
> Thanks,
> Pedro Alves
> 

Pushed all 12 patches, with the typo in the title fixed.

Thanks!

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2015-11-03 18:35 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-03 14:26 [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Simon Marchi
2015-11-03 14:26 ` [PATCH c++ 02/12] linux-ppc-low.c: Add casts Simon Marchi
2015-11-03 16:06   ` Pedro Alves
2015-11-03 14:26 ` [PATCH c++ 03/12] remote-sim.c: " Simon Marchi
2015-11-03 16:12   ` Pedro Alves
2015-11-03 14:26 ` [PATCH c++ 04/12] target_ops masK_watchpoint: change int to target_hw_bp_type Simon Marchi
2015-11-03 16:14   ` Pedro Alves
2015-11-03 14:27 ` [PATCH c++ 09/12] linux-mips-low.c: Fix type of mips_add_watchpoint parameter Simon Marchi
2015-11-03 16:17   ` Pedro Alves
2015-11-03 14:27 ` [PATCH c++ 07/12] Change return type of raw_bkpt_type_to_arm_hwbp_type Simon Marchi
2015-11-03 16:16   ` Pedro Alves
2015-11-03 14:27 ` [PATCH c++ 10/12] linux-mips-low.c: Change "private" variable name Simon Marchi
2015-11-03 16:17   ` Pedro Alves
2015-11-03 14:27 ` [PATCH c++ 11/12] linux-mips-low.c: Add casts Simon Marchi
2015-11-03 16:18   ` Pedro Alves
2015-11-03 14:27 ` [PATCH c++ 05/12] linux-aarch32-low.c: Use NULL_REGSET Simon Marchi
2015-11-03 16:14   ` Pedro Alves
2015-11-03 14:27 ` [PATCH c++ 08/12] arm-linux-nat.c: Add cast Simon Marchi
2015-11-03 16:16   ` Pedro Alves
2015-11-03 14:27 ` [PATCH c++ 06/12] gdbserver arm: Add casts Simon Marchi
2015-11-03 16:15   ` Pedro Alves
2015-11-03 14:27 ` [PATCH c++ 12/12] xtensa: Add missing statics Simon Marchi
2015-11-03 16:19   ` Pedro Alves
2015-11-03 16:06 ` [PATCH c++ 01/12] linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lower Pedro Alves
2015-11-03 18:35   ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).