Open Quuxplusone opened 4 years ago
Bugzilla Link | PR47257 |
Status | CONFIRMED |
Importance | P normal |
Reported by | Luca Massarelli (massarelli@diag.uniroma1.it) |
Reported on | 2020-08-20 10:27:54 -0700 |
Last modified on | 2020-08-24 02:38:44 -0700 |
Version | unspecified |
Hardware | All All |
CC | ditaliano@apple.com, jdevlieghere@apple.com, keith.walker@arm.com, labath@google.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com, vsk@apple.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
Reproduced & confirmed.
(lldb) frame var l_125
(int *) l_125 = <empty constant data>
^ this is interesting.
It comes from lldb.
if (variable->GetLocationIsConstantValueData()) {
// expr doesn't contain DWARF bytes, it contains the constant variable
// value bytes themselves...
if (expr.GetExpressionData(m_data))
m_value.SetContext(Value::eContextTypeVariable, variable);
else
m_error.SetErrorString("empty constant data");
// constant bytes can't be edited - sorry
m_resolved_value.SetContext(Value::eContextTypeInvalid, nullptr);
} else {
The DWARF is correct.
0x00000106: DW_TAG_variable
DW_AT_const_value (0)
DW_AT_name ("l_125")
DW_AT_decl_file ("/Users/davide/work/build/bin/a.c")
DW_AT_decl_line (10)
DW_AT_type (0x00000043 "int*")
This is a bug in the DWARF parser in lldb, likely.
Looks like GetExpressionData returns false:
211 bool GetExpressionData(DataExtractor &data) const {
-> 212 data = m_data;
213 return data.GetByteSize() > 0;
214 }
215
Target 0: (lldb) stopped.
(lldb) p m_data
(lldb_private::DataExtractor) $2 = {
m_start = 0x0000000000000000
m_end = 0x0000000000000000
m_byte_order = eByteOrderLittle
m_addr_size = 8
m_data_sp = nullptr {
__ptr_ = 0x0000000000000000
}
m_target_byte_size = 1
}
I've been doing some const_value work these days. I'll take a look at this too.
Bug caused by a typo. Fix is in D86436.