public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix tic6x-uclinux GDBserver build failure
@ 2017-11-15 17:20 Yao Qi
  2017-11-15 20:23 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2017-11-15 17:20 UTC (permalink / raw)
  To: gdb-patches

I can't find a c6x-uclinux c++ compiler, so I use my host g++ to build
tic6x-uclinux GDBserver, and find the following build failures.  They are
not target specific, so I believe they are real errors.  This patch fixes
them.

../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:313:34: error: invalid
conversion from 'void*' to 'tic6x_register*' [-fpermissive]
   union tic6x_register *regset = buf;
                                  ^
../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c: In function 'void tic6x_store_gregset(regcache*, const void*)':
../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:324:40: error: invalid
conversion from 'const void*' to 'const tic6x_register*' [-fpermissive]
   const union tic6x_register *regset = buf;
                                        ^

../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c: At global scope:
../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:359:28: error: redefinition of 'usrregs_info tic6x_usrregs_info'
 static struct usrregs_info tic6x_usrregs_info =
                            ^
../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:186:28: note: 'usrregs_info tic6x_usrregs_info' previously declared here
 static struct usrregs_info tic6x_usrregs_info;
                            ^

gdb/gdbserver:

2017-11-15  Yao Qi  <yao.qi@linaro.org>

	* linux-tic6x-low.c (tic6x_fill_gregset): Cast buf.
	(tic6x_store_gregset): Likewise.
	(tic6x_usrregs_info): Move it up.
---
 gdb/gdbserver/linux-tic6x-low.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/gdb/gdbserver/linux-tic6x-low.c b/gdb/gdbserver/linux-tic6x-low.c
index 7a32f7e..6dda52e 100644
--- a/gdb/gdbserver/linux-tic6x-low.c
+++ b/gdb/gdbserver/linux-tic6x-low.c
@@ -182,8 +182,11 @@ tic6x_sw_breakpoint_from_kind (int kind, int *size)
   return (const gdb_byte *) &tic6x_breakpoint;
 }
 
-/* Forward definition.  */
-static struct usrregs_info tic6x_usrregs_info;
+static struct usrregs_info tic6x_usrregs_info =
+  {
+    TIC6X_NUM_REGS,
+    NULL, /* Set in tic6x_read_description.  */
+  };
 
 static const struct target_desc *
 tic6x_read_description (void)
@@ -310,7 +313,7 @@ tic6x_supply_register (struct regcache *regcache, int regno,
 static void
 tic6x_fill_gregset (struct regcache *regcache, void *buf)
 {
-  union tic6x_register *regset = buf;
+  auto regset = static_cast<union tic6x_register *> (buf);
   int i;
 
   for (i = 0; i < TIC6X_NUM_REGS; i++)
@@ -321,7 +324,7 @@ tic6x_fill_gregset (struct regcache *regcache, void *buf)
 static void
 tic6x_store_gregset (struct regcache *regcache, const void *buf)
 {
-  const union tic6x_register *regset = buf;
+  const auto regset = static_cast<const union tic6x_register *> (buf);
   int i;
 
   for (i = 0; i < TIC6X_NUM_REGS; i++)
@@ -356,12 +359,6 @@ static struct regsets_info tic6x_regsets_info =
     NULL, /* disabled_regsets */
   };
 
-static struct usrregs_info tic6x_usrregs_info =
-  {
-    TIC6X_NUM_REGS,
-    NULL, /* Set in tic6x_read_description.  */
-  };
-
 static struct regs_info regs_info =
   {
     NULL, /* regset_bitmap */
-- 
1.9.1

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

* Re: [PATCH] Fix tic6x-uclinux GDBserver build failure
  2017-11-15 17:20 [PATCH] Fix tic6x-uclinux GDBserver build failure Yao Qi
@ 2017-11-15 20:23 ` Simon Marchi
  2017-11-16 10:06   ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2017-11-15 20:23 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 2017-11-15 12:20, Yao Qi wrote:
> I can't find a c6x-uclinux c++ compiler, so I use my host g++ to build
> tic6x-uclinux GDBserver, and find the following build failures.  They 
> are
> not target specific, so I believe they are real errors.  This patch 
> fixes
> them.
> 
> ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:313:34: error: invalid
> conversion from 'void*' to 'tic6x_register*' [-fpermissive]
>    union tic6x_register *regset = buf;
>                                   ^
> ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c: In function 'void
> tic6x_store_gregset(regcache*, const void*)':
> ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:324:40: error: invalid
> conversion from 'const void*' to 'const tic6x_register*' [-fpermissive]
>    const union tic6x_register *regset = buf;
>                                         ^
> 
> ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c: At global scope:
> ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:359:28: error:
> redefinition of 'usrregs_info tic6x_usrregs_info'
>  static struct usrregs_info tic6x_usrregs_info =
>                             ^
> ../binutils-gdb/gdb/gdbserver/linux-tic6x-low.c:186:28: note:
> 'usrregs_info tic6x_usrregs_info' previously declared here
>  static struct usrregs_info tic6x_usrregs_info;
>                             ^
> 
> gdb/gdbserver:
> 
> 2017-11-15  Yao Qi  <yao.qi@linaro.org>
> 
> 	* linux-tic6x-low.c (tic6x_fill_gregset): Cast buf.
> 	(tic6x_store_gregset): Likewise.
> 	(tic6x_usrregs_info): Move it up.
> ---
>  gdb/gdbserver/linux-tic6x-low.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/gdb/gdbserver/linux-tic6x-low.c 
> b/gdb/gdbserver/linux-tic6x-low.c
> index 7a32f7e..6dda52e 100644
> --- a/gdb/gdbserver/linux-tic6x-low.c
> +++ b/gdb/gdbserver/linux-tic6x-low.c
> @@ -182,8 +182,11 @@ tic6x_sw_breakpoint_from_kind (int kind, int 
> *size)
>    return (const gdb_byte *) &tic6x_breakpoint;
>  }
> 
> -/* Forward definition.  */
> -static struct usrregs_info tic6x_usrregs_info;
> +static struct usrregs_info tic6x_usrregs_info =
> +  {
> +    TIC6X_NUM_REGS,
> +    NULL, /* Set in tic6x_read_description.  */
> +  };
> 
>  static const struct target_desc *
>  tic6x_read_description (void)
> @@ -310,7 +313,7 @@ tic6x_supply_register (struct regcache *regcache, 
> int regno,
>  static void
>  tic6x_fill_gregset (struct regcache *regcache, void *buf)
>  {
> -  union tic6x_register *regset = buf;
> +  auto regset = static_cast<union tic6x_register *> (buf);
>    int i;
> 
>    for (i = 0; i < TIC6X_NUM_REGS; i++)
> @@ -321,7 +324,7 @@ tic6x_fill_gregset (struct regcache *regcache, void 
> *buf)
>  static void
>  tic6x_store_gregset (struct regcache *regcache, const void *buf)
>  {
> -  const union tic6x_register *regset = buf;
> +  const auto regset = static_cast<const union tic6x_register *> (buf);
>    int i;
> 
>    for (i = 0; i < TIC6X_NUM_REGS; i++)
> @@ -356,12 +359,6 @@ static struct regsets_info tic6x_regsets_info =
>      NULL, /* disabled_regsets */
>    };
> 
> -static struct usrregs_info tic6x_usrregs_info =
> -  {
> -    TIC6X_NUM_REGS,
> -    NULL, /* Set in tic6x_read_description.  */
> -  };
> -
>  static struct regs_info regs_info =
>    {
>      NULL, /* regset_bitmap */

Looks good to me.  The cast stuff is probably broken since we have 
switched to C++, so it gives an idea about the activity of this port.

Simon

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

* Re: [PATCH] Fix tic6x-uclinux GDBserver build failure
  2017-11-15 20:23 ` Simon Marchi
@ 2017-11-16 10:06   ` Yao Qi
  0 siblings, 0 replies; 3+ messages in thread
From: Yao Qi @ 2017-11-16 10:06 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

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

> Looks good to me.  The cast stuff is probably broken since we have
> switched to C++, so it gives an idea about the activity of this port.

I pushed it in.

-- 
Yao (齐尧)

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

end of thread, other threads:[~2017-11-16 10:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-15 17:20 [PATCH] Fix tic6x-uclinux GDBserver build failure Yao Qi
2017-11-15 20:23 ` Simon Marchi
2017-11-16 10:06   ` Yao Qi

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).