Michael137 wrote:

> The DWARFASTParserClang.cpp will try to create the class from the DWARF for 
> the class definition. You will need to find the DW_TAG_variable when we are 
> creating the static field if there is no DW_AT_const_value in the 
> DW_TAG_member. But we also need to support the DW_AT_const_value being in the 
> DW_TAG_member since older DWARF will be emitted like this.

That's 100% correct. I was thinking, before [this 
block](https://github.com/llvm/llvm-project/blob/8b91de5d6a3f98dcc00bbd286e339e512f7e3682/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp#L2909-L2919)
 where we check for the existence of a `const_value_form`. With this patch such 
constant won't exist on the declaration. So I was thinking we would try to look 
for the definition. What's interesting is that with this patch, the expression 
evaluator successfully finds the DW_TAG_variable which have a location 
attribute but not if they have a constant instead of a location. It's probably 
some logic that assumes statics always have a location

> Are we going to emit a DW_AT_const_expr now in the DW_TAG_member? If so, then 
> we will know that we need to look for the DW_TAG_variable. I don't think 
> clang emitted the DW_AT_const_expr attribute before.

That wasn't part of this patch. But would make sense to add (i've noticed GCC 
adds that attribute)

https://github.com/llvm/llvm-project/pull/70639
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to