From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27233 invoked by alias); 10 Jun 2004 06:02:45 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 27124 invoked from network); 10 Jun 2004 06:02:27 -0000 Received: from unknown (HELO pippin.tausq.org) (64.81.244.94) by sourceware.org with SMTP; 10 Jun 2004 06:02:27 -0000 Received: by pippin.tausq.org (Postfix, from userid 1000) id D4ED5CD29F; Wed, 9 Jun 2004 23:02:27 -0700 (PDT) Date: Thu, 10 Jun 2004 06:02:00 -0000 From: Randolph Chung To: gdb-patches@sources.redhat.com Subject: [patch/rfa] Use inferior_created observer to cleanup HPUXHPPA code Message-ID: <20040610060227.GE561@tausq.org> Reply-To: Randolph Chung Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-06/txt/msg00218.txt.bz2 Cleans up some HPUXHPPA code in symfile.c; ok to apply? randolph 2004-06-09 Randolph Chung * Makefile.in (hppa-hpux-tdep.o): Update dependency. * hppa-hpux-tdep.c (hp_cxx_exception_support_initialized): Make static. (hppa_hpux_inferior_created): New function. (hppa_hpux_init_abi): Register observer. * symfile.c (hp_cxx_exception_support_initialized) (RESET_HP_UX_GLOBALS): Remove HPUXHPPA specific hacks. (symbol_file_add_main_1, symbol_file_clear): Likewise. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.585 diff -u -p -r1.585 Makefile.in --- Makefile.in 7 Jun 2004 02:08:06 -0000 1.585 +++ Makefile.in 10 Jun 2004 05:30:40 -0000 @@ -1836,7 +1836,7 @@ hppah-nat.o: hppah-nat.c $(defs_h) $(inf hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \ $(osabi_h) $(gdb_string_h) $(frame_h) $(frame_unwind_h) \ $(trad_frame_h) $(symtab_h) $(objfiles_h) $(inferior_h) $(infcall_h) \ - $(hppa_tdep_h) + $(observer_h) $(hppa_tdep_h) hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \ $(regcache_h) $(completer_h) $(osabi_h) $(gdb_assert_h) \ $(arch_utils_h) $(symtab_h) $(dis_asm_h) $(trad_frame_h) \ Index: hppa-hpux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v retrieving revision 1.20 diff -u -p -r1.20 hppa-hpux-tdep.c --- hppa-hpux-tdep.c 7 Jun 2004 02:17:29 -0000 1.20 +++ hppa-hpux-tdep.c 10 Jun 2004 05:30:40 -0000 @@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "objfiles.h" #include "inferior.h" #include "infcall.h" +#include "observer.h" #include "hppa-tdep.h" #include @@ -533,7 +534,7 @@ __eh_notification; /* Is exception-handling support available with this executable? */ static int hp_cxx_exception_support = 0; /* Has the initialize function been run? */ -int hp_cxx_exception_support_initialized = 0; +static int hp_cxx_exception_support_initialized = 0; /* Address of __eh_notify_hook */ static CORE_ADDR eh_notify_hook_addr = 0; /* Address of __d_eh_notify_callback */ @@ -1203,6 +1204,15 @@ hppa_hpux_sigtramp_unwind_sniffer (struc return NULL; } +static void +hppa_hpux_inferior_created (struct target_ops *objfile, int from_tty) +{ + /* Some HP-UX related globals to clear when a new "main" + symbol file is loaded. HP-specific. */ + deprecated_hp_som_som_object_present = 0; + hp_cxx_exception_support_initialized = 0; +} + static void hppa_hpux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -1219,7 +1375,9 @@ hppa_hpux_init_abi (struct gdbarch_info hppa_hpux_in_solib_return_trampoline); set_gdbarch_skip_trampoline_code (gdbarch, hppa_hpux_skip_trampoline_code); frame_unwind_append_sniffer (gdbarch, hppa_hpux_sigtramp_unwind_sniffer); + + observer_attach_inferior_created (hppa_hpux_inferior_created); } static void Index: symfile.c =================================================================== RCS file: /cvs/src/src/gdb/symfile.c,v retrieving revision 1.130 diff -u -p -r1.130 symfile.c --- symfile.c 20 May 2004 09:51:33 -0000 1.130 +++ symfile.c 10 Jun 2004 05:30:42 -0000 @@ -60,18 +60,6 @@ #define O_BINARY 0 #endif -#ifdef HPUXHPPA - -/* Some HP-UX related globals to clear when a new "main" - symbol file is loaded. HP-specific. */ - -extern int hp_cxx_exception_support_initialized; -#define RESET_HP_UX_GLOBALS() do {\ - deprecated_hp_som_som_object_present = 0; /* indicates HP-compiled code */ \ - hp_cxx_exception_support_initialized = 0; /* must reinitialize exception stuff */ \ - } while (0) -#endif - int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num); void (*deprecated_show_load_progress) (const char *section, unsigned long section_sent, @@ -957,10 +945,6 @@ symbol_file_add_main_1 (char *args, int { symbol_file_add (args, from_tty, NULL, 1, flags); -#ifdef HPUXHPPA - RESET_HP_UX_GLOBALS (); -#endif - /* Getting new symbols may change our opinion about what is frameless. */ reinit_frame_cache (); @@ -989,9 +973,6 @@ symbol_file_clear (int from_tty) symfile_objfile = NULL; if (from_tty) printf_unfiltered ("No symbol file now.\n"); -#ifdef HPUXHPPA - RESET_HP_UX_GLOBALS (); -#endif } static char * @@ -1944,9 +1925,6 @@ reread_symbols (void) if (objfile == symfile_objfile) { (*objfile->sf->sym_new_init) (objfile); -#ifdef HPUXHPPA - RESET_HP_UX_GLOBALS (); -#endif } (*objfile->sf->sym_init) (objfile); -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/