From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28898 invoked by alias); 11 Aug 2009 21:09:00 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 28850 invoked by uid 9674); 11 Aug 2009 21:09:00 -0000 Date: Tue, 11 Aug 2009 21:09:00 -0000 Message-ID: <20090811210900.28823.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-fedora12: Merge commit 'origin/archer-jankratochvil-vla' into archer-jankratochvil-fedora12 X-Git-Refname: refs/heads/archer-jankratochvil-fedora12 X-Git-Reftype: branch X-Git-Oldrev: 93f5e942bdcdcc376ece452c309bedabae71def9 X-Git-Newrev: 2888fafe63889757c6fd27ccc2f25661d43fd1a4 X-SW-Source: 2009-q3/txt/msg00092.txt.bz2 List-Id: The branch, archer-jankratochvil-fedora12 has been updated via 2888fafe63889757c6fd27ccc2f25661d43fd1a4 (commit) via befbd5cc7736180dc67cea9f778f92b7fe64dc3e (commit) via ffced5bebff0155d2ab82890df5b0012b9e59a07 (commit) from 93f5e942bdcdcc376ece452c309bedabae71def9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 2888fafe63889757c6fd27ccc2f25661d43fd1a4 Merge: 93f5e942bdcdcc376ece452c309bedabae71def9 befbd5cc7736180dc67cea9f778f92b7fe64dc3e Author: Jan Kratochvil Date: Tue Aug 11 23:08:46 2009 +0200 Merge commit 'origin/archer-jankratochvil-vla' into archer-jankratochvil-fedora12 Conflicts: gdb/objfiles.c ----------------------------------------------------------------------- Summary of changes: gdb/doc/observer.texi | 9 --- gdb/objfiles.c | 8 ++-- gdb/printcmd.c | 8 ++- gdb/symfile.c | 13 ++--- gdb/value.c | 3 +- gdb/value.h | 2 + gdb/varobj.c | 144 ++++++++++++------------------------------------- gdb/varobj.h | 2 + 8 files changed, 56 insertions(+), 133 deletions(-) First 500 lines of diff: diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi index 4bbbe4e..fcf1b5d 100644 --- a/gdb/doc/observer.texi +++ b/gdb/doc/observer.texi @@ -130,15 +130,6 @@ Called with @var{objfile} equal to @code{NULL} to indicate previously loaded symbol table data has now been invalidated. @end deftypefun -@deftypefun void objfile_unloading (struct objfile *@var{objfile}) -The file specified by @var{objfile} is going to be removed from @value{GDBN}. -@end deftypefun - -@deftypefun void objfile_unloaded (void) -Removal of @var{objfile} started by @code{objfile_unloading} finished and -@var{objfile} is no longer known to @value{GDBN}. -@end deftypefun - @deftypefun void new_thread (struct thread_info *@var{t}) The thread specified by @var{t} has been created. @end deftypefun diff --git a/gdb/objfiles.c b/gdb/objfiles.c index a4bf719..6d0451c 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -50,7 +50,6 @@ #include "addrmap.h" #include "arch-utils.h" #include "exec.h" -#include "observer.h" /* Prototypes for local functions */ @@ -432,9 +431,10 @@ free_objfile (struct objfile *objfile) doesn't reference it. */ objfile->separate_debug_objfile_backlink->separate_debug_objfile = NULL; } - - /* Remove any references to this objfile in the global value lists. */ - observer_notify_objfile_unloading (objfile); + + /* Remove any references to this objfile in the global value + lists. */ + preserve_values (objfile); /* First do any symbol file specific actions required when we are finished with a particular symbol file. Note that if the objfile diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 49c575d..fb0a455 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1827,10 +1827,14 @@ disable_display_command (char *args, int from_tty) an item by re-parsing .exp_string field in the new execution context. */ static void -clear_dangling_display_expressions (struct objfile *objfile) +clear_dangling_display_expressions (struct so_list *solib) { + struct objfile *objfile = solib->objfile; struct display *d; + if (objfile == NULL) + return; + for (d = display_chain; d != NULL; d = d->next) if (block_objfile (d->block) == objfile || (d->exp && exp_uses_objfile (d->exp, objfile))) @@ -2567,7 +2571,7 @@ _initialize_printcmd (void) current_display_number = -1; - observer_attach_objfile_unloading (clear_dangling_display_expressions); + observer_attach_solib_unloaded (clear_dangling_display_expressions); add_info ("address", address_info, _("Describe where symbol SYM is stored.")); diff --git a/gdb/symfile.c b/gdb/symfile.c index 8b971fb..550d06a 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -52,6 +52,7 @@ #include "observer.h" #include "exec.h" #include "parser-defs.h" +#include "varobj.h" #include "elf-bfd.h" #include "solib.h" #include "remote.h" @@ -925,9 +926,6 @@ new_symfile_objfile (struct objfile *objfile, int add_flags) /* We're done reading the symbol file; finish off complaints. */ clear_complaints (&symfile_complaints, 0, add_flags & SYMFILE_VERBOSE); - - /* We have finished unloading of OBJFILE. */ - observer_notify_objfile_unloaded (); } /* A helper function which returns true if OBJFILE has any debug @@ -2372,7 +2370,7 @@ reread_symbols (void) /* Remove any references to this objfile in the global value lists. */ - observer_notify_objfile_unloading (objfile); + preserve_values (objfile); /* Nuke all the state that we will re-read. Much of the following code which sets things to NULL really is necessary to tell @@ -2477,9 +2475,6 @@ reread_symbols (void) reinit_frame_cache (); - /* We have finished reloading of OBJFILE. */ - observer_notify_objfile_unloaded (); - /* Discard cleanups as symbol reading was successful. */ discard_cleanups (old_cleanups); @@ -2860,6 +2855,10 @@ clear_symtab_users (void) between expressions and which ought to be reset each time. */ expression_context_block = NULL; innermost_block = NULL; + + /* Varobj may refer to old symbols, perform a cleanup. */ + varobj_invalidate (); + } static void diff --git a/gdb/value.c b/gdb/value.c index c943781..fa39d3d 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1551,7 +1551,7 @@ preserve_one_internalvar (struct internalvar *var, struct objfile *objfile, this objfile's types, and the convenience variables will be adjusted to use the new global types. */ -static void +void preserve_values (struct objfile *objfile) { htab_t copied_types; @@ -2479,6 +2479,5 @@ Placeholder command for showing help on convenience functions."), make_final_cleanup (value_history_cleanup, NULL); - observer_attach_objfile_unloading (preserve_values); observer_attach_mark_used (value_types_mark_used); } diff --git a/gdb/value.h b/gdb/value.h index ee8440b..c357d80 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -664,6 +664,8 @@ extern void typedef_print (struct type *type, struct symbol *news, extern char *internalvar_name (struct internalvar *var); +extern void preserve_values (struct objfile *); + /* From values.c */ extern struct value *value_copy (struct value *); diff --git a/gdb/varobj.c b/gdb/varobj.c index 34333fb..f2654f0 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -37,7 +37,6 @@ #include "vec.h" #include "gdbthread.h" #include "inferior.h" -#include "observer.h" #if HAVE_PYTHON #include "python/python.h" @@ -3432,73 +3431,48 @@ varobj_types_mark_used (void) all_varobjs (varobj_types_mark_used_iter, NULL); } - -/* Invalidate VAR if it is tied to the specified OBJFILE. Call this function - before you start removing OBJFILE. - - Call varobj_revalidate_iter after the OBJFILE update get finished. - - Invalidated varobjs will be always printed in_scope="invalid". */ - -static void -varobj_invalidate_iter (struct varobj *var, void *objfile_voidp) + +extern void _initialize_varobj (void); +void +_initialize_varobj (void) { - struct objfile *objfile = objfile_voidp; - - /* Check VAROBJROOTs only once during the varobj_invalidate pass. */ - - if (var->root->rootvar == var) - { - /* Check even FLOATING VAROBJROOTs as their data will be still checked - during varobj_update by varobj_get_type. */ - - if (var->root->is_valid - && block_objfile (var->root->valid_block) == objfile) - var->root->is_valid = 0; - - if (var->root->exp && exp_uses_objfile (var->root->exp, objfile)) - { - var->root->is_valid = 0; - - /* No one touches EXP for !IS_VALID varobj. */ - xfree (var->root->exp); - var->root->exp = NULL; - } - } - - if (var->type && TYPE_OBJFILE (var->type) == objfile) - { - var->root->is_valid = 0; - - var->type = NULL; - } + int sizeof_table = sizeof (struct vlist *) * VAROBJ_TABLE_SIZE; - if (var->value && TYPE_OBJFILE (value_type (var->value)) == objfile) - { - var->root->is_valid = 0; + varobj_table = xmalloc (sizeof_table); + memset (varobj_table, 0, sizeof_table); - value_free (var->value); - var->value = NULL; - } + add_setshow_zinteger_cmd ("debugvarobj", class_maintenance, + &varobjdebug, _("\ +Set varobj debugging."), _("\ +Show varobj debugging."), _("\ +When non-zero, varobj debugging is enabled."), + NULL, + show_varobjdebug, + &setlist, &showlist); } -/* Recreate any global varobjs possibly previously invalidated. If the - expressions are no longer evaluatable set/keep the VAR invalid. */ +/* Invalidate varobj VAR if it is tied to locals and re-create it if it is + defined on globals. It is a helper for varobj_invalidate. */ static void -varobj_revalidate_iter (struct varobj *var, void *unused) +varobj_invalidate_iter (struct varobj *var, void *unused) { - /* Global VAR must be re-evaluated. */ + /* Floating varobjs are reparsed on each stop, so we don't care if the + presently parsed expression refers to something that's gone. */ + if (var->root->floating) + return; + /* global var must be re-evaluated. */ if (var->root->valid_block == NULL) { struct varobj *tmp_var; /* Try to create a varobj with same expression. If we succeed replace the old varobj, otherwise invalidate it. */ - tmp_var = varobj_create (NULL, var->name, 0, USE_CURRENT_FRAME); - if (tmp_var != NULL) - { + tmp_var = varobj_create (NULL, var->name, (CORE_ADDR) 0, + USE_CURRENT_FRAME); + if (tmp_var != NULL) + { tmp_var->obj_name = xstrdup (var->obj_name); varobj_delete (var, NULL, 0); install_variable (tmp_var); @@ -3506,64 +3480,16 @@ varobj_revalidate_iter (struct varobj *var, void *unused) else var->root->is_valid = 0; } + else /* locals must be invalidated. */ + var->root->is_valid = 0; } -/* Call varobj_invalidate_iter for all the VAROBJs. */ - -static void -varobj_invalidate (struct objfile *objfile) -{ - /* Check all the VAROBJs, even non-root ones. Child VAROBJs can reference - types from other OBJFILEs through TYPE_IS_OPAQUE resolutions by - check_typedef. */ - - all_varobjs (varobj_invalidate_iter, objfile); -} - -/* Call varobj_revalidate_iter for all the root VAROBJs. */ - -static void -varobj_revalidate (void) -{ - /* Check only root VAROBJs. Any successful revalidation will replace the - whole VAROBJs tree starting with root VAROBJs and its children get created - later on-demand. So there is no point trying to revalidate the child - VAROBJs. */ - - all_root_varobjs (varobj_revalidate_iter, NULL); -} - -/* Call varobj_revalidate just providing a different function prototype. - Currently existing VAROBJs may become valid or change with new symbols - loaded. */ +/* Invalidate the varobjs that are tied to locals and re-create the ones that + are defined on globals. + Invalidated varobjs will be always printed in_scope="invalid". */ -static void -varobj_revalidate_for_objfile (struct objfile *objfile) -{ - varobj_revalidate (); -} - -extern void _initialize_varobj (void); -void -_initialize_varobj (void) +void +varobj_invalidate (void) { - int sizeof_table = sizeof (struct vlist *) * VAROBJ_TABLE_SIZE; - - varobj_table = xmalloc (sizeof_table); - memset (varobj_table, 0, sizeof_table); - - add_setshow_zinteger_cmd ("debugvarobj", class_maintenance, - &varobjdebug, _("\ -Set varobj debugging."), _("\ -Show varobj debugging."), _("\ -When non-zero, varobj debugging is enabled."), - NULL, - show_varobjdebug, - &setlist, &showlist); - - - observer_attach_objfile_unloading (varobj_invalidate ); - observer_attach_objfile_unloaded (varobj_revalidate); - observer_attach_new_objfile (varobj_revalidate_for_objfile); - observer_attach_mark_used (varobj_types_mark_used); + all_root_varobjs (varobj_invalidate_iter, NULL); } diff --git a/gdb/varobj.h b/gdb/varobj.h index fbe2f2f..0744cc3 100644 --- a/gdb/varobj.h +++ b/gdb/varobj.h @@ -160,6 +160,8 @@ extern void all_root_varobjs (void (*func) (struct varobj *var, void *data), extern VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit); +extern void varobj_invalidate (void); + extern int varobj_editable_p (struct varobj *var); extern int varobj_floating_p (struct varobj *var); hooks/post-receive -- Repository for Project Archer.