[Lldb-commits] [PATCH] D86311: Fix how ValueObjectVariable handles DW_AT_const_value when the DWARFExpression holds the data that represents a constant value

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 24 14:14:13 PDT 2020


shafik added inline comments.


================
Comment at: lldb/source/Core/ValueObjectVariable.cpp:136
+    if (expr.GetExpressionData(m_data)) {
+       if (m_data.GetDataStart() && m_data.GetByteSize())
+        m_value.SetBytes(m_data.GetDataStart(), m_data.GetByteSize());
----------------
labath wrote:
> I doubt this check is necessary -- surely we should be able to rely on `GetExpressionData` setting the data extractor to something reasonable if it returns success.
> 
> If anything, it would be nice to make a test with an empty DW_AT_const_value, which checks that lldb does something reasonable. It shouldn't that hard -- copy the DW_TAG_variable abbreviation, change DW_AT_const_value to DW_FORM_block, and make a new variable DIE with an empty block.
I see what you are saying, let me verify this in a separate PR and if that bears out then we can remove this check.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86311/new/

https://reviews.llvm.org/D86311



More information about the lldb-commits mailing list