Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [ob/6.0] Fix a new sparc build failure
@ 2003-06-29 21:17 Daniel Jacobowitz
  2003-06-29 21:31 ` Andrew Cagney
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-06-29 21:17 UTC (permalink / raw)
  To: gdb-patches

sparc_y_regnum is mentioned in the tm header, so sparc-nat.c actually
references it.  Fixes another sparc-native build failure; checked in.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-06-29  Daniel Jacobowitz  <drow@mvista.com>

	* sparc-tdep.c (sparc_y_regnum): Make external again.

--- gdb-5.3.20030629/gdb/sparc-tdep.c.orig	2003-06-29 17:10:00.000000000 -0400
+++ gdb-5.3.20030629/gdb/sparc-tdep.c	2003-06-29 17:10:09.000000000 -0400
@@ -3188,7 +3188,7 @@ sparc_call_dummy_address (void)
 
 /* Supply the Y register number to those that need it.  */
 
-static int
+int
 sparc_y_regnum (void)
 {
   return gdbarch_tdep (current_gdbarch)->y_regnum;


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

* Re: [ob/6.0] Fix a new sparc build failure
  2003-06-29 21:17 [ob/6.0] Fix a new sparc build failure Daniel Jacobowitz
@ 2003-06-29 21:31 ` Andrew Cagney
  2003-06-29 21:37   ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2003-06-29 21:31 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> sparc_y_regnum is mentioned in the tm header, so sparc-nat.c actually
> references it.  Fixes another sparc-native build failure; checked in.

Missing an extern declaration?  The nat file would be getting -Wimplict.

Andrew



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

* Re: [ob/6.0] Fix a new sparc build failure
  2003-06-29 21:31 ` Andrew Cagney
@ 2003-06-29 21:37   ` Daniel Jacobowitz
  2003-06-29 22:15     ` Andrew Cagney
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-06-29 21:37 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

On Sun, Jun 29, 2003 at 05:27:52PM -0400, Andrew Cagney wrote:
> >sparc_y_regnum is mentioned in the tm header, so sparc-nat.c actually
> >references it.  Fixes another sparc-native build failure; checked in.
> 
> Missing an extern declaration?  The nat file would be getting -Wimplict.

No, the extern declaration is there too.  There was an extern followed
by a static, which some future version of GCC (probably 3.4) will warn
about.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [ob/6.0] Fix a new sparc build failure
  2003-06-29 21:37   ` Daniel Jacobowitz
@ 2003-06-29 22:15     ` Andrew Cagney
  2003-07-03 14:00       ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2003-06-29 22:15 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> On Sun, Jun 29, 2003 at 05:27:52PM -0400, Andrew Cagney wrote:
> 
>> >sparc_y_regnum is mentioned in the tm header, so sparc-nat.c actually
>> >references it.  Fixes another sparc-native build failure; checked in.
> 
>> 
>> Missing an extern declaration?  The nat file would be getting -Wimplict.
> 
> 
> No, the extern declaration is there too.  There was an extern followed
> by a static, which some future version of GCC (probably 3.4) will warn
> about.

Huh?

cagney@nettle$ gcc --version
2.95.3
cagney@nettle$ gcc -c foo.c
foo.c:2: warning: static declaration for `foo' follows non-static
cagney@nettle$ cat foo.c
extern void foo (void);
static void foo (void) { };

Notice where it occures:

#if defined (GDB_MULTI_ARCH) && (GDB_MULTI_ARCH > 0)
[...]
/* Multi-arch the nPC and Y registers.  */
#define Y_REGNUM              (sparc_y_regnum ())
extern int sparc_npc_regnum (void);
extern int sparc_y_regnum (void);

And the sparc-elf cross target, it turns out, isn't multi-arch so 
wouldn' get the warning :-/

Can you please move the extern declaration to "sparc-tdep.h"?  Without 
it, there's yet another -Wmissing-prototypes to fix.

Andrew



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

* Re: [ob/6.0] Fix a new sparc build failure
  2003-06-29 22:15     ` Andrew Cagney
@ 2003-07-03 14:00       ` Daniel Jacobowitz
  2003-07-03 14:24         ` Andrew Cagney
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-07-03 14:00 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

On Sun, Jun 29, 2003 at 06:14:50PM -0400, Andrew Cagney wrote:
> >On Sun, Jun 29, 2003 at 05:27:52PM -0400, Andrew Cagney wrote:
> >
> >>>sparc_y_regnum is mentioned in the tm header, so sparc-nat.c actually
> >>>references it.  Fixes another sparc-native build failure; checked in.
> >
> >>
> >>Missing an extern declaration?  The nat file would be getting -Wimplict.
> >
> >
> >No, the extern declaration is there too.  There was an extern followed
> >by a static, which some future version of GCC (probably 3.4) will warn
> >about.
> 
> Huh?
> 
> cagney@nettle$ gcc --version
> 2.95.3
> cagney@nettle$ gcc -c foo.c
> foo.c:2: warning: static declaration for `foo' follows non-static
> cagney@nettle$ cat foo.c
> extern void foo (void);
> static void foo (void) { };
> 
> Notice where it occures:
> 
> #if defined (GDB_MULTI_ARCH) && (GDB_MULTI_ARCH > 0)
> [...]
> /* Multi-arch the nPC and Y registers.  */
> #define Y_REGNUM              (sparc_y_regnum ())
> extern int sparc_npc_regnum (void);
> extern int sparc_y_regnum (void);
> 
> And the sparc-elf cross target, it turns out, isn't multi-arch so 
> wouldn' get the warning :-/
> 
> Can you please move the extern declaration to "sparc-tdep.h"?  Without 
> it, there's yet another -Wmissing-prototypes to fix.

Would you prefer creating a sparc-tdep.h for this, or just moving the
prototype out of the #if?  There's no sparc-tdep.h yet and I don't want
to do surgery on the sparc port to populate it properly.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [ob/6.0] Fix a new sparc build failure
  2003-07-03 14:00       ` Daniel Jacobowitz
@ 2003-07-03 14:24         ` Andrew Cagney
  2003-07-07 18:09           ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2003-07-03 14:24 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches


>> Can you please move the extern declaration to "sparc-tdep.h"?  Without 
>> it, there's yet another -Wmissing-prototypes to fix.
> 
> 
> Would you prefer creating a sparc-tdep.h for this, or just moving the
> prototype out of the #if?  There's no sparc-tdep.h yet and I don't want
> to do surgery on the sparc port to populate it properly.

Might was well just be done with it and create the "sparc-tdep.h" file. 
  No reason to populate it with anything other than something to fix the 
immediate problem though :-)

Andrew



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

* Re: [ob/6.0] Fix a new sparc build failure
  2003-07-03 14:24         ` Andrew Cagney
@ 2003-07-07 18:09           ` Daniel Jacobowitz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-07-07 18:09 UTC (permalink / raw)
  To: gdb-patches

On Thu, Jul 03, 2003 at 10:23:57AM -0400, Andrew Cagney wrote:
> 
> >>Can you please move the extern declaration to "sparc-tdep.h"?  Without 
> >>it, there's yet another -Wmissing-prototypes to fix.
> >
> >
> >Would you prefer creating a sparc-tdep.h for this, or just moving the
> >prototype out of the #if?  There's no sparc-tdep.h yet and I don't want
> >to do surgery on the sparc port to populate it properly.
> 
> Might was well just be done with it and create the "sparc-tdep.h" file. 
>  No reason to populate it with anything other than something to fix the 
> immediate problem though :-)
> 
> Andrew

Sounds good, here you go.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-07-07  Daniel Jacobowitz  <drow@mvista.com>

	* Makefile.in (sparc_tdep_h): New.
	(sparc-linux-nat.o, sparc-nat.o, sparc-tdep.o, sparc64nbsd-nat.o)
	(sparcnbsd-nat.o, sparcnbsd-tdep.o): Depend on $(sparc_tdep_h).
	* sparc-linux-nat.c: Include "sparc-tdep.h".
	* sparc-nat.c: Likewise.
	* sparc-tdep.c: Likewise.
	* sparc64nbsd-nat.c: Likewise.
	* sparcnbsd-nat.c: Likewise.
	* sparcnbsd-tdep.c: Likewise.
	* sparc-tdep.h: New file.
	* config/sparc/tm-sparc.h: Remove prototypes for sparc_y_regnum
	and sparc_npc_regnum.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.414
diff -u -p -r1.414 Makefile.in
--- Makefile.in	7 Jul 2003 15:06:11 -0000	1.414
+++ Makefile.in	7 Jul 2003 15:28:05 -0000
@@ -734,6 +734,7 @@ solib_h = solib.h
 solist_h = solist.h
 somsolib_h = somsolib.h
 source_h = source.h
+sparc_tdep_h = sparc-tdep.h
 sparcnbsd_tdep_h = sparcnbsd-tdep.h
 srec_h = srec.h
 stabsread_h = stabsread.h
@@ -2256,15 +2257,17 @@ source.o: source.c $(defs_h) $(symtab_h)
 	$(gdb_string_h) $(gdb_stat_h) $(gdbcore_h) $(gdb_regex_h) \
 	$(symfile_h) $(objfiles_h) $(annotate_h) $(gdbtypes_h) $(linespec_h) \
 	$(filenames_h) $(completer_h) $(ui_out_h) $(readline_h)
-sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h) $(gregset_h)
+sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h) $(sparc_tdep_h) \
+	$(gregset_h)
 sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
-	$(regcache_h) $(gdb_wait_h)
+	$(regcache_h) $(sparc_tdep_h) $(gdb_wait_h)
 sparc-stub.o: sparc-stub.c
 sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
 	$(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(regcache_h) \
-	$(osabi_h) $(gregset_h) $(gdbcore_h) $(gdb_assert_h) $(symfile_h)
+	$(osabi_h) $(gregset_h) $(gdbcore_h) $(gdb_assert_h) $(symfile_h) \
+	$(sparc_tdep_h)
 sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
-	$(sparcnbsd_tdep_h)
+	$(sparcnbsd_tdep_h) $(sparc_tdep_h)
 sparcl-stub.o: sparcl-stub.c
 sparcl-tdep.o: sparcl-tdep.c $(defs_h) $(gdbcore_h) $(breakpoint_h) \
 	$(target_h) $(serial_h) $(regcache_h)
@@ -2273,10 +2276,10 @@ sparclet-rom.o: sparclet-rom.c $(defs_h)
 	$(regcache_h)
 sparclet-stub.o: sparclet-stub.c
 sparcnbsd-nat.o: sparcnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
-	$(sparcnbsd_tdep_h)
+	$(sparcnbsd_tdep_h) $(sparc_tdep_h)
 sparcnbsd-tdep.o: sparcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
 	$(target_h) $(value_h) $(osabi_h) $(sparcnbsd_tdep_h) $(nbsd_tdep_h) \
-	$(solib_svr4_h)
+	$(solib_svr4_h) $(sparc_tdep_h)
 stabsread.o: stabsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(gdb_obstack_h) \
 	$(symtab_h) $(gdbtypes_h) $(expression_h) $(symfile_h) $(objfiles_h) \
 	$(aout_stab_gnu_h) $(libaout_h) $(aout_aout64_h) $(gdb_stabs_h) \
Index: sparc-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-linux-nat.c,v
retrieving revision 1.3
diff -u -p -r1.3 sparc-linux-nat.c
--- sparc-linux-nat.c	24 Feb 2002 22:14:33 -0000	1.3
+++ sparc-linux-nat.c	7 Jul 2003 15:28:06 -0000
@@ -1,6 +1,6 @@
 /* Native-dependent code for GNU/Linux SPARC.
 
-   Copyright 2001, 2002 Free Software Foundation, Inc.
+   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,6 +21,7 @@
 
 #include "defs.h"
 #include "regcache.h"
+#include "sparc-tdep.h"
    
 #include <sys/procfs.h>
 
Index: sparc-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-nat.c,v
retrieving revision 1.18
diff -u -p -r1.18 sparc-nat.c
--- sparc-nat.c	14 Jun 2003 16:22:23 -0000	1.18
+++ sparc-nat.c	7 Jul 2003 15:28:06 -0000
@@ -26,6 +26,8 @@
 #include "gdbcore.h"
 #include "regcache.h"
 
+#include "sparc-tdep.h"
+
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.116
diff -u -p -r1.116 sparc-tdep.c
--- sparc-tdep.c	3 Jul 2003 22:14:42 -0000	1.116
+++ sparc-tdep.c	7 Jul 2003 15:28:08 -0000
@@ -34,6 +34,8 @@
 #include "regcache.h"
 #include "osabi.h"
 
+#include "sparc-tdep.h"
+
 #ifdef	USE_PROC_FS
 #include <sys/procfs.h>
 /* Prototypes for supply_gregset etc. */
Index: sparc-tdep.h
===================================================================
RCS file: sparc-tdep.h
diff -N sparc-tdep.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sparc-tdep.h	7 Jul 2003 15:28:08 -0000
@@ -0,0 +1,22 @@
+/* Target-dependent code for the SPARC for GDB, the GNU debugger.
+
+   Copyright 2003 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+extern int sparc_y_regnum (void);
Index: sparc64nbsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64nbsd-nat.c,v
retrieving revision 1.1
diff -u -p -r1.1 sparc64nbsd-nat.c
--- sparc64nbsd-nat.c	31 May 2002 00:59:13 -0000	1.1
+++ sparc64nbsd-nat.c	7 Jul 2003 15:28:08 -0000
@@ -1,5 +1,5 @@
 /* Native-dependent code for UltraSPARC systems running NetBSD.
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2003 Free Software Foundation, Inc.
    Contributed by Wasabi Systems, Inc.
 
    This file is part of GDB.
@@ -23,6 +23,7 @@
 #include "inferior.h"
 #include "regcache.h"
 
+#include "sparc-tdep.h"
 #include "sparcnbsd-tdep.h"
 
 #include <sys/types.h>
Index: sparcnbsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/sparcnbsd-nat.c,v
retrieving revision 1.1
diff -u -p -r1.1 sparcnbsd-nat.c
--- sparcnbsd-nat.c	31 May 2002 00:59:13 -0000	1.1
+++ sparcnbsd-nat.c	7 Jul 2003 15:28:08 -0000
@@ -1,5 +1,5 @@
 /* Native-dependent code for SPARC systems running NetBSD.
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2003 Free Software Foundation, Inc.
    Contributed by Wasabi Systems, Inc.
 
    This file is part of GDB.
@@ -23,6 +23,7 @@
 #include "inferior.h"
 #include "regcache.h"
 
+#include "sparc-tdep.h"
 #include "sparcnbsd-tdep.h"
 
 #include <sys/types.h>
Index: sparcnbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparcnbsd-tdep.c,v
retrieving revision 1.5
diff -u -p -r1.5 sparcnbsd-tdep.c
--- sparcnbsd-tdep.c	2 Jun 2003 02:09:39 -0000	1.5
+++ sparcnbsd-tdep.c	7 Jul 2003 15:28:08 -0000
@@ -28,6 +28,7 @@
 
 #include "gdb_string.h"
 
+#include "sparc-tdep.h"
 #include "sparcnbsd-tdep.h"
 #include "nbsd-tdep.h"
 
Index: config/sparc/tm-sparc.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sparc.h,v
retrieving revision 1.55
diff -u -p -r1.55 tm-sparc.h
--- config/sparc/tm-sparc.h	3 Jul 2003 22:14:42 -0000	1.55
+++ config/sparc/tm-sparc.h	7 Jul 2003 15:28:09 -0000
@@ -316,8 +316,6 @@ extern int sparc_prologue_frameless_p (C
 
 /* Multi-arch the nPC and Y registers.  */
 #define Y_REGNUM              (sparc_y_regnum ())
-extern int sparc_npc_regnum (void);
-extern int sparc_y_regnum (void);
 
 #endif /* GDB_MULTI_ARCH */
 


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

end of thread, other threads:[~2003-07-07 18:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-29 21:17 [ob/6.0] Fix a new sparc build failure Daniel Jacobowitz
2003-06-29 21:31 ` Andrew Cagney
2003-06-29 21:37   ` Daniel Jacobowitz
2003-06-29 22:15     ` Andrew Cagney
2003-07-03 14:00       ` Daniel Jacobowitz
2003-07-03 14:24         ` Andrew Cagney
2003-07-07 18:09           ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox