[lldb] Reject redefinitions of persistent variables
Currently one can redefine a persistent variable and LLDB will just silently ignore the second definition: ``` (lldb) expr int $i = 1 (lldb) expr int $i = 2 (lldb) expr $i (int) $i = 1 ``` This patch makes this an error and rejects the expression with the second definition. A nice follow up would be to refactor LLDB's persistent variables to not just be a pair of type and name, but also contain some way to obtain the original declaration and source code that declared the variable. That way we could actually make a full diagnostic as we would get from redefining a variable twice in the same expression. Reviewed By: labath, shafik, JDevlieghere Differential Revision: https://reviews.llvm.org/D89310
Loading
Please sign in to comment