* [patch rfc] -Wmissing-prototypes round #3
@ 2003-06-11 17:43 Andrew Cagney
2003-06-11 18:56 ` Mark Kettenis
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Andrew Cagney @ 2003-06-11 17:43 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 818 bytes --]
Hello,
This is the next round of fixes for -Wmissing-prototypes. This patch:
- add missing function declarations to CPU-tdep.h
Ex, the externs in ia64-tdep.c were replaced by declarations in the
corresponding .h file
- move function declarations to CPU-tdep.h, from config/CPU/tm-CPU.h
Ex, m68k's delta68 functions previously in tm-delta.h.
This ensures that the function declaration is always visible, and that a
global function in CPU-tdep.c has its declaration in the corresponding
CPU-tdep.h file. The config/CPU/tm-CPU.h files were also updated to
include the corresponding "CPU-tdep.h".
- where needed, create missing CPU-tdep.h files
Ex: sparc-tdep.h and ia64-aix-tdep.h being created.
This again ensures that foo.c's function declaration is in foo.h.
I'll look to commit this in a few days.
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 25727 bytes --]
2003-06-11 Andrew Cagney <cagney@redhat.com>
* config/i386/tm-i386.h (print_387_status_word): Delete
declaration, moved to "i387-tdep.h".
(print_387_status_word): Ditto.
* config/i386/tm-linux.h (i386_linux_skip_solib_resolver): Delete
extern declaration, moved to "i386-linux-tdep.h". Include
"i386-linux-tdep.h".
* i386-linux-tdep.h (i386_linux_skip_solib_resolver): Add decl.
* config/sparc/tm-sun4os4.h (sunos4_skip_trampoline_code): Delete
declaration, moved to "sparc-tdep.h". Include "sparc-tdep.h".
Update copyright.
* sparc-tdep.c: Include "sparc-tdep.h".
* sparc-tdep.h: New file.
* wince.c: Include "mips-tdep.h".
* mips-tdep.h (mips_next_pc): Declare.
* mcore-tdep.c: Make more local functions static.
* config/m68k/tm-delta68.h: Include "m68k-tdep.h".
(delta68_frame_args_address): Delete decl, moved to "m68k-tdep.h".
(delta68_frame_saved_pc, delta68_in_sigtramp): Ditto.
(delta68_frame_num_args): Ditto.
* m68k-tdep.h (delta68_in_sigtramp): Add extern decl.
(delta68_frame_args_address, delta68_frame_saved_pc): Ditto.
(delta68_frame_num_args): Ditto.
* ia64-linux-tdep.c: Include "ia64-linux-tdep.h".
* ia64-tdep.c: Include "ia64-linux-tdep.h" and "ia64-aix-tdep.h".
(ia64_linux_sigcontext_register_address): Delete extern decl.
(ia64_aix_sigcontext_register_address): Delete extern decl.
* config/ia64/tm-aix.h (ia64_aix_in_sigtramp): Delete declaration,
moved to "ia64-aix-tdep.h", include "ia64-aix-tdep.h".
* ia64-aix-tdep.c: Include "ia64-aix-tdep.h".
* ia64-aix-tdep.h, ia64-linux-tdep.h: New file.
* i386-tdep.c (i386_fetch_pointer_argument): Make static.
* i387-tdep.c: Include "i387-tdep.h".
* Makefile.in (i387-tdep.o): Update dependencies.
(ia64_aix_tdep_h, ia64_linux_tdep_h): Define.
(ia64-aix-tdep.o): Update dependencies.
(ia64-tdep.o): Update dependencies.
(ia64-linux-tdep.o): Update dependencies.
(m68k-tdep.o): Update dependencies.
(wince.o): Update dependencies.
(sparc-tdep.o): Update dependencies.
* config/arm/tm-linux.h (arm_linux_svr4_fetch_link_map_offsets):
Delete declaration, moved to "arm-tdep.h". Include "arm-tdep.h".
* arm-tdep.h: Add ARM_TDEP_H wrapper.
(arm_linux_svr4_fetch_link_map_offsets): Declare.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.398
diff -u -r1.398 Makefile.in
--- Makefile.in 11 Jun 2003 13:50:11 -0000 1.398
+++ Makefile.in 11 Jun 2003 17:24:05 -0000
@@ -673,6 +673,8 @@
i386_linux_tdep_h = i386-linux-tdep.h
i386_tdep_h = i386-tdep.h
i387_tdep_h = i387-tdep.h
+ia64_aix_tdep_h = ia64-aix-tdep.h
+ia64_linux_tdep_h = ia64-linux-tdep.h
inf_loop_h = inf-loop.h
infcall_h = infcall.h
inferior_h = inferior.h $(breakpoint_h) $(target_h) $(frame_h)
@@ -1840,17 +1842,20 @@
$(i386_tdep_h) $(i387_tdep_h) $(gregset_h)
i387-tdep.o: i387-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(language_h) \
$(value_h) $(gdbcore_h) $(floatformat_h) $(regcache_h) \
- $(gdb_assert_h) $(gdb_string_h) $(doublest_h) $(i386_tdep_h)
+ $(gdb_assert_h) $(gdb_string_h) $(doublest_h) $(i386_tdep_h) \
+ $(i387_tdep_h)
ia64-aix-nat.o: ia64-aix-nat.c $(defs_h) $(inferior_h) $(target_h) \
$(gdbcore_h) $(regcache_h) $(symtab_h) $(bfd_h) $(symfile_h) \
$(objfiles_h) $(gdb_stat_h)
-ia64-aix-tdep.o: ia64-aix-tdep.c $(defs_h)
+ia64-aix-tdep.o: ia64-aix-tdep.c $(defs_h) $(ia64_aix_tdep_h)
ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(gdb_string_h) $(inferior_h) \
$(target_h) $(gdbcore_h) $(regcache_h) $(gdb_wait_h) $(gregset_h)
-ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h)
+ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h) \
+ $(ia64_linux_tdep_h)
ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \
$(arch_utils_h) $(floatformat_h) $(regcache_h) $(doublest_h) \
- $(value_h) $(gdb_assert_h) $(objfiles_h) $(elf_common_h) $(elf_bfd_h)
+ $(value_h) $(gdb_assert_h) $(objfiles_h) $(elf_common_h) \
+ $(elf_bfd_h) $(ia64_linux_tdep_h) $(ia64_aix_tdep_h)
inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \
$(event_top_h) $(inf_loop_h) $(remote_h)
infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \
@@ -1934,7 +1939,7 @@
m68k-stub.o: m68k-stub.c
m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h) \
$(value_h) $(gdb_string_h) $(inferior_h) $(regcache_h) \
- $(arch_utils_h) $(gregset_h) $(osabi_h) $(m68k_tdep_h)
+ $(arch_utils_h) $(osabi_h) $(m68k_tdep_h) $(gregset_h)
m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \
$(language_h) $(gdbcore_h) $(gdb_string_h) $(regcache_h) \
$(m68k_tdep_h) $(gdb_stat_h) $(floatformat_h) $(target_h)
@@ -2244,9 +2249,10 @@
sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
$(regcache_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)
+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) $(sparc_tdep_h) $(gregset_h) $(gdbcore_h) \
+ $(gdb_assert_h) $(symfile_h)
sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
$(sparcnbsd_tdep_h)
sparcl-stub.o: sparcl-stub.c
@@ -2365,8 +2371,8 @@
$(top_h) $(i386_tdep_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \
$(gdb_string_h) $(gdbthread_h) $(gdbcmd_h)
wince-stub.o: wince-stub.c $(wince_stub_h)
-wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) \
- $(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \
+wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
+ $(gdbcore_h) $(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \
$(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(wince_stub_h) \
$(regcache_h)
wrapper.o: wrapper.c $(defs_h) $(value_h) $(wrapper_h)
Index: arm-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.h,v
retrieving revision 1.11
diff -u -r1.11 arm-tdep.h
--- arm-tdep.h 22 Mar 2003 20:39:21 -0000 1.11
+++ arm-tdep.h 11 Jun 2003 17:24:06 -0000
@@ -18,6 +18,9 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef ARM_TDEP_H
+#define ARM_TDEP_H
+
/* Register numbers of various important registers. Note that some of
these values are "real" register numbers, and correspond to the
general registers of the machine, and some are "phony" register
@@ -158,3 +161,7 @@
CORE_ADDR thumb_get_next_pc (CORE_ADDR);
CORE_ADDR arm_get_next_pc (CORE_ADDR);
+
+extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void);
+
+#endif
Index: i386-linux-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-tdep.h,v
retrieving revision 1.2
diff -u -r1.2 i386-linux-tdep.h
--- i386-linux-tdep.h 18 Sep 2002 22:00:22 -0000 1.2
+++ i386-linux-tdep.h 11 Jun 2003 17:24:06 -0000
@@ -33,4 +33,6 @@
system call number that the kernel is supposed to restart. */
#define I386_LINUX_ORIG_EAX_REGNUM I386_SSE_NUM_REGS
+extern CORE_ADDR i386_linux_skip_solib_resolver (CORE_ADDR pc);
+
#endif /* i386-linux-tdep.h */
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.152
diff -u -r1.152 i386-tdep.c
--- i386-tdep.c 9 Jun 2003 17:35:57 -0000 1.152
+++ i386-tdep.c 11 Jun 2003 17:24:06 -0000
@@ -1606,7 +1606,7 @@
\f
/* Get the ith function argument for the current function. */
-CORE_ADDR
+static CORE_ADDR
i386_fetch_pointer_argument (struct frame_info *frame, int argi,
struct type *type)
{
Index: i387-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.c,v
retrieving revision 1.30
diff -u -r1.30 i387-tdep.c
--- i387-tdep.c 4 May 2003 10:27:47 -0000 1.30
+++ i387-tdep.c 11 Jun 2003 17:24:07 -0000
@@ -33,6 +33,7 @@
#include "doublest.h"
#include "i386-tdep.h"
+#include "i387-tdep.h"
\f
/* FIXME: The functions on this page are used by the old `info float'
Index: i387-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.h,v
retrieving revision 1.4
diff -u -r1.4 i387-tdep.h
--- i387-tdep.h 12 Apr 2003 17:41:25 -0000 1.4
+++ i387-tdep.h 11 Jun 2003 17:24:07 -0000
@@ -64,4 +64,7 @@
extern void i387_fill_fxsave (char *fxsave, int regnum);
+extern void print_387_control_word (unsigned int);
+extern void print_387_status_word (unsigned int);
+
#endif /* i387-tdep.h */
Index: ia64-aix-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-aix-tdep.c,v
retrieving revision 1.1
diff -u -r1.1 ia64-aix-tdep.c
--- ia64-aix-tdep.c 22 Feb 2001 03:01:27 -0000 1.1
+++ ia64-aix-tdep.c 11 Jun 2003 17:24:07 -0000
@@ -20,6 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "ia64-aix-tdep.h"
/* External hook for finding gate addresses on AIX. */
void (*aix5_find_gate_addresses_hook) (CORE_ADDR *, CORE_ADDR *) = 0;
Index: ia64-aix-tdep.h
===================================================================
RCS file: ia64-aix-tdep.h
diff -N ia64-aix-tdep.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ia64-aix-tdep.h 11 Jun 2003 17:24:07 -0000
@@ -0,0 +1,30 @@
+/* IA64 AIX target-dependent code 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. */
+
+#ifndef IA64_AIX_TDEP_H
+#define IA64_AIX_TDEP_H
+
+extern int ia64_aix_in_sigtramp (CORE_ADDR pc, char *func_name);
+extern CORE_ADDR ia64_aix_sigcontext_register_address (CORE_ADDR sp,
+ int regno);
+
+#endif
+
Index: ia64-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-linux-tdep.c,v
retrieving revision 1.3
diff -u -r1.3 ia64-linux-tdep.c
--- ia64-linux-tdep.c 1 Jun 2001 02:22:01 -0000 1.3
+++ ia64-linux-tdep.c 11 Jun 2003 17:24:07 -0000
@@ -21,6 +21,7 @@
#include "defs.h"
#include "arch-utils.h"
+#include "ia64-linux-tdep.h"
/* The sigtramp code is in a non-readable (executable-only) region
of memory called the ``gate page''. The addresses in question
Index: ia64-linux-tdep.h
===================================================================
RCS file: ia64-linux-tdep.h
diff -N ia64-linux-tdep.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ia64-linux-tdep.h 11 Jun 2003 17:24:07 -0000
@@ -0,0 +1,27 @@
+/* IA64 GNU/Linux target-dependent code 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. */
+
+#ifndef IA64_LINUX_TDEP_H
+#define IA64_LINUX_TDEP_H
+
+extern CORE_ADDR ia64_linux_sigcontext_register_address (CORE_ADDR, int);
+
+#endif
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.84
diff -u -r1.84 ia64-tdep.c
--- ia64-tdep.c 11 Jun 2003 13:16:27 -0000 1.84
+++ ia64-tdep.c 11 Jun 2003 17:24:08 -0000
@@ -32,6 +32,8 @@
#include "objfiles.h"
#include "elf/common.h" /* for DT_PLTGOT value */
#include "elf-bfd.h"
+#include "ia64-linux-tdep.h"
+#include "ia64-aix-tdep.h"
/* Hook for determining the global pointer when calling functions in
the inferior under AIX. The initialization code in ia64-aix-nat.c
@@ -78,10 +80,6 @@
/* Length in bytes of an instruction bundle */
#define BUNDLE_LEN 16
-
-/* FIXME: These extern declarations should go in ia64-tdep.h. */
-extern CORE_ADDR ia64_linux_sigcontext_register_address (CORE_ADDR, int);
-extern CORE_ADDR ia64_aix_sigcontext_register_address (CORE_ADDR, int);
static gdbarch_init_ftype ia64_gdbarch_init;
Index: m68k-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/m68k-tdep.h,v
retrieving revision 1.2
diff -u -r1.2 m68k-tdep.h
--- m68k-tdep.h 25 May 2003 18:50:54 -0000 1.2
+++ m68k-tdep.h 11 Jun 2003 17:24:08 -0000
@@ -54,4 +54,10 @@
size_t jb_elt_size;
};
+/* Partially multi-arched exports. */
+extern int delta68_in_sigtramp (CORE_ADDR pc, char *name);
+extern CORE_ADDR delta68_frame_args_address (struct frame_info *frame_info);
+extern CORE_ADDR delta68_frame_saved_pc (struct frame_info *frame_info);
+extern int delta68_frame_num_args (struct frame_info *fi);
+
#endif /* M68K_TDEP_H */
Index: mcore-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mcore-tdep.c,v
retrieving revision 1.67
diff -u -r1.67 mcore-tdep.c
--- mcore-tdep.c 11 Jun 2003 13:16:27 -0000 1.67
+++ mcore-tdep.c 11 Jun 2003 17:24:09 -0000
@@ -202,7 +202,7 @@
instructions are 16 bits, this is all we need, regardless of
address. bpkt = 0x0000 */
-const unsigned char *
+static const unsigned char *
mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size)
{
static char breakpoint[] =
@@ -606,7 +606,7 @@
then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC
will be called for the new frame. */
-CORE_ADDR
+static CORE_ADDR
mcore_frame_chain (struct frame_info * fi)
{
struct frame_info *dummy;
@@ -664,7 +664,7 @@
/* Skip the prologue of the function at PC. */
-CORE_ADDR
+static CORE_ADDR
mcore_skip_prologue (CORE_ADDR pc)
{
CORE_ADDR func_addr, func_end;
@@ -684,13 +684,13 @@
}
/* Return the address at which function arguments are offset. */
-CORE_ADDR
+static CORE_ADDR
mcore_frame_args_address (struct frame_info * fi)
{
return get_frame_base (fi) - get_frame_extra_info (fi)->framesize;
}
-CORE_ADDR
+static CORE_ADDR
mcore_frame_locals_address (struct frame_info * fi)
{
return get_frame_base (fi) - get_frame_extra_info (fi)->framesize;
@@ -716,7 +716,7 @@
/* Find the value of register REGNUM in frame FI. */
-CORE_ADDR
+static CORE_ADDR
mcore_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi != NULL; fi = get_next_frame (fi))
@@ -735,7 +735,7 @@
/* Find the saved pc in frame FI. */
-CORE_ADDR
+static CORE_ADDR
mcore_frame_saved_pc (struct frame_info * fi)
{
@@ -802,7 +802,7 @@
FIRST_ARGREG, since the MCORE treats struct returns (of less than eight
bytes) as hidden first arguments. */
-CORE_ADDR
+static CORE_ADDR
mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
@@ -912,7 +912,7 @@
opted to use generic call dummies, so we simply store the
CALL_DUMMY_ADDRESS into the PR register (r15). */
-CORE_ADDR
+static CORE_ADDR
mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
write_register (PR_REGNUM, CALL_DUMMY_ADDRESS ());
@@ -938,7 +938,7 @@
EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
and TYPE is the type (which is known to be struct, union or array). */
-int
+static int
mcore_use_struct_convention (int gcc_p, struct type *type)
{
return (TYPE_LENGTH (type) > 8);
@@ -948,7 +948,7 @@
this buffer was passed as a hidden first argument, so
just return that address. */
-CORE_ADDR
+static CORE_ADDR
mcore_extract_struct_value_address (char *regbuf)
{
return extract_unsigned_integer (regbuf + REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE);
@@ -958,7 +958,7 @@
the function's return value and place the result into VALBUF.
REGBUF is the register contents of the target. */
-void
+static void
mcore_extract_return_value (struct type *type, char *regbuf, char *valbuf)
{
/* Copy the return value (starting) in RETVAL_REGNUM to VALBUF. */
@@ -978,7 +978,7 @@
significant word) and r3 (least significant word, left justified).
Note that this includes structures of less than eight bytes, too. */
-void
+static void
mcore_store_return_value (struct type *type, char *valbuf)
{
int value_size;
@@ -1004,7 +1004,7 @@
This includes allocating space for saved registers and analyzing
the prologue of this frame. */
-void
+static void
mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
if (fi && get_next_frame (fi))
Index: mips-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.h,v
retrieving revision 1.2
diff -u -r1.2 mips-tdep.h
--- mips-tdep.h 12 Apr 2003 17:41:25 -0000 1.2
+++ mips-tdep.h 11 Jun 2003 17:24:09 -0000
@@ -40,4 +40,7 @@
/* Return the MIPS ABI associated with GDBARCH. */
enum mips_abi mips_abi (struct gdbarch *gdbarch);
+/* For wince :-(. */
+extern CORE_ADDR mips_next_pc (CORE_ADDR pc);
+
#endif /* MIPS_TDEP_H */
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.112
diff -u -r1.112 sparc-tdep.c
--- sparc-tdep.c 11 Jun 2003 13:16:29 -0000 1.112
+++ sparc-tdep.c 11 Jun 2003 17:24:10 -0000
@@ -33,6 +33,7 @@
#include "gdb_string.h"
#include "regcache.h"
#include "osabi.h"
+#include "sparc-tdep.h"
#ifdef USE_PROC_FS
#include <sys/procfs.h>
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 11 Jun 2003 17:24:10 -0000
@@ -0,0 +1,28 @@
+/* SPARC target-dependent code 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. */
+
+#ifndef SPARC_TDEP_H
+#define SPARC_TDEP_H
+
+extern CORE_ADDR sunos4_skip_trampoline_code (CORE_ADDR pc);
+
+#endif
+
Index: wince.c
===================================================================
RCS file: /cvs/src/src/gdb/wince.c,v
retrieving revision 1.22
diff -u -r1.22 wince.c
--- wince.c 12 Nov 2002 21:43:55 -0000 1.22
+++ wince.c 11 Jun 2003 17:24:11 -0000
@@ -56,6 +56,7 @@
#include "wince-stub.h"
#include <time.h>
#include "regcache.h"
+#include "mips-tdep.h"
/* The ui's event loop. */
extern int (*ui_loop_hook) (int signo);
Index: config/arm/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-linux.h,v
retrieving revision 1.17
diff -u -r1.17 tm-linux.h
--- config/arm/tm-linux.h 5 Jun 2002 19:18:16 -0000 1.17
+++ config/arm/tm-linux.h 11 Jun 2003 17:24:11 -0000
@@ -27,11 +27,11 @@
/* Include the common ARM target definitions. */
#include "arm/tm-arm.h"
+#include "arm-tdep.h"
#include "config/tm-linux.h"
/* Use target-specific function to define link map offsets. */
-extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void);
#define SVR4_FETCH_LINK_MAP_OFFSETS() arm_linux_svr4_fetch_link_map_offsets ()
/* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
Index: config/i386/tm-i386.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-i386.h,v
retrieving revision 1.45
diff -u -r1.45 tm-i386.h
--- config/i386/tm-i386.h 15 Aug 2002 19:00:47 -0000 1.45
+++ config/i386/tm-i386.h 11 Jun 2003 17:24:11 -0000
@@ -24,8 +24,4 @@
#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-/* FIXME: kettenis/2000-06-12: These do not belong here. */
-extern void print_387_control_word (unsigned int);
-extern void print_387_status_word (unsigned int);
-
#endif /* ifndef TM_I386_H */
Index: config/i386/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-linux.h,v
retrieving revision 1.23
diff -u -r1.23 tm-linux.h
--- config/i386/tm-linux.h 10 May 2003 20:14:43 -0000 1.23
+++ config/i386/tm-linux.h 11 Jun 2003 17:24:11 -0000
@@ -25,6 +25,7 @@
#include "i386/tm-i386.h"
#include "config/tm-linux.h"
+#include "i386-linux-tdep.h"
/* The following works around a problem with /usr/include/sys/procfs.h */
#define sys_quotactl 1
@@ -35,7 +36,6 @@
when to skip, and where to skip to. See the comments for
SKIP_SOLIB_RESOLVER at the top of infrun.c. */
#define SKIP_SOLIB_RESOLVER i386_linux_skip_solib_resolver
-extern CORE_ADDR i386_linux_skip_solib_resolver (CORE_ADDR pc);
/* N_FUN symbols in shared libaries have 0 for their values and need
to be relocated. */
Index: config/ia64/tm-aix.h
===================================================================
RCS file: /cvs/src/src/gdb/config/ia64/tm-aix.h,v
retrieving revision 1.3
diff -u -r1.3 tm-aix.h
--- config/ia64/tm-aix.h 5 Jun 2002 19:18:22 -0000 1.3
+++ config/ia64/tm-aix.h 11 Jun 2003 17:24:11 -0000
@@ -22,11 +22,11 @@
#define TM_AIX_H
#include "ia64/tm-ia64.h"
+#include "ia64-aix-tdep.h"
#include "config/tm-sysv4.h"
#define TARGET_ELF64
-extern int ia64_aix_in_sigtramp (CORE_ADDR pc, char *func_name);
#define IN_SIGTRAMP(pc,func_name) ia64_aix_in_sigtramp (pc, func_name)
#endif /* #ifndef TM_AIX_H */
Index: config/m68k/tm-delta68.h
===================================================================
RCS file: /cvs/src/src/gdb/config/m68k/tm-delta68.h,v
retrieving revision 1.10
diff -u -r1.10 tm-delta68.h
--- config/m68k/tm-delta68.h 12 Apr 2003 17:41:26 -0000 1.10
+++ config/m68k/tm-delta68.h 11 Jun 2003 17:24:11 -0000
@@ -21,6 +21,7 @@
struct frame_info;
#include "regcache.h"
+#include "m68k-tdep.h"
/* Define BPT_VECTOR if it is different than the default.
This is the vector number used by traps to indicate a breakpoint. */
@@ -80,7 +81,6 @@
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
-extern int delta68_frame_num_args (struct frame_info *fi);
#define FRAME_NUM_ARGS(fi) (delta68_frame_num_args ((fi)))
/* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear
@@ -97,13 +97,10 @@
#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF)\
(*(CORE_ADDR *)((char*)(REGBUF) + 8 * 4))
-extern int delta68_in_sigtramp (CORE_ADDR pc, char *name);
#define IN_SIGTRAMP(pc,name) delta68_in_sigtramp (pc, name)
-extern CORE_ADDR delta68_frame_saved_pc (struct frame_info *fi);
#undef DEPRECATED_FRAME_SAVED_PC
#define DEPRECATED_FRAME_SAVED_PC(fi) delta68_frame_saved_pc (fi)
-extern CORE_ADDR delta68_frame_args_address (struct frame_info *fi);
#undef FRAME_ARGS_ADDRESS
#define FRAME_ARGS_ADDRESS(fi) delta68_frame_args_address (fi)
Index: config/sparc/tm-sun4os4.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sun4os4.h,v
retrieving revision 1.4
diff -u -r1.4 tm-sun4os4.h
--- config/sparc/tm-sun4os4.h 5 Jun 2002 19:18:29 -0000 1.4
+++ config/sparc/tm-sun4os4.h 11 Jun 2003 17:24:11 -0000
@@ -1,6 +1,7 @@
/* Macro definitions for GDB for a Sun 4 running sunos 4.
- Copyright 1989, 1992, 1994, 1995, 1998, 2000
- Free Software Foundation, Inc.
+
+ Copyright 1989, 1992, 1994, 1995, 1998, 2000, 2003 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -21,13 +22,13 @@
#include "sparc/tm-sparc.h"
#include "config/tm-sunos.h"
+#include "sparc-tdep.h"
/* Redefine SKIP_TRAMPOLINE_CODE to handle PIC compiled modules
in main executables. */
#undef SKIP_TRAMPOLINE_CODE
#define SKIP_TRAMPOLINE_CODE(pc) sunos4_skip_trampoline_code (pc)
-extern CORE_ADDR sunos4_skip_trampoline_code (CORE_ADDR);
/* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
comment in <machine/setjmp.h>! */
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch rfc] -Wmissing-prototypes round #3
2003-06-11 17:43 [patch rfc] -Wmissing-prototypes round #3 Andrew Cagney
@ 2003-06-11 18:56 ` Mark Kettenis
2003-06-11 19:25 ` Andrew Cagney
2003-06-11 20:31 ` Kevin Buettner
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Mark Kettenis @ 2003-06-11 18:56 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
Andrew Cagney <ac131313@redhat.com> writes:
> - move function declarations to CPU-tdep.h, from config/CPU/tm-CPU.h
> Ex, m68k's delta68 functions previously in tm-delta.h.
> This ensures that the function declaration is always visible, and that a
> global function in CPU-tdep.c has its declaration in the corresponding
> CPU-tdep.h file. The config/CPU/tm-CPU.h files were also updated to
> include the corresponding "CPU-tdep.h".
I'm not sure whether this part of your patch is a good idea. Quite a
number of function declarations in config/CPU/tm-CPU.h are for things
that haven't been multi-arched yet. Keeping the function declaration
next to the #define that uses them, makes it easier to remove them
once they're no longer needed.
Mark
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch rfc] -Wmissing-prototypes round #3
2003-06-11 18:56 ` Mark Kettenis
@ 2003-06-11 19:25 ` Andrew Cagney
2003-06-11 23:47 ` Kevin Buettner
0 siblings, 1 reply; 12+ messages in thread
From: Andrew Cagney @ 2003-06-11 19:25 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
> Andrew Cagney <ac131313@redhat.com> writes:
>
>
>> - move function declarations to CPU-tdep.h, from config/CPU/tm-CPU.h
>> Ex, m68k's delta68 functions previously in tm-delta.h.
>> This ensures that the function declaration is always visible, and that a
>> global function in CPU-tdep.c has its declaration in the corresponding
>> CPU-tdep.h file. The config/CPU/tm-CPU.h files were also updated to
>> include the corresponding "CPU-tdep.h".
>
>
> I'm not sure whether this part of your patch is a good idea. Quite a
> number of function declarations in config/CPU/tm-CPU.h are for things
> that haven't been multi-arched yet. Keeping the function declaration
> next to the #define that uses them, makes it easier to remove them
> once they're no longer needed.
I thought someone might comment, that's why I tried to make what was
happening very clear :-)
It's a real trade off.
-- delay -Wmissing-prototypes until multi-arch is finished
-- move the declarations so that they are always visible
-- drop -Werror for certain architectures
Given the problems that -Wmissing-prototypes has thrown up (extern in
.c, forgetting to include .h), I'd prefer to see it enabled.
Also note the number of *-tdep.c functions I make static. It's pretty
clear that people deleting the #define/declaration consistently forget
to update the corresponding function definition.
I think a better way of handling these stray global declarations would
be to use some sort of real code analysis tool (which the ari isn't :-).
enjoy,
Andrew
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch rfc] -Wmissing-prototypes round #3
2003-06-11 17:43 [patch rfc] -Wmissing-prototypes round #3 Andrew Cagney
2003-06-11 18:56 ` Mark Kettenis
@ 2003-06-11 20:31 ` Kevin Buettner
2003-06-11 20:59 ` Andrew Cagney
2003-06-12 14:30 ` Richard Earnshaw
2003-06-12 18:08 ` Andrew Cagney
3 siblings, 1 reply; 12+ messages in thread
From: Kevin Buettner @ 2003-06-11 20:31 UTC (permalink / raw)
To: Andrew Cagney, gdb-patches
On Jun 11, 1:42pm, Andrew Cagney wrote:
> This is the next round of fixes for -Wmissing-prototypes. This patch:
>
> - add missing function declarations to CPU-tdep.h
> Ex, the externs in ia64-tdep.c were replaced by declarations in the
> corresponding .h file
[...]
>
> - where needed, create missing CPU-tdep.h files
> Ex: sparc-tdep.h and ia64-aix-tdep.h being created.
> This again ensures that foo.c's function declaration is in foo.h.
Some comments with regard to IA-64:
1) I'd rather have the declarations for
ia64_linux_sigcontext_register_address() and
ia64_aix_sigcontext_register_address() go into a single ia64-tdep.h
file. I think having two files is overkill.
2) However, even that shouldn't be necessary. Now that we have the
OSABI machinery, it should be possible to solve the problem without
having to export these functions at all.
Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch rfc] -Wmissing-prototypes round #3
2003-06-11 20:31 ` Kevin Buettner
@ 2003-06-11 20:59 ` Andrew Cagney
2003-06-11 23:30 ` Kevin Buettner
0 siblings, 1 reply; 12+ messages in thread
From: Andrew Cagney @ 2003-06-11 20:59 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
> On Jun 11, 1:42pm, Andrew Cagney wrote:
>
>
>> This is the next round of fixes for -Wmissing-prototypes. This patch:
>>
>> - add missing function declarations to CPU-tdep.h
>> Ex, the externs in ia64-tdep.c were replaced by declarations in the
>> corresponding .h file
>
> [...]
>
>>
>> - where needed, create missing CPU-tdep.h files
>> Ex: sparc-tdep.h and ia64-aix-tdep.h being created.
>> This again ensures that foo.c's function declaration is in foo.h.
>
>
> Some comments with regard to IA-64:
>
> 1) I'd rather have the declarations for
> ia64_linux_sigcontext_register_address() and
> ia64_aix_sigcontext_register_address() go into a single ia64-tdep.h
> file. I think having two files is overkill.
I'ts 6 of one half dozen of the other. At least it's clear which .c
file the .h declaration belongs to. If someone later eliminates it, all
the better.
> 2) However, even that shouldn't be necessary. Now that we have the
> OSABI machinery, it should be possible to solve the problem without
> having to export these functions at all.
In the mean time I'd like to get -Wmissing-prototypes enabled.
Andrew
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch rfc] -Wmissing-prototypes round #3
2003-06-11 20:59 ` Andrew Cagney
@ 2003-06-11 23:30 ` Kevin Buettner
0 siblings, 0 replies; 12+ messages in thread
From: Kevin Buettner @ 2003-06-11 23:30 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Jun 11, 4:59pm, Andrew Cagney wrote:
> > Some comments with regard to IA-64:
> >
> > 1) I'd rather have the declarations for
> > ia64_linux_sigcontext_register_address() and
> > ia64_aix_sigcontext_register_address() go into a single ia64-tdep.h
> > file. I think having two files is overkill.
>
> I'ts 6 of one half dozen of the other. At least it's clear which .c
> file the .h declaration belongs to. If someone later eliminates it, all
> the better.
I think it's quite likely that an ia64-tdep.h file will prove useful
in the long term, so I don't mind seeing it created. OTOH, I don't
see any point in creating two files which'll likely contain nothing
more than the declarations you're proposing putting in them. These
files and the resulting Makefile.in baggage (dependencies) will just
wind up being deleted at some later time when someone gets around
to doing #2 below.
Also, I don't think it'll be difficult to find the header file
containing the declarations when necessary.
> > 2) However, even that shouldn't be necessary. Now that we have the
> > OSABI machinery, it should be possible to solve the problem without
> > having to export these functions at all.
>
> In the mean time I'd like to get -Wmissing-prototypes enabled.
Sure. I didn't mean for you to do #2. In fact, the problem gets
considerably easier if we delete the IA-64 AIX stuff first. (To
the best of my knowledge, it's completely dead.)
Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch rfc] -Wmissing-prototypes round #3
2003-06-11 19:25 ` Andrew Cagney
@ 2003-06-11 23:47 ` Kevin Buettner
0 siblings, 0 replies; 12+ messages in thread
From: Kevin Buettner @ 2003-06-11 23:47 UTC (permalink / raw)
To: Andrew Cagney, Mark Kettenis; +Cc: gdb-patches
On Jun 11, 3:24pm, Andrew Cagney wrote:
> > Andrew Cagney <ac131313@redhat.com> writes:
> >
> >
> >> - move function declarations to CPU-tdep.h, from config/CPU/tm-CPU.h
> >> Ex, m68k's delta68 functions previously in tm-delta.h.
> >> This ensures that the function declaration is always visible, and that a
> >> global function in CPU-tdep.c has its declaration in the corresponding
> >> CPU-tdep.h file. The config/CPU/tm-CPU.h files were also updated to
> >> include the corresponding "CPU-tdep.h".
> >
> >
> > I'm not sure whether this part of your patch is a good idea. Quite a
> > number of function declarations in config/CPU/tm-CPU.h are for things
> > that haven't been multi-arched yet. Keeping the function declaration
> > next to the #define that uses them, makes it easier to remove them
> > once they're no longer needed.
>
> I thought someone might comment, that's why I tried to make what was
> happening very clear :-)
>
> It's a real trade off.
>
> -- delay -Wmissing-prototypes until multi-arch is finished
>
> -- move the declarations so that they are always visible
>
> -- drop -Werror for certain architectures
>
> Given the problems that -Wmissing-prototypes has thrown up (extern in
> .c, forgetting to include .h), I'd prefer to see it enabled.
>
> Also note the number of *-tdep.c functions I make static. It's pretty
> clear that people deleting the #define/declaration consistently forget
> to update the corresponding function definition.
>
> I think a better way of handling these stray global declarations would
> be to use some sort of real code analysis tool (which the ari isn't :-).
I happen to agree with Mark on this, but I'm also sympathetic to Andrew's
desire to get -Wmissing-prototypes going.
As a compromise, I suggest moving the function declarations as Andrew
proposes, but also putting a pointer (comment) to the (new) location
of the declaration along with a reminder to remove it and make it
static when the function is question is finally multiarched.
Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch rfc] -Wmissing-prototypes round #3
2003-06-11 17:43 [patch rfc] -Wmissing-prototypes round #3 Andrew Cagney
2003-06-11 18:56 ` Mark Kettenis
2003-06-11 20:31 ` Kevin Buettner
@ 2003-06-12 14:30 ` Richard Earnshaw
2003-06-12 17:09 ` Andrew Cagney
2003-06-12 18:08 ` Andrew Cagney
3 siblings, 1 reply; 12+ messages in thread
From: Richard Earnshaw @ 2003-06-12 14:30 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches, Richard.Earnshaw
ac131313@redhat.com said:
> * config/arm/tm-linux.h (arm_linux_svr4_fetch_link_map_offsets):
> Delete declaration, moved to "arm-tdep.h". Include "arm-tdep.h".
> * arm-tdep.h: Add ARM_TDEP_H wrapper.
> (arm_linux_svr4_fetch_link_map_offsets): Declare.
arm_linux_svr4_fetch_link_map_offsets should be moved from arm-tdep.c to
armlinux-tdep.c. Then it can be made private to that file; it doesn't
belong in the generic ARM code.
R.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch rfc] -Wmissing-prototypes round #3
2003-06-12 14:30 ` Richard Earnshaw
@ 2003-06-12 17:09 ` Andrew Cagney
2003-06-13 14:13 ` Richard Earnshaw
0 siblings, 1 reply; 12+ messages in thread
From: Andrew Cagney @ 2003-06-12 17:09 UTC (permalink / raw)
To: Richard.Earnshaw; +Cc: gdb-patches
> ac131313@redhat.com said:
>
>> * config/arm/tm-linux.h (arm_linux_svr4_fetch_link_map_offsets):
>> Delete declaration, moved to "arm-tdep.h". Include "arm-tdep.h".
>> * arm-tdep.h: Add ARM_TDEP_H wrapper.
>> (arm_linux_svr4_fetch_link_map_offsets): Declare.
>
>
> arm_linux_svr4_fetch_link_map_offsets should be moved from arm-tdep.c to
> armlinux-tdep.c. Then it can be made private to that file; it doesn't
> belong in the generic ARM code.
Please be my guest, it will simplify my -Wmissing-prototypes patch.
Andrew
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch rfc] -Wmissing-prototypes round #3
2003-06-11 17:43 [patch rfc] -Wmissing-prototypes round #3 Andrew Cagney
` (2 preceding siblings ...)
2003-06-12 14:30 ` Richard Earnshaw
@ 2003-06-12 18:08 ` Andrew Cagney
3 siblings, 0 replies; 12+ messages in thread
From: Andrew Cagney @ 2003-06-12 18:08 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 872 bytes --]
I've checked in the attached having removed anything someone didn't like :-)
> I thought someone might comment, that's why I tried to make what was happening very clear :-)
>
> It's a real trade off.
>
> -- delay -Wmissing-prototypes until multi-arch is finished
>
> -- move the declarations so that they are always visible
>
> -- drop -Werror for certain architectures
>
> Given the problems that -Wmissing-prototypes has thrown up (extern in .c, forgetting to include .h), I'd prefer to see it enabled.
>
> Also note the number of *-tdep.c functions I make static. It's pretty clear that people deleting the #define/declaration consistently forget to update the corresponding function definition.
>
> I think a better way of handling these stray global declarations would be to use some sort of real code analysis tool (which the ari isn't :-).
So ...
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 5805 bytes --]
2003-06-12 Andrew Cagney <cagney@redhat.com>
* wince.c: Include "mips-tdep.h".
* mips-tdep.h (mips_next_pc): Declare.
* mcore-tdep.c: Make more local functions static.
* Makefile.in (wince.o): Update dependencies.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.401
diff -u -r1.401 Makefile.in
--- Makefile.in 12 Jun 2003 15:44:22 -0000 1.401
+++ Makefile.in 12 Jun 2003 17:57:31 -0000
@@ -2371,9 +2371,8 @@
$(gdb_string_h) $(gdbthread_h) $(gdbcmd_h)
wince-stub.o: wince-stub.c $(wince_stub_h)
wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) \
- $(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \
- $(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(wince_stub_h) \
- $(regcache_h)
+ $(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) $(gdb_string_h) \
+ $(gdbthread_h) $(gdbcmd_h) $(wince_stub_h) $(regcache_h) $(mips_tdep_h)
wrapper.o: wrapper.c $(defs_h) $(value_h) $(wrapper_h)
x86-64-linux-nat.o: x86-64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
$(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(gregset_h) \
Index: mcore-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mcore-tdep.c,v
retrieving revision 1.67
diff -u -r1.67 mcore-tdep.c
--- mcore-tdep.c 11 Jun 2003 13:16:27 -0000 1.67
+++ mcore-tdep.c 12 Jun 2003 17:57:33 -0000
@@ -202,7 +202,7 @@
instructions are 16 bits, this is all we need, regardless of
address. bpkt = 0x0000 */
-const unsigned char *
+static const unsigned char *
mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size)
{
static char breakpoint[] =
@@ -606,7 +606,7 @@
then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC
will be called for the new frame. */
-CORE_ADDR
+static CORE_ADDR
mcore_frame_chain (struct frame_info * fi)
{
struct frame_info *dummy;
@@ -664,7 +664,7 @@
/* Skip the prologue of the function at PC. */
-CORE_ADDR
+static CORE_ADDR
mcore_skip_prologue (CORE_ADDR pc)
{
CORE_ADDR func_addr, func_end;
@@ -684,13 +684,13 @@
}
/* Return the address at which function arguments are offset. */
-CORE_ADDR
+static CORE_ADDR
mcore_frame_args_address (struct frame_info * fi)
{
return get_frame_base (fi) - get_frame_extra_info (fi)->framesize;
}
-CORE_ADDR
+static CORE_ADDR
mcore_frame_locals_address (struct frame_info * fi)
{
return get_frame_base (fi) - get_frame_extra_info (fi)->framesize;
@@ -716,7 +716,7 @@
/* Find the value of register REGNUM in frame FI. */
-CORE_ADDR
+static CORE_ADDR
mcore_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi != NULL; fi = get_next_frame (fi))
@@ -735,7 +735,7 @@
/* Find the saved pc in frame FI. */
-CORE_ADDR
+static CORE_ADDR
mcore_frame_saved_pc (struct frame_info * fi)
{
@@ -802,7 +802,7 @@
FIRST_ARGREG, since the MCORE treats struct returns (of less than eight
bytes) as hidden first arguments. */
-CORE_ADDR
+static CORE_ADDR
mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
@@ -912,7 +912,7 @@
opted to use generic call dummies, so we simply store the
CALL_DUMMY_ADDRESS into the PR register (r15). */
-CORE_ADDR
+static CORE_ADDR
mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
write_register (PR_REGNUM, CALL_DUMMY_ADDRESS ());
@@ -938,7 +938,7 @@
EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
and TYPE is the type (which is known to be struct, union or array). */
-int
+static int
mcore_use_struct_convention (int gcc_p, struct type *type)
{
return (TYPE_LENGTH (type) > 8);
@@ -948,7 +948,7 @@
this buffer was passed as a hidden first argument, so
just return that address. */
-CORE_ADDR
+static CORE_ADDR
mcore_extract_struct_value_address (char *regbuf)
{
return extract_unsigned_integer (regbuf + REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE);
@@ -958,7 +958,7 @@
the function's return value and place the result into VALBUF.
REGBUF is the register contents of the target. */
-void
+static void
mcore_extract_return_value (struct type *type, char *regbuf, char *valbuf)
{
/* Copy the return value (starting) in RETVAL_REGNUM to VALBUF. */
@@ -978,7 +978,7 @@
significant word) and r3 (least significant word, left justified).
Note that this includes structures of less than eight bytes, too. */
-void
+static void
mcore_store_return_value (struct type *type, char *valbuf)
{
int value_size;
@@ -1004,7 +1004,7 @@
This includes allocating space for saved registers and analyzing
the prologue of this frame. */
-void
+static void
mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
if (fi && get_next_frame (fi))
Index: mips-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.h,v
retrieving revision 1.2
diff -u -r1.2 mips-tdep.h
--- mips-tdep.h 12 Apr 2003 17:41:25 -0000 1.2
+++ mips-tdep.h 12 Jun 2003 17:57:33 -0000
@@ -40,4 +40,7 @@
/* Return the MIPS ABI associated with GDBARCH. */
enum mips_abi mips_abi (struct gdbarch *gdbarch);
+/* For wince :-(. */
+extern CORE_ADDR mips_next_pc (CORE_ADDR pc);
+
#endif /* MIPS_TDEP_H */
Index: wince.c
===================================================================
RCS file: /cvs/src/src/gdb/wince.c,v
retrieving revision 1.22
diff -u -r1.22 wince.c
--- wince.c 12 Nov 2002 21:43:55 -0000 1.22
+++ wince.c 12 Jun 2003 17:57:34 -0000
@@ -56,6 +56,9 @@
#include "wince-stub.h"
#include <time.h>
#include "regcache.h"
+#ifdef MIPS
+#include "mips-tdep.h"
+#endif
/* The ui's event loop. */
extern int (*ui_loop_hook) (int signo);
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch rfc] -Wmissing-prototypes round #3
2003-06-12 17:09 ` Andrew Cagney
@ 2003-06-13 14:13 ` Richard Earnshaw
2003-06-13 19:40 ` Andrew Cagney
0 siblings, 1 reply; 12+ messages in thread
From: Richard Earnshaw @ 2003-06-13 14:13 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Richard.Earnshaw, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 988 bytes --]
> > ac131313@redhat.com said:
> >
> >> * config/arm/tm-linux.h (arm_linux_svr4_fetch_link_map_offsets):
> >> Delete declaration, moved to "arm-tdep.h". Include "arm-tdep.h".
> >> * arm-tdep.h: Add ARM_TDEP_H wrapper.
> >> (arm_linux_svr4_fetch_link_map_offsets): Declare.
> >
> >
> > arm_linux_svr4_fetch_link_map_offsets should be moved from arm-tdep.c to
> > armlinux-tdep.c. Then it can be made private to that file; it doesn't
> > belong in the generic ARM code.
>
> Please be my guest, it will simplify my -Wmissing-prototypes patch.
>
Done.
2003-06-13 Richard Earnshaw <rearnsha@arm.com>
* arm-tdep.c (solib-svr4.h): Dont' include it.
(arm_linux_svr4_fetch_link_map_offsets): Move to ...
* arm-linux-tdep.c: ... here. Make static.
(arm_linux_init_abi): Register it.
(solib-svr4.h): Include it.
* Makefile.in: Update dependencies.
* config/arm/tm-linux.h (SVR4_FETCH_LINK_MAP_OFFSETS): Delete.
(arm_linux_svr4_fetch_link_map_offsets): Delete declaration.
[-- Attachment #2: linux-svr4.patch --]
[-- Type: text/plain , Size: 6631 bytes --]
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.402
diff -p -r1.402 Makefile.in
*** Makefile.in 12 Jun 2003 18:01:28 -0000 1.402
--- Makefile.in 13 Jun 2003 13:16:24 -0000
*************** arm-linux-nat.o: arm-linux-nat.c $(defs_
*** 1552,1561 ****
arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \
$(gdbtypes_h) $(floatformat_h) $(gdbcore_h) $(frame_h) $(regcache_h) \
$(doublest_h) $(arm_tdep_h) $(symtab_h) $(symfile_h) $(objfiles_h) \
! $(osabi_h)
arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \
$(gdbcore_h) $(symfile_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) \
! $(doublest_h) $(value_h) $(arch_utils_h) $(solib_svr4_h) $(osabi_h) \
$(arm_tdep_h) $(sim_arm_h) $(elf_bfd_h) $(coff_internal_h) \
$(elf_arm_h) $(gdb_assert_h)
armnbsd-nat.o: armnbsd-nat.c $(defs_h) $(arm_tdep_h) $(inferior_h) \
--- 1552,1561 ----
arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \
$(gdbtypes_h) $(floatformat_h) $(gdbcore_h) $(frame_h) $(regcache_h) \
$(doublest_h) $(arm_tdep_h) $(symtab_h) $(symfile_h) $(objfiles_h) \
! $(solib_svr4_h) $(osabi_h)
arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \
$(gdbcore_h) $(symfile_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) \
! $(doublest_h) $(value_h) $(arch_utils_h) $(osabi_h) \
$(arm_tdep_h) $(sim_arm_h) $(elf_bfd_h) $(coff_internal_h) \
$(elf_arm_h) $(gdb_assert_h)
armnbsd-nat.o: armnbsd-nat.c $(defs_h) $(arm_tdep_h) $(inferior_h) \
Index: arm-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-linux-tdep.c,v
retrieving revision 1.34
diff -p -r1.34 arm-linux-tdep.c
*** arm-linux-tdep.c 2 Jun 2003 02:09:39 -0000 1.34
--- arm-linux-tdep.c 13 Jun 2003 13:16:24 -0000
***************
*** 27,32 ****
--- 27,33 ----
#include "frame.h"
#include "regcache.h"
#include "doublest.h"
+ #include "solib-svr4.h"
#include "osabi.h"
#include "arm-tdep.h"
*************** find_minsym_and_objfile (char *name, str
*** 376,381 ****
--- 377,425 ----
}
+ /* Fetch, and possibly build, an appropriate link_map_offsets structure
+ for ARM linux targets using the struct offsets defined in <link.h>.
+ Note, however, that link.h is not actually referred to in this file.
+ Instead, the relevant structs offsets were obtained from examining
+ link.h. (We can't refer to link.h from this file because the host
+ system won't necessarily have it, or if it does, the structs which
+ it defines will refer to the host system, not the target). */
+
+ static struct link_map_offsets *
+ arm_linux_svr4_fetch_link_map_offsets (void)
+ {
+ static struct link_map_offsets lmo;
+ static struct link_map_offsets *lmp = 0;
+
+ if (lmp == 0)
+ {
+ lmp = &lmo;
+
+ lmo.r_debug_size = 8; /* Actual size is 20, but this is all we
+ need. */
+
+ lmo.r_map_offset = 4;
+ lmo.r_map_size = 4;
+
+ lmo.link_map_size = 20; /* Actual size is 552, but this is all we
+ need. */
+
+ lmo.l_addr_offset = 0;
+ lmo.l_addr_size = 4;
+
+ lmo.l_name_offset = 4;
+ lmo.l_name_size = 4;
+
+ lmo.l_next_offset = 12;
+ lmo.l_next_size = 4;
+
+ lmo.l_prev_offset = 16;
+ lmo.l_prev_size = 4;
+ }
+
+ return lmp;
+ }
+
static CORE_ADDR
skip_hurd_resolver (CORE_ADDR pc)
{
*************** arm_linux_init_abi (struct gdbarch_info
*** 529,534 ****
--- 573,581 ----
tdep->jb_pc = ARM_LINUX_JB_PC;
tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE;
+
+ set_solib_svr4_fetch_link_map_offsets
+ (gdbarch, arm_linux_svr4_fetch_link_map_offsets);
set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (arm_linux_call_dummy_words));
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.141
diff -p -r1.141 arm-tdep.c
*** arm-tdep.c 13 Jun 2003 04:40:30 -0000 1.141
--- arm-tdep.c 13 Jun 2003 13:16:25 -0000
*************** arm_othernames (char *names, int n)
*** 2668,2716 ****
set_disassembly_style ();
}
- /* Fetch, and possibly build, an appropriate link_map_offsets structure
- for ARM linux targets using the struct offsets defined in <link.h>.
- Note, however, that link.h is not actually referred to in this file.
- Instead, the relevant structs offsets were obtained from examining
- link.h. (We can't refer to link.h from this file because the host
- system won't necessarily have it, or if it does, the structs which
- it defines will refer to the host system, not the target). */
-
- struct link_map_offsets *
- arm_linux_svr4_fetch_link_map_offsets (void)
- {
- static struct link_map_offsets lmo;
- static struct link_map_offsets *lmp = 0;
-
- if (lmp == 0)
- {
- lmp = &lmo;
-
- lmo.r_debug_size = 8; /* Actual size is 20, but this is all we
- need. */
-
- lmo.r_map_offset = 4;
- lmo.r_map_size = 4;
-
- lmo.link_map_size = 20; /* Actual size is 552, but this is all we
- need. */
-
- lmo.l_addr_offset = 0;
- lmo.l_addr_size = 4;
-
- lmo.l_name_offset = 4;
- lmo.l_name_size = 4;
-
- lmo.l_next_offset = 12;
- lmo.l_next_size = 4;
-
- lmo.l_prev_offset = 16;
- lmo.l_prev_size = 4;
- }
-
- return lmp;
- }
-
/* Test whether the coff symbol specific value corresponds to a Thumb
function. */
--- 2668,2673 ----
Index: config/arm/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-linux.h,v
retrieving revision 1.17
diff -p -r1.17 tm-linux.h
*** config/arm/tm-linux.h 5 Jun 2002 19:18:16 -0000 1.17
--- config/arm/tm-linux.h 13 Jun 2003 13:16:25 -0000
***************
*** 30,39 ****
#include "config/tm-linux.h"
- /* Use target-specific function to define link map offsets. */
- extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void);
- #define SVR4_FETCH_LINK_MAP_OFFSETS() arm_linux_svr4_fetch_link_map_offsets ()
-
/* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
#define SIGCONTEXT_PC_OFFSET (sizeof(unsigned long) * 18)
--- 30,35 ----
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [patch rfc] -Wmissing-prototypes round #3
2003-06-13 14:13 ` Richard Earnshaw
@ 2003-06-13 19:40 ` Andrew Cagney
0 siblings, 0 replies; 12+ messages in thread
From: Andrew Cagney @ 2003-06-13 19:40 UTC (permalink / raw)
To: Richard.Earnshaw; +Cc: gdb-patches
> ac131313@redhat.com said:
>> >
>
>> >> * config/arm/tm-linux.h (arm_linux_svr4_fetch_link_map_offsets):
>> >> Delete declaration, moved to "arm-tdep.h". Include "arm-tdep.h".
>> >> * arm-tdep.h: Add ARM_TDEP_H wrapper.
>> >> (arm_linux_svr4_fetch_link_map_offsets): Declare.
>
>> >
>> >
>> > arm_linux_svr4_fetch_link_map_offsets should be moved from arm-tdep.c to
>> > armlinux-tdep.c. Then it can be made private to that file; it doesn't
>> > belong in the generic ARM code.
>
>>
>> Please be my guest, it will simplify my -Wmissing-prototypes patch.
>>
>
>
> Done.
Thanks, just re-generating a -Wmissing-prototypes build to see what's left.
Andrew
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2003-06-13 19:40 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-11 17:43 [patch rfc] -Wmissing-prototypes round #3 Andrew Cagney
2003-06-11 18:56 ` Mark Kettenis
2003-06-11 19:25 ` Andrew Cagney
2003-06-11 23:47 ` Kevin Buettner
2003-06-11 20:31 ` Kevin Buettner
2003-06-11 20:59 ` Andrew Cagney
2003-06-11 23:30 ` Kevin Buettner
2003-06-12 14:30 ` Richard Earnshaw
2003-06-12 17:09 ` Andrew Cagney
2003-06-13 14:13 ` Richard Earnshaw
2003-06-13 19:40 ` Andrew Cagney
2003-06-12 18:08 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox