In some cases when we have a DW_AT_const_value and the data can be found in the DWARFExpression then ValueObjectVariable does not handle it properly and we end up with an extracting data from value failed error:
(lldb) target var constant (U) constant = { raw = <extracting data from value failed> = (a = <extracting data from value failed>, b = <extracting data from value failed>, c = <extracting data from value failed>, d = <extracting data from value failed>, e = <extracting data from value failed>, f = <extracting data from value failed>) }
This should fix that case.
The test is a very stripped down assembly file since reproducing this relies on the results of compiling with -O1 which may not be stable over time.
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.