[Lldb-commits] [lldb] [lldb] Avoid returning a stale AddressOf (PR #212915)
via lldb-commits
lldb-commits at lists.llvm.org
Thu Jul 30 10:53:42 PDT 2026
jimingham wrote:
This looks right.
The handling of GetAddressOf is different between the the different ValueObject subclasses. It would be good to test the other major types. Particularly "persistent expression results" are tricky in this regard, and it would be good to make sure they work.
You should be able to do that by running an expression like:
```
stop_frame.EvaluateExpression("int *$ptr = &a")
```
Then find $ptr - in Python you would use `
```
ptr_val = stop_frame.FindValues("$ptr", lldb.eValueTypeConstResult)
```
Then get its AddressOf. Then run:
```
stop_frame.EvaluateExpression("int *$ptr = &b")
```
and the AddressOf object you got from `$ptr` should be right just like the ValueObjectVariable you were using for `p`.
It would also be good to check this with ValueObjectChild by making a struct and making a `p` equivalent that's a member of the struct.
https://github.com/llvm/llvm-project/pull/212915
More information about the lldb-commits
mailing list