aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorLancelot SIX <lancelot.six@amd.com>2022-08-11 15:09:55 +0100
committerLancelot SIX <lancelot.six@amd.com>2022-08-11 15:09:55 +0100
commit739be95178196df4babdcb47de856a12ba06253f (patch)
tree6599960bd0fee5a00c7debca1cca6f9c2cc6480b /gdb/varobj.c
parent537710a69cf440250c27a59b7d01b5a5a1a9b462 (diff)
downloadfsf-binutils-gdb-739be95178196df4babdcb47de856a12ba06253f.zip
fsf-binutils-gdb-739be95178196df4babdcb47de856a12ba06253f.tar.gz
fsf-binutils-gdb-739be95178196df4babdcb47de856a12ba06253f.tar.bz2
gdb/varobj: Do not invalidate locals in varobj_invalidate_iter
The varobj_invalidate_iter function has logic to invalidate any local varobj it can find. However since bc20e562ec0 "gdb/varobj: Fix use after free in varobj" all varobj containing references to an objfile are cleared when the objfile goes out of scope. This means that at this point any local varobj seen by varobj_invalidate_iter either has already been invalidated by varobj_invalidate_if_uses_objfile or only contains valid references and there is no reason to invalidate it. This patch proposes to remove this unnecessary invalidation and adds a testcase which exercises a scenario where a local varobj can legitimately survive a call to varobj_invalidate_iter. At this point the varobj_invalidate and varobj_invalidate_iter seem misnamed since they deal with re-creating invalid objects and do not do invalidation, but this will be fixed in a following patch. Tested on x86_64-linux.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 0683af1..a142bb0 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -2387,8 +2387,6 @@ varobj_invalidate_iter (struct varobj *var)
var->root->is_valid = false;
}
}
- else /* locals must be invalidated. */
- var->root->is_valid = false;
}
/* Invalidate the varobjs that are tied to locals and re-create the ones that