[Lldb-commits] [PATCH] D115951: Cache the manual DWARF index out to the LLDB cache directory when the LLDB index cache is enabled.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 20 06:14:52 PST 2021


labath added inline comments.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DIERef.h:59
+    return m_dwo_num_valid == rhs.m_dwo_num_valid &&
+           m_dwo_num == rhs.m_dwo_num && m_section == rhs.m_section &&
+           m_die_offset == rhs.m_die_offset;
----------------
if `m_dwo_num_valid` then we shouldn't be checking/comparing m_dwo_num. Right now, it is kinda ok, as I don't think there's a way to obtain a non-zero m_dwo_num with `m_dwo_num_valid = false`, but it'd be better to not rely on that. You can just compare `dwo_num()` with `rhs.dwo_num()`.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp:31
-  SymbolFileDWARF &main_dwarf = *m_dwarf;
-  m_dwarf = nullptr;
-
----------------
The m_dwarf pointer also served as a flag indicating whether indexing has been done. If you want to keep it around, you'll need to introduce another field to track the indexing state.


================
Comment at: lldb/unittests/SymbolFile/DWARF/DWARFIndexCachingTest.cpp:32-34
+  llvm::Optional<DIERef> decoded_object = DIERef::Decode(data, &data_offset);
+  ASSERT_EQ((bool)decoded_object, true);
+  EXPECT_EQ(object, decoded_object.getValue());
----------------
EXPECT_EQ(object, DIERef::Decode(data, &data_offset))


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115951



More information about the lldb-commits mailing list