[PATCH]: Remove unnecessary include files

J.T. Conklin jtc@redback.com
Tue Mar 6 19:05:00 GMT 2001


I have committed the enclosed patch.  It removes unnecessary include
files from many source files.

Unintended changes to Makefile.in, defs.h, and utils.c slipped in with
this commit.  Rather than revert them, I'll be writing and checking in
additional ChangeLog entries within the hour.

        --jtc

2001-03-06  J.T. Conklin  <jtc@redback.com>

	* symtab.h (decode_line_1): Removed declaration.

	* symfile.c (#include <assert.h>): Removed.

	* arch-utils.c (#include <ctype.h>): Removed.
	* c-typeprint.c: Likewise.
	* dbxread.c: Likewise.
	* gdbtypes.c: Likewise.
	* target.c: Likewise.
	* os9kread.c: Likewise.

	* c-valprint.c (#include "demangle.h"): Removed.
	* ch-typeprint.c: Likewise.
	* eval.c: Likewise.
	* f-typeprint.c: Likewise.
	* f-valprint.c: Likewise.
	* m2-typeprint.c: Likewise.
	* typeprint.c: Likewise.
	* p-typeprint.c: Likewise.
	* valarith.c: Likewise.
	* valprint.c: Likewise.

	* m2-typeprint.c (#include "gdb_string.h"): Removed.
	* nlmread.c: Likewise.

	* mdebugread.c (#include "gdb-stabs.h"): Removed.
	* minsyms.c: Likewise.
	* mipsread.c: Likewise.
	* nlmread.c: Likewise.

	* m2-typeprint.c (#include "obstack.h"): Removed.
	* m2-valprint.c: Likewise.

	* event-loop.c (#include <setjmp.h>): Removed.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.68
retrieving revision 1.70
diff -c -r1.68 -r1.70
*** Makefile.in	2001/03/06 08:21:05	1.68
--- Makefile.in	2001/03/07 03:00:33	1.70
***************
*** 361,367 ****
  DIST=gdb
  
  LINT=/usr/5bin/lint
! LINTFLAGS= $(BFD_CFLAGS)
  
  RUNTEST = `if [ -f $${rootsrc}/../dejagnu/runtest ] ; then \
  		echo $${rootsrc}/../dejagnu/runtest ; else echo runtest; \
--- 361,369 ----
  DIST=gdb
  
  LINT=/usr/5bin/lint
! LINTFLAGS= $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
! 	$(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \
! 	$(INTL_CFLAGS)
  
  RUNTEST = `if [ -f $${rootsrc}/../dejagnu/runtest ] ; then \
  		echo $${rootsrc}/../dejagnu/runtest ; else echo runtest; \
Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -c -r1.21 -r1.22
*** arch-utils.c	2001/03/06 08:21:05	1.21
--- arch-utils.c	2001/03/07 02:57:08	1.22
***************
*** 27,33 ****
  /* Just include everything in sight so that the every old definition
     of macro is visible. */
  #include "gdb_string.h"
- #include <ctype.h>
  #include "symtab.h"
  #include "frame.h"
  #include "inferior.h"
--- 27,32 ----
Index: c-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-typeprint.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -c -r1.5 -r1.6
*** c-typeprint.c	2001/03/06 08:21:06	1.5
--- c-typeprint.c	2001/03/07 02:57:08	1.6
***************
*** 38,44 ****
  
  #include "gdb_string.h"
  #include <errno.h>
- #include <ctype.h>
  
  /* Flag indicating target was compiled by HP compiler */
  extern int hp_som_som_object_present;
--- 38,43 ----
Index: c-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-valprint.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -c -r1.7 -r1.8
*** c-valprint.c	2001/03/06 08:21:06	1.7
--- c-valprint.c	2001/03/07 02:57:08	1.8
***************
*** 25,31 ****
  #include "gdbtypes.h"
  #include "expression.h"
  #include "value.h"
- #include "demangle.h"
  #include "valprint.h"
  #include "language.h"
  #include "c-lang.h"
--- 25,30 ----
Index: ch-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/ch-typeprint.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -c -r1.3 -r1.4
*** ch-typeprint.c	2001/03/06 08:21:06	1.3
--- ch-typeprint.c	2001/03/07 02:57:08	1.4
***************
*** 31,37 ****
  #include "command.h"
  #include "gdbcmd.h"
  #include "language.h"
- #include "demangle.h"
  #include "ch-lang.h"
  #include "typeprint.h"
  
--- 31,36 ----
Index: dbxread.c
===================================================================
RCS file: /cvs/src/src/gdb/dbxread.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -c -r1.14 -r1.15
*** dbxread.c	2001/03/06 08:21:06	1.14
--- dbxread.c	2001/03/07 02:57:08	1.15
***************
*** 44,50 ****
  
  #include "obstack.h"
  #include "gdb_stat.h"
- #include <ctype.h>
  #include "symtab.h"
  #include "breakpoint.h"
  #include "command.h"
--- 44,49 ----
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -c -r1.40 -r1.41
*** defs.h	2001/03/06 08:21:06	1.40
--- defs.h	2001/03/07 02:57:08	1.41
***************
*** 821,829 ****
  /* Assorted functions we can declare, now that const and volatile are 
     defined.  */
  
! extern char *savestring (const char *, int);
  
! extern char *msavestring (void *, const char *, int);
  
  extern char *mstrsave (void *, const char *);
  
--- 821,829 ----
  /* Assorted functions we can declare, now that const and volatile are 
     defined.  */
  
! extern char *savestring (const char *, size_t);
  
! extern char *msavestring (void *, const char *, size_t);
  
  extern char *mstrsave (void *, const char *);
  
Index: eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -c -r1.10 -r1.11
*** eval.c	2001/03/06 08:21:07	1.10
--- eval.c	2001/03/07 02:57:08	1.11
***************
*** 28,34 ****
  #include "expression.h"
  #include "target.h"
  #include "frame.h"
- #include "demangle.h"
  #include "language.h"		/* For CAST_IS_CONVERSION */
  #include "f-lang.h"		/* for array bound stuff */
  
--- 28,33 ----
Index: event-loop.c
===================================================================
RCS file: /cvs/src/src/gdb/event-loop.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -c -r1.12 -r1.13
*** event-loop.c	2001/03/06 08:21:07	1.12
--- event-loop.c	2001/03/07 02:57:08	1.13
***************
*** 35,41 ****
  #include <sys/types.h>
  #include "gdb_string.h"
  #include <errno.h>
- #include <setjmp.h>
  #include <sys/time.h>
  
  /* Type of the mask arguments to select. */
--- 35,40 ----
Index: f-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/f-typeprint.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -c -r1.3 -r1.4
*** f-typeprint.c	2001/03/06 08:21:07	1.3
--- f-typeprint.c	2001/03/07 02:57:08	1.4
***************
*** 33,39 ****
  #include "command.h"
  #include "gdbcmd.h"
  #include "language.h"
- #include "demangle.h"
  #include "f-lang.h"
  #include "typeprint.h"
  #include "frame.h"		/* ??? */
--- 33,38 ----
Index: f-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/f-valprint.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -c -r1.5 -r1.6
*** f-valprint.c	2001/03/06 08:21:07	1.5
--- f-valprint.c	2001/03/07 02:57:08	1.6
***************
*** 27,33 ****
  #include "gdbtypes.h"
  #include "expression.h"
  #include "value.h"
- #include "demangle.h"
  #include "valprint.h"
  #include "language.h"
  #include "f-lang.h"
--- 27,32 ----
Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -c -r1.17 -r1.18
*** gdbtypes.c	2001/03/06 08:21:07	1.17
--- gdbtypes.c	2001/03/07 02:57:08	1.18
***************
*** 1165,1171 ****
  }
  
  /* New code added to support parsing of Cfront stabs strings */
- #include <ctype.h>
  #define INIT_EXTRA { pextras->len=0; pextras->str[0]='\0'; }
  #define ADD_EXTRA(c) { pextras->str[pextras->len++]=c; }
  
--- 1165,1170 ----
Index: m2-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/m2-typeprint.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -c -r1.3 -r1.4
*** m2-typeprint.c	2001/03/06 08:21:09	1.3
--- m2-typeprint.c	2001/03/07 02:57:08	1.4
***************
*** 20,26 ****
     Boston, MA 02111-1307, USA.  */
  
  #include "defs.h"
- #include "obstack.h"
  #include "bfd.h"		/* Binary File Description */
  #include "symtab.h"
  #include "gdbtypes.h"
--- 20,25 ----
***************
*** 31,40 ****
  #include "command.h"
  #include "gdbcmd.h"
  #include "language.h"
- #include "demangle.h"
  #include "m2-lang.h"
- 
- #include "gdb_string.h"
  #include <errno.h>
  
  void
--- 30,36 ----
Index: m2-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/m2-valprint.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -c -r1.3 -r1.4
*** m2-valprint.c	2001/03/06 08:21:09	1.3
--- m2-valprint.c	2001/03/07 02:57:08	1.4
***************
*** 20,26 ****
     Boston, MA 02111-1307, USA.  */
  
  #include "defs.h"
- #include "obstack.h"
  #include "symtab.h"
  #include "gdbtypes.h"
  #include "valprint.h"
--- 20,25 ----
Index: mdebugread.c
===================================================================
RCS file: /cvs/src/src/gdb/mdebugread.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -c -r1.11 -r1.12
*** mdebugread.c	2001/03/06 08:21:10	1.11
--- mdebugread.c	2001/03/07 02:57:08	1.12
***************
*** 79,86 ****
  #include "gdb_stat.h"
  #include "gdb_string.h"
  
- #include "gdb-stabs.h"
- 
  #include "bfd.h"
  
  #include "coff/ecoff.h"		/* COFF-like aspects of ecoff files */
--- 79,84 ----
Index: minsyms.c
===================================================================
RCS file: /cvs/src/src/gdb/minsyms.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -c -r1.14 -r1.15
*** minsyms.c	2001/03/06 08:21:10	1.14
--- minsyms.c	2001/03/07 02:57:08	1.15
***************
*** 47,53 ****
  #include "symfile.h"
  #include "objfiles.h"
  #include "demangle.h"
- #include "gdb-stabs.h"
  
  /* Accumulate the minimal symbols for each objfile in bunches of BUNCH_SIZE.
     At the end, copy them all into one newly allocated location on an objfile's
--- 47,52 ----
Index: mipsread.c
===================================================================
RCS file: /cvs/src/src/gdb/mipsread.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -c -r1.7 -r1.8
*** mipsread.c	2001/03/06 08:21:10	1.7
--- mipsread.c	2001/03/07 02:57:08	1.8
***************
*** 33,39 ****
  #include "objfiles.h"
  #include "buildsym.h"
  #include "stabsread.h"
- #include "gdb-stabs.h"
  
  #include "coff/sym.h"
  #include "coff/internal.h"
--- 33,38 ----
Index: nlmread.c
===================================================================
RCS file: /cvs/src/src/gdb/nlmread.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -c -r1.6 -r1.7
*** nlmread.c	2001/03/06 08:21:11	1.6
--- nlmread.c	2001/03/07 02:57:08	1.7
***************
*** 21,32 ****
     Boston, MA 02111-1307, USA.  */
  
  #include "defs.h"
- #include "gdb_string.h"
  #include "bfd.h"
  #include "symtab.h"
  #include "symfile.h"
  #include "objfiles.h"
- #include "gdb-stabs.h"
  #include "buildsym.h"
  #include "stabsread.h"
  
--- 21,30 ----
Index: os9kread.c
===================================================================
RCS file: /cvs/src/src/gdb/os9kread.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -c -r1.8 -r1.9
*** os9kread.c	2001/03/06 08:21:11	1.8
--- os9kread.c	2001/03/07 02:57:08	1.9
***************
*** 46,52 ****
  
  #include "obstack.h"
  #include "gdb_stat.h"
- #include <ctype.h>
  #include "symtab.h"
  #include "breakpoint.h"
  #include "command.h"
--- 46,51 ----
Index: p-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/p-typeprint.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -c -r1.3 -r1.4
*** p-typeprint.c	2000/07/30 01:48:26	1.3
--- p-typeprint.c	2001/03/07 02:57:08	1.4
***************
*** 32,38 ****
  #include "command.h"
  #include "gdbcmd.h"
  #include "language.h"
- #include "demangle.h"
  #include "p-lang.h"
  #include "typeprint.h"
  
--- 32,37 ----
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -c -r1.27 -r1.28
*** symfile.c	2001/03/06 08:21:17	1.27
--- symfile.c	2001/03/07 02:57:08	1.28
***************
*** 39,45 ****
  #include "obstack.h"
  #include "completer.h"
  
- #include <assert.h>
  #include <sys/types.h>
  #include <fcntl.h>
  #include "gdb_string.h"
--- 39,44 ----
Index: symtab.h
===================================================================
RCS file: /cvs/src/src/gdb/symtab.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -c -r1.19 -r1.20
*** symtab.h	2001/03/06 08:21:17	1.19
--- symtab.h	2001/03/07 02:57:08	1.20
***************
*** 1347,1357 ****
  
  extern struct symtabs_and_lines decode_line_spec_1 (char *, int);
  
- /* From linespec.c */
- 
- extern struct symtabs_and_lines decode_line_1 (char **,
-                                           int, struct symtab *, int, char ***);
- 
  /* Symmisc.c */
  
  void maintenance_print_symbols (char *, int);
--- 1347,1352 ----
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -c -r1.22 -r1.23
*** target.c	2001/03/06 08:21:17	1.22
--- target.c	2001/03/07 02:57:08	1.23
***************
*** 22,28 ****
  
  #include "defs.h"
  #include <errno.h>
- #include <ctype.h>
  #include "gdb_string.h"
  #include "target.h"
  #include "gdbcmd.h"
--- 22,27 ----
Index: typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/typeprint.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -c -r1.7 -r1.8
*** typeprint.c	2001/03/06 08:21:17	1.7
--- typeprint.c	2001/03/07 02:57:08	1.8
***************
*** 31,37 ****
  #include "gdbcmd.h"
  #include "target.h"
  #include "language.h"
- #include "demangle.h"
  
  #include "gdb_string.h"
  #include <errno.h>
--- 31,36 ----
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -c -r1.32 -r1.33
*** utils.c	2001/03/06 08:21:18	1.32
--- utils.c	2001/03/07 02:57:08	1.33
***************
*** 1155,1161 ****
     Uses malloc to get the space.  Returns the address of the copy.  */
  
  char *
! savestring (const char *ptr, int size)
  {
    register char *p = (char *) xmalloc (size + 1);
    memcpy (p, ptr, size);
--- 1155,1161 ----
     Uses malloc to get the space.  Returns the address of the copy.  */
  
  char *
! savestring (const char *ptr, size_t size)
  {
    register char *p = (char *) xmalloc (size + 1);
    memcpy (p, ptr, size);
***************
*** 1164,1170 ****
  }
  
  char *
! msavestring (void *md, const char *ptr, int size)
  {
    register char *p = (char *) xmmalloc (md, size + 1);
    memcpy (p, ptr, size);
--- 1164,1170 ----
  }
  
  char *
! msavestring (void *md, const char *ptr, size_t size)
  {
    register char *p = (char *) xmmalloc (md, size + 1);
    memcpy (p, ptr, size);
Index: valarith.c
===================================================================
RCS file: /cvs/src/src/gdb/valarith.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -c -r1.6 -r1.7
*** valarith.c	2001/03/06 08:21:18	1.6
--- valarith.c	2001/03/07 02:57:08	1.7
***************
*** 27,33 ****
  #include "expression.h"
  #include "target.h"
  #include "language.h"
- #include "demangle.h"
  #include "gdb_string.h"
  #include <math.h>
  
--- 27,32 ----
Index: valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/valprint.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -c -r1.11 -r1.12
*** valprint.c	2001/03/06 08:21:18	1.11
--- valprint.c	2001/03/07 02:57:08	1.12
***************
*** 30,36 ****
  #include "target.h"
  #include "obstack.h"
  #include "language.h"
- #include "demangle.h"
  #include "annotate.h"
  #include "valprint.h"
  
--- 30,35 ----


-- 
J.T. Conklin
RedBack Networks



More information about the Gdb-patches mailing list