[Lldb-commits] [PATCH] D86615: [lldb/DWARF] Fix handling of variables with both location and const_value attributes

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 26 05:33:49 PDT 2020


labath created this revision.
labath added reviewers: aprantl, shafik.
Herald added a project: LLDB.
labath requested review of this revision.
Herald added a subscriber: JDevlieghere.

Class-level static constexpr variables can have both DW_AT_const_value
(in the "declaration") and a DW_AT_location (in the "definition")
attributes. Our code was trying to handle this, but it was brittle and
hard to follow (and broken) because it was processing the attributes in
the order in which they were found.

Refactor the code to make the intent clearer -- DW_AT_location trumps
DW_AT_const_value, and fix the bug which meant that we were not
displaying these variables properly (the culprit was the delayed parsing
of the const_value attribute due to a need to fetch the variable type.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86615

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/test/Shell/SymbolFile/DWARF/DW_AT_location-DW_AT_const_value.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86615.287940.patch
Type: text/x-patch
Size: 16697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200826/e21ec946/attachment-0001.bin>


More information about the lldb-commits mailing list