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

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 26 09:38:17 PDT 2020


aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

What a function :-)



================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:3134
   if ((tag == DW_TAG_variable) || (tag == DW_TAG_constant) ||
       (tag == DW_TAG_formal_parameter && sc.function)) {
     DWARFAttributes attributes;
----------------
Would be nice to early-exit here, too.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:3257
+        } else if (const char *str = const_value_form.AsCString()) {
+          uint32_t string_length = strlen(str) + 1;
+          location = DWARFExpression(
----------------
If we do this a lot a StringRef DWARFFormValue::AsCStringRef() call would make sense...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86615



More information about the lldb-commits mailing list