[Lldb-commits] [PATCH] D86348: [lldb/DWARF] More DW_AT_const_value fixes

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 21 06:22:35 PDT 2020


labath created this revision.
labath added reviewers: shafik, aprantl.
Herald added a project: LLDB.
labath requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: sstefan1, JDevlieghere.

This fixes several issues in handling of DW_AT_const_value attributes:

- the first is that the size of the data given by data forms does not need to match the size of the underlying variable. We already had the case to handle this for DW_FORM_(us)data -- this extends the handling to other data forms. The main reason this was not picked up is because clang uses leb forms in these cases while gcc prefers the fixed-size ones.
- The handling of DW_AT_strp form was completely broken -- we would end up using the pointer value as the result. I've reorganized this code so that it handles all string forms uniformly.
- In case of a completely bogus form we would crash due to strlen(nullptr).

Depends on D86311 <https://reviews.llvm.org/D86311>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86348

Files:
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/test/Shell/SymbolFile/DWARF/DW_AT_const_value.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86348.287022.patch
Type: text/x-patch
Size: 30655 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200821/e3053c43/attachment-0001.bin>


More information about the lldb-commits mailing list