From 20d2ca3e86cc80fcc93d9c3cf7c5cfe3e244714c Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 25 May 2004 16:04:07 +0000 Subject: [PATCH] 2004-05-25 Andrew Cagney * inftarg.c: Include "observer.h". (child_attach, child_create_inferior): Notify inferior_created. * corelow.c: Include "observer.h". (core_open): Notify inferior_created. * Makefile.in (inftarg.o, corelow.o): Update dependencies. --- gdb/ChangeLog | 8 ++++++++ gdb/Makefile.in | 5 +++-- gdb/corelow.c | 6 +++++- gdb/inftarg.c | 7 ++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8c46eb4e4f6..64cd11f1aa1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2004-05-25 Andrew Cagney + + * inftarg.c: Include "observer.h". + (child_attach, child_create_inferior): Notify inferior_created. + * corelow.c: Include "observer.h". + (core_open): Notify inferior_created. + * Makefile.in (inftarg.o, corelow.o): Update dependencies. + 2004-05-25 Andrew Cagney * target.h (struct target_ops): Add from_tty to diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 46a5aeafa11..42a6ffd1029 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1658,7 +1658,7 @@ corefile.o: corefile.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symtab_h) \ corelow.o: corelow.c $(defs_h) $(arch_utils_h) $(gdb_string_h) $(frame_h) \ $(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \ $(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \ - $(exec_h) $(readline_h) $(gdb_assert_h) + $(exec_h) $(readline_h) $(gdb_assert_h) $(observer_h) core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \ $(inferior_h) $(target_h) $(gdb_string_h) $(gregset_h) cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \ @@ -1944,7 +1944,8 @@ infrun.o: infrun.c $(defs_h) $(gdb_string_h) $(symtab_h) $(frame_h) \ $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) $(value_h) \ $(observer_h) $(language_h) $(gdb_assert_h) inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ - $(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) $(inflow_h) + $(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) $(inflow_h) \ + $(observer_h) infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdb_string_h) $(gdb_wait_h) $(command_h) $(gdbthread_h) \ $(gdbcore_h) $(infttrace_h) diff --git a/gdb/corelow.c b/gdb/corelow.c index 81c2b588a78..4c6a40c4c00 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -43,7 +43,7 @@ #include "symfile.h" #include "exec.h" #include "readline/readline.h" - +#include "observer.h" #include "gdb_assert.h" #ifndef O_BINARY @@ -355,6 +355,10 @@ core_open (char *filename, int from_tty) ontop = !push_target (&core_ops); discard_cleanups (old_chain); + /* This is done first, before anything has a chance to query the + inferior for information such as symbols. */ + observer_notify_inferior_created (&core_ops, from_tty); + p = bfd_core_file_failing_command (core_bfd); if (p) printf_filtered ("Core was generated by `%s'.\n", p); diff --git a/gdb/inftarg.c b/gdb/inftarg.c index 75e2690dbf1..a0e5dc5e5c3 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -34,7 +34,7 @@ #include #include #include - +#include "observer.h" #include "gdb_wait.h" #include "inflow.h" @@ -232,6 +232,10 @@ child_attach (char *args, int from_tty) inferior_ptid = pid_to_ptid (pid); push_target (&child_ops); + + /* Do this first, before anything has had a chance to query the + inferiors symbol table or similar. */ + observer_notify_inferior_created (¤t_target, from_tty); } #endif /* ATTACH_DETACH */ } @@ -365,6 +369,7 @@ child_create_inferior (char *exec_file, char *allargs, char **env, fork_inferior (exec_file, allargs, env, ptrace_me, ptrace_him, NULL, NULL); #endif /* We are at the first instruction we care about. */ + observer_notify_inferior_created (¤t_target, from_tty); /* Pedal to the metal... */ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0); } -- 2.30.2