From ea53e89f14887acd25d0538f6bfb0f3a632f3bae Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Tue, 8 Mar 2005 04:34:45 +0000 Subject: * doc/observer.texi (executable_changed): New observer. * symtab.c: Include "observer.h". (find_main_name): New function. (main_name): If name_of_main is unset, then compute it using find_main_name. (symtab_observer_executable_changed): New function. (_initialize_symtab): Attach executable_changed observer. * exec.c: Include "observer.h". (exec_file_attach): Emit executable_changed notification. * symfile.c: Include "observer.h". (reread_symbols): Send an executable_changed if appropriate. * Makefile.in (exec.o): Add dependency on observer.h. (symfile.o): Likewise. (symtab.o): Likewise. --- gdb/symfile.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gdb/symfile.c') diff --git a/gdb/symfile.c b/gdb/symfile.c index 6bf9413..1dbc2b2 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -48,6 +48,7 @@ #include "readline/readline.h" #include "gdb_assert.h" #include "block.h" +#include "observer.h" #include #include @@ -2013,7 +2014,13 @@ reread_symbols (void) } if (reread_one) - clear_symtab_users (); + { + clear_symtab_users (); + /* At least one objfile has changed, so we can consider that + the executable we're debugging has changed too. */ + observer_notify_executable_changed (NULL); + } + } -- cgit v1.1