[Lldb-commits] [lldb] Fix pointer to reference type (PR #113596)

via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 31 10:58:57 PDT 2024


jimingham wrote:

First off, it is not the case that the "ValueObject Path Expression" operators - part of what we're starting to call the DIL (Data Inspection Language) - are supposed to exactly mirror C++ semantics.  Since they reflect all the ways that a synthetic child provider might present its children, and since this part of lldb is independent of language - it gets used for C/ObjC/C++/Swift/Rust etc values, not just C++ - I don't think this would a feasible or particularly useful requirement.

So  "be the same as C++ semantics" is not a sufficient justification to change how the path expressions get interpreted in lldb.  The better motivation is "what is a useful and consistent syntax for static poking at data objects".  The question "where does this reference live" isn't a particularly useful question to ask in C++ code, but it does seem like a useful question to ask when poking around in data.  And since we're generally treating `&` to mean "what is the location of this object in memory" in the DIL, then interpreting the & in this case the way it was before the patch seems more natural.

I agree with Pavel, we should take a step back and actually define what `&` and `*` will mean in the DIL, and then implement that.

https://github.com/llvm/llvm-project/pull/113596


More information about the lldb-commits mailing list