* PATCH: Build sh-elf with -Werror
@ 2005-11-02 15:25 Andrew STUBBS
2005-11-02 18:40 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Andrew STUBBS @ 2005-11-02 15:25 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 535 bytes --]
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
[-- Attachment #2: remove_warnings.patch --]
[-- Type: text/plain, Size: 7120 bytes --]
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);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: PATCH: Build sh-elf with -Werror
2005-11-02 15:25 PATCH: Build sh-elf with -Werror Andrew STUBBS
@ 2005-11-02 18:40 ` Daniel Jacobowitz
2005-11-02 19:55 ` Andrew STUBBS
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-11-02 18:40 UTC (permalink / raw)
To: Andrew STUBBS; +Cc: gdb-patches
On Wed, Nov 02, 2005 at 02:50:31PM +0000, Andrew STUBBS wrote:
> 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 gdb_byte warnings mostly only show up with gcc4.
> 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.
These are OK. Thanks.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: Build sh-elf with -Werror
2005-11-02 18:40 ` Daniel Jacobowitz
@ 2005-11-02 19:55 ` Andrew STUBBS
0 siblings, 0 replies; 3+ messages in thread
From: Andrew STUBBS @ 2005-11-02 19:55 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz wrote:
> The gdb_byte warnings mostly only show up with gcc4.
$ gcc --version
gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-53)
>>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.
>
>
> These are OK. Thanks.
Thanks, commited.
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-02 15:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-02 15:25 PATCH: Build sh-elf with -Werror Andrew STUBBS
2005-11-02 18:40 ` Daniel Jacobowitz
2005-11-02 19:55 ` Andrew STUBBS
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox