[Lldb-commits] [PATCH] D46889: [DWARF] Extract indexing code into a separate class hierarchy
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue May 15 09:22:59 PDT 2018
labath created this revision.
labath added reviewers: clayborg, JDevlieghere.
Herald added subscribers: aprantl, mgorny.
This places the `if(m_using_apple_tables)` branches inside the
SymbolFileDWARF class behind an abstract DWARFIndex class. The class
currently has two implementations:
- AppleIndex, which searches using .apple_names and friends
- ManualIndex, which searches using a manually built index
Most of the methods of the class are very simple, and simply extract the
list of DIEs for the given name from the appropriate sub-table. The main
exception are the two GetFunctions overloads, which take a couple of
extra paramenters, including some callbacks. It was not possible to
split these up the same way as other methods, as here we were doing a
lot of post-processing on the results. The post-processing is similar
for the two cases, but not identical. I hope to factor these further in
separate patches.
Other interesting methods are:
- Preload(): do any preprocessing to make lookups faster (noop for AppleIndex, forces a build of the lookup tables for ManualIndex).
- ReportInvalidDIEOffset(): Used to notify the users of an invalid index (prints a message for AppleIndex, noop for ManualIndex).
- Dump(): dumps the index state (noop for AppleIndex, prints the lookup tables for ManualIndex).
https://reviews.llvm.org/D46889
Files:
source/Plugins/SymbolFile/DWARF/CMakeLists.txt
source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
source/Plugins/SymbolFile/DWARF/DWARFIndex.h
source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46889.146853.patch
Type: text/x-patch
Size: 71230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180515/5fde3128/attachment-0001.bin>
More information about the lldb-commits
mailing list