[Lldb-commits] [PATCH] D141828: [lldb] Add support for DW_AT_default_value in template params

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 26 09:44:26 PST 2023


aprantl added inline comments.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:2057
+        case DW_AT_default_value:
+          if (attributes.ExtractFormValueAtIndex(i, form_value)) {
+            is_default_template_arg = form_value.Boolean();
----------------
nit: LLVM coding style doesn't use `{}` on single-statement conditionals.


================
Comment at: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py:63
             "sp_str",
-            type="std::shared_ptr<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >",
+            type="std::shared_ptr<std::basic_string<char> >",
             children=[ValueCheck(name="__ptr_", summary='"hello"')],
----------------
Nice!


================
Comment at: lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp:38
+    Platform::SetHostPlatform(
+        PlatformRemoteMacOSX::CreateInstance(true, &arch, nullptr, nullptr));
+  }
----------------
Does this work on Linux?


================
Comment at: lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp:435
+  std::stringstream buffer;
+  std::ifstream ifs{"Inputs/DW_AT_default_value-test.yaml"};
+  ASSERT_TRUE(ifs.is_open());
----------------
I don't know if this API is a good match here, but just in case you didn't know, the canonical LLVM way of reading from files is to use MemoryBuffer https://llvm.org/doxygen/classllvm_1_1MemoryBuffer.html#aa98611beefe78f907beeee7305cc8174



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141828



More information about the lldb-commits mailing list