llvm-project/lldb/test/API/commands/expression/persistent_variables
Raphael Isemann cb81e662a5 [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
2020-10-14 10:24:35 +02:00
..
Makefile
TestPersistentVariables.py [lldb] Reject redefinitions of persistent variables 2020-10-14 10:24:35 +02:00
main.c [lldb][NFC] Modernize TestPersistentVariables 2020-06-12 16:06:05 +02:00