2004-06-14 Randolph Chung <tausq@debian.org>
authorRandolph Chung <tausq@debian.org>
Mon, 14 Jun 2004 20:40:40 +0000 (20:40 +0000)
committerRandolph Chung <tausq@debian.org>
Mon, 14 Jun 2004 20:40:40 +0000 (20:40 +0000)
* 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.

gdb/ChangeLog
gdb/Makefile.in
gdb/hppa-hpux-tdep.c
gdb/symfile.c

index e8f148c37b406b5cce3fc88b44f945f8ac387c2e..26bcc5d90fc47b751d1c37df18a7c2af571c2c2e 100644 (file)
@@ -1,3 +1,14 @@
+2004-06-14  Randolph Chung  <tausq@debian.org>
+
+       * 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.
+
 2004-06-14  Randolph Chung  <tausq@debian.org>
 
        * MAINTAINERS (Write After Approval): Alphabetize my entry correctly.
index e707c554b3fd79d1c2e913c0abc4df17557045f8..b113c9ac79f977b58d69f38acc61780d642fcdd6 100644 (file)
@@ -1864,7 +1864,7 @@ hppah-nat.o: hppah-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
 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 615f45de69f0f6def6c4f62b486fc12e7a3481fa..8e8765a4ac18047acc0f66aab9483b396edc567d 100644 (file)
@@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "objfiles.h"
 #include "inferior.h"
 #include "infcall.h"
+#include "observer.h"
 #include "hppa-tdep.h"
 
 #include <dl.h>
@@ -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 (struct frame_info *next_frame)
   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)
 {
@@ -1220,6 +1230,8 @@ hppa_hpux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   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 23320377406cb22a533b44ae931fefed8d76416a..95d62492283fd9ea7d4507267b9a4a6aed169131 100644 (file)
 #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 from_tty, int flags)
 {
   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);