This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ob] Put "exec.c"'s exports in "exec.c"


Hello,

The attached incremental cleanup moves "exec.c"s too biggest exports to the new corresponding header "exec.h".

I should note that while one of those exports (exec_ops) has never been properly exported, it is found and referenced through out GDB. The current standard way of accessing something in the exec stratum is to pass &exec_ops to the method.

committed,
Andrew
2003-10-22  Andrew Cagney  <cagney@redhat.com>

	* exec.h: New file.
	* win32-nat.c: Include "exec.h".
	* solib.c: Include "exec.h".
	* target.h (build_section_table): Delete declaration.
	* somsolib.c: Include "exec.h".
	(exec_ops): Delete extern declaration.
	* rs6000-nat.c: Update copyright.  Include "exec.h".
	(exec_ops): Delete extern declaration.
	* pa64solib.c: Update copyright.  Include "exec.h".
	(exec_ops): Delete extern declaration.
	* exec.c: Update copyright.  Include "exec.h".
	* corelow.c: Update dependencies.  Include "exec.h".
	* Makefile.in (exec_h): Define.
	(exec.o, somsolib.o): Update dependencies.
	(pa64solib.o, corelow.o): Update dependencies.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.460
diff -u -r1.460 Makefile.in
--- Makefile.in	23 Oct 2003 00:13:53 -0000	1.460
+++ Makefile.in	23 Oct 2003 03:00:22 -0000
@@ -662,6 +662,7 @@
 environ_h = environ.h
 event_loop_h = event-loop.h
 event_top_h = event-top.h
+exec_h = exec.h $(target_h)
 expression_h = expression.h $(symtab_h) $(doublest_h)
 f_lang_h = f-lang.h
 frame_base_h = frame-base.h
@@ -1648,7 +1649,7 @@
 	$(dis_asm_h) $(gdb_stat_h) $(completer_h)
 corelow.o: corelow.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \
 	$(symtab_h) $(command_h) $(bfd_h) $(target_h) $(gdbcore_h) \
-	$(gdbthread_h) $(regcache_h) $(symfile_h)
+	$(gdbthread_h) $(regcache_h) $(symfile_h) $(exec_h)
 core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \
 	$(inferior_h) $(target_h) $(gdb_string_h) $(gregset_h)
 core-sol2.o: core-sol2.c $(defs_h) $(gdb_string_h) $(regcache_h) \
@@ -1745,7 +1746,8 @@
 	$(gdbcmd_h)
 exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \
 	$(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \
-	$(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h)
+	$(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h) \
+	$(exec_h)
 expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
 	$(value_h) $(language_h) $(parser_defs_h) $(user_regs_h) $(target_h) \
 	$(gdb_string_h) $(block_h)
@@ -2097,7 +2099,7 @@
 pa64solib.o: pa64solib.c $(defs_h) $(frame_h) $(bfd_h) $(libhppa_h) \
 	$(gdbcore_h) $(symtab_h) $(breakpoint_h) $(symfile_h) $(objfiles_h) \
 	$(inferior_h) $(gdb_stabs_h) $(gdb_stat_h) $(gdbcmd_h) $(language_h) \
-	$(regcache_h)
+	$(regcache_h) $(exec_h)
 parse.o: parse.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
 	$(frame_h) $(expression_h) $(value_h) $(command_h) $(language_h) \
 	$(parser_defs_h) $(gdbcmd_h) $(symfile_h) $(inferior_h) \
@@ -2277,7 +2279,7 @@
 solib.o: solib.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) $(symfile_h) \
 	$(objfiles_h) $(gdbcore_h) $(command_h) $(target_h) $(frame_h) \
 	$(gdb_regex_h) $(inferior_h) $(environ_h) $(language_h) $(gdbcmd_h) \
-	$(completer_h) $(filenames_h) $(solist_h)
+	$(completer_h) $(filenames_h) $(solist_h) $(exec_h)
 solib-irix.o: solib-irix.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \
 	$(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(solist_h)
 solib-legacy.o: solib-legacy.c $(defs_h) $(gdbcore_h) $(solib_svr4_h)
@@ -2298,7 +2300,7 @@
 somsolib.o: somsolib.c $(defs_h) $(frame_h) $(bfd_h) $(som_h) $(libhppa_h) \
 	$(gdbcore_h) $(symtab_h) $(breakpoint_h) $(symfile_h) $(objfiles_h) \
 	$(inferior_h) $(gdb_stabs_h) $(gdb_stat_h) $(gdbcmd_h) $(language_h) \
-	$(regcache_h) $(gdb_assert_h)
+	$(regcache_h) $(gdb_assert_h) $(exec_h)
 source.o: source.c $(defs_h) $(symtab_h) $(expression_h) $(language_h) \
 	$(command_h) $(source_h) $(gdbcmd_h) $(frame_h) $(value_h) \
 	$(gdb_string_h) $(gdb_stat_h) $(gdbcore_h) $(gdb_regex_h) \
@@ -2432,7 +2434,7 @@
 win32-nat.o: win32-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
 	$(gdbcore_h) $(command_h) $(completer_h) $(regcache_h) $(top_h) \
 	$(i386_tdep_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \
-	$(gdb_string_h) $(gdbthread_h) $(gdbcmd_h)
+	$(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(exec_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) \
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.30
diff -u -r1.30 corelow.c
--- corelow.c	21 Sep 2003 01:26:44 -0000	1.30
+++ corelow.c	23 Oct 2003 03:00:22 -0000
@@ -1,7 +1,7 @@
 /* Core dump and executable file functions below target vector, for GDB.
-   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+
+   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
+   1997, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -38,6 +38,7 @@
 #include "gdbthread.h"
 #include "regcache.h"
 #include "symfile.h"
+#include "exec.h"
 #include <readline/readline.h>
 
 #ifndef O_BINARY
Index: exec.c
===================================================================
RCS file: /cvs/src/src/gdb/exec.c,v
retrieving revision 1.31
diff -u -r1.31 exec.c
--- exec.c	21 Sep 2003 01:26:44 -0000	1.31
+++ exec.c	23 Oct 2003 03:00:23 -0000
@@ -1,7 +1,8 @@
 /* Work with executable files, for GDB. 
-   Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001, 2002
-   Free Software Foundation, Inc.
+
+   Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+   1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
+   Inc.
 
    This file is part of GDB.
 
@@ -30,6 +31,7 @@
 #include "objfiles.h"
 #include "completer.h"
 #include "value.h"
+#include "exec.h"
 
 #ifdef USG
 #include <sys/types.h>
Index: exec.h
===================================================================
RCS file: exec.h
diff -N exec.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ exec.h	23 Oct 2003 03:00:23 -0000
@@ -0,0 +1,39 @@
+/* Work with executable files, 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 EXEC_H
+#define EXEC_H
+
+#include "target.h"
+
+struct section_table;
+struct target_ops;
+struct bfd;
+
+struct target_ops exec_ops;
+
+/* Builds a section table, given args BFD, SECTABLE_PTR, SECEND_PTR.
+   Returns 0 if OK, 1 on error.  */
+
+extern int build_section_table (struct bfd *, struct section_table **,
+				struct section_table **);
+
+#endif
Index: pa64solib.c
===================================================================
RCS file: /cvs/src/src/gdb/pa64solib.c,v
retrieving revision 1.17
diff -u -r1.17 pa64solib.c
--- pa64solib.c	6 Jun 2003 23:32:59 -0000	1.17
+++ pa64solib.c	23 Oct 2003 03:00:23 -0000
@@ -1,6 +1,7 @@
 /* Handle HP ELF shared libraries for GDB, the GNU Debugger.
 
-   Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
+   Inc.
 
    This file is part of GDB.
 
@@ -50,15 +51,13 @@
 #include "gdbcmd.h"
 #include "language.h"
 #include "regcache.h"
+#include "exec.h"
 
 #include <fcntl.h>
 
 #ifndef O_BINARY
 #define O_BINARY 0
 #endif
-
-/* Defined in exec.c; used to prevent dangling pointer bug.  */
-extern struct target_ops exec_ops;
 
 static CORE_ADDR bfd_lookup_symbol (bfd *, char *);
 /* This lives in hppa-tdep.c. */
Index: rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.34
diff -u -r1.34 rs6000-nat.c
--- rs6000-nat.c	2 Oct 2003 20:28:30 -0000	1.34
+++ rs6000-nat.c	23 Oct 2003 03:00:23 -0000
@@ -1,7 +1,8 @@
 /* IBM RS/6000 native-dependent code for GDB, the GNU debugger.
-   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001, 2002
-   Free Software Foundation, Inc.
+
+   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
+   1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
+   Inc.
 
    This file is part of GDB.
 
@@ -34,6 +35,7 @@
 #include "arch-utils.h"
 #include "language.h"		/* for local_hex_string().  */
 #include "ppc-tdep.h"
+#include "exec.h"
 
 #include <sys/ptrace.h>
 #include <sys/reg.h>
@@ -126,8 +128,6 @@
 #define LDI_FILENAME(ldi, arch64)	LDI_FIELD(ldi, arch64, filename)
 
 extern struct vmap *map_vmap (bfd * bf, bfd * arch);
-
-extern struct target_ops exec_ops;
 
 static void vmap_exec (void);
 
Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.59
diff -u -r1.59 solib.c
--- solib.c	14 Sep 2003 16:32:14 -0000	1.59
+++ solib.c	23 Oct 2003 03:00:23 -0000
@@ -40,7 +40,7 @@
 #include "gdbcmd.h"
 #include "completer.h"
 #include "filenames.h"		/* for DOSish file names */
-
+#include "exec.h"
 #include "solist.h"
 #include <readline/readline.h>
 
Index: somsolib.c
===================================================================
RCS file: /cvs/src/src/gdb/somsolib.c,v
retrieving revision 1.27
diff -u -r1.27 somsolib.c
--- somsolib.c	16 Oct 2003 16:35:27 -0000	1.27
+++ somsolib.c	23 Oct 2003 03:00:23 -0000
@@ -42,6 +42,7 @@
 #include "language.h"
 #include "regcache.h"
 #include "gdb_assert.h"
+#include "exec.h"
 
 #include <fcntl.h>
 
@@ -54,10 +55,6 @@
 
 /* #define SOLIB_DEBUG
  */
-
-/* Defined in exec.c; used to prevent dangling pointer bug.
- */
-extern struct target_ops exec_ops;
 
 /* This lives in hppa-tdep.c. */
 extern struct unwind_table_entry *find_unwind_entry (CORE_ADDR pc);
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.47
diff -u -r1.47 target.h
--- target.h	23 Oct 2003 00:13:53 -0000	1.47
+++ target.h	23 Oct 2003 03:00:24 -0000
@@ -1152,12 +1152,6 @@
 					      CORE_ADDR addr);
 
 
-/* Builds a section table, given args BFD, SECTABLE_PTR, SECEND_PTR.
-   Returns 0 if OK, 1 on error.  */
-
-extern int build_section_table (bfd *, struct section_table **,
-				struct section_table **);
-
 /* From mem-break.c */
 
 extern int memory_remove_breakpoint (CORE_ADDR, char *);
Index: win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.81
diff -u -r1.81 win32-nat.c
--- win32-nat.c	21 Sep 2003 01:26:46 -0000	1.81
+++ win32-nat.c	23 Oct 2003 03:00:24 -0000
@@ -52,6 +52,7 @@
 #include "gdbcmd.h"
 #include <sys/param.h>
 #include <unistd.h>
+#include "exec.h"
 
 /* The ui's event loop. */
 extern int (*ui_loop_hook) (int signo);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]