From 4646aa9d0b2c830d18d5b0ead2024cd222e7f9ee Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 23 Oct 2003 03:01:55 +0000 Subject: [PATCH] 2003-10-22 Andrew Cagney * 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. --- gdb/ChangeLog | 18 ++++++++++++++++++ gdb/Makefile.in | 14 ++++++++------ gdb/corelow.c | 7 ++++--- gdb/exec.c | 8 +++++--- gdb/exec.h | 39 +++++++++++++++++++++++++++++++++++++++ gdb/pa64solib.c | 7 +++---- gdb/rs6000-nat.c | 10 +++++----- gdb/solib.c | 2 +- gdb/somsolib.c | 5 +---- gdb/target.h | 6 ------ gdb/win32-nat.c | 1 + gdb/windows-nat.c | 1 + 12 files changed, 86 insertions(+), 32 deletions(-) create mode 100644 gdb/exec.h diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c490be327f2..b53787cbb03 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,21 @@ +2003-10-22 Andrew Cagney + + * 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. + 2003-10-22 Andrew Cagney * target.c: Include "gdb_assert.h" (target_read): Call diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 4628a7ffd83..73dbe758ff5 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -662,6 +662,7 @@ dwarf2loc_h = dwarf2loc.h 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 @@ corefile.o: corefile.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symtab_h) \ $(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 @@ event-top.o: event-top.c $(defs_h) $(top_h) $(inferior_h) $(target_h) \ $(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 @@ osabi.o: osabi.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(osabi_h) \ 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-aix5.o: solib-aix5.c $(defs_h) $(gdb_string_h) $(elf_external_h) \ 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 @@ somread.o: somread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ 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 @@ w89k-rom.o: w89k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ 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) \ diff --git a/gdb/corelow.c b/gdb/corelow.c index 178dc8b67f6..d6a3cfdedee 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -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 #ifndef O_BINARY diff --git a/gdb/exec.c b/gdb/exec.c index 0eba0ee2e7a..8ca669ea674 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -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 diff --git a/gdb/exec.h b/gdb/exec.h new file mode 100644 index 00000000000..e9c2d17bf7a --- /dev/null +++ b/gdb/exec.h @@ -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 diff --git a/gdb/pa64solib.c b/gdb/pa64solib.c index b67532d3759..64f1ebbb1d8 100644 --- a/gdb/pa64solib.c +++ b/gdb/pa64solib.c @@ -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,6 +51,7 @@ #include "gdbcmd.h" #include "language.h" #include "regcache.h" +#include "exec.h" #include @@ -57,9 +59,6 @@ #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. */ extern struct unwind_table_entry *find_unwind_entry (CORE_ADDR pc); diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index ad8cc0dc5f3..e8bf4a0a411 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -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 #include @@ -127,8 +129,6 @@ typedef union { extern struct vmap *map_vmap (bfd * bf, bfd * arch); -extern struct target_ops exec_ops; - static void vmap_exec (void); static void vmap_ldinfo (LdInfo *); diff --git a/gdb/solib.c b/gdb/solib.c index f77993c574e..fcd2ad40ee2 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -40,7 +40,7 @@ #include "gdbcmd.h" #include "completer.h" #include "filenames.h" /* for DOSish file names */ - +#include "exec.h" #include "solist.h" #include diff --git a/gdb/somsolib.c b/gdb/somsolib.c index e013fd88d38..b2a833cbada 100644 --- a/gdb/somsolib.c +++ b/gdb/somsolib.c @@ -42,6 +42,7 @@ #include "language.h" #include "regcache.h" #include "gdb_assert.h" +#include "exec.h" #include @@ -55,10 +56,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); diff --git a/gdb/target.h b/gdb/target.h index b4557ff429c..03a7fd8803b 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1152,12 +1152,6 @@ struct section_table *target_section_by_addr (struct target_ops *target, 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 *); diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index c3f350a9e74..ea0fc93397e 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -52,6 +52,7 @@ #include "gdbcmd.h" #include #include +#include "exec.h" /* The ui's event loop. */ extern int (*ui_loop_hook) (int signo); diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index c3f350a9e74..ea0fc93397e 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -52,6 +52,7 @@ #include "gdbcmd.h" #include #include +#include "exec.h" /* The ui's event loop. */ extern int (*ui_loop_hook) (int signo); -- 2.39.5