aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@broadcom.com>2012-07-30 12:10:23 +0000
committerAndrew Burgess <aburgess@broadcom.com>2012-07-30 12:10:23 +0000
commit4e969b4f01286290f5d06e41dd8e8a2c738d7650 (patch)
tree32109ff24285ce772a7c45c07f23254981ddd93d /gdb/varobj.c
parenta6dc81d2ab37bd09527e0a00d82c4670f22a1a27 (diff)
downloadgdb-4e969b4f01286290f5d06e41dd8e8a2c738d7650.zip
gdb-4e969b4f01286290f5d06e41dd8e8a2c738d7650.tar.gz
gdb-4e969b4f01286290f5d06e41dd8e8a2c738d7650.tar.bz2
http://sourceware.org/ml/gdb-patches/2012-07/msg00551.html
Re-evaluate floating variables as part of variable invalidate to remove references to type structures that might have been freed.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 99b158e..a75a40d 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -4186,18 +4186,17 @@ _initialize_varobj (void)
}
/* 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. */
+ defined on globals. It is a helper for varobj_invalidate.
+
+ This function is called after changing the symbol file, in this case the
+ pointers to "struct type" stored by the varobj are no longer valid. All
+ varobj must be either re-evaluated, or marked as invalid here. */
static void
varobj_invalidate_iter (struct varobj *var, void *unused)
{
- /* 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)
+ /* global and floating var must be re-evaluated. */
+ if (var->root->floating || var->root->valid_block == NULL)
{
struct varobj *tmp_var;