[Lldb-commits] [lldb] Improve type and namespace lookup using parent chain (PR #108907)
Felipe de Azevedo Piovezan via lldb-commits
lldb-commits at lists.llvm.org
Mon Sep 23 09:22:13 PDT 2024
================
@@ -402,6 +420,36 @@ bool DebugNamesDWARFIndex::SameParentChain(
return true;
}
+bool DebugNamesDWARFIndex::WithinParentChain(
+ llvm::ArrayRef<llvm::StringRef> query_parent_names,
+ llvm::ArrayRef<DebugNames::Entry> parent_chain) const {
+ if (parent_chain.size() < query_parent_names.size())
+ return false;
+
+ size_t query_idx = 0, chain_idx = 0;
+ while (query_idx < query_parent_names.size() &&
+ chain_idx < parent_chain.size()) {
+ if (SameAsEntryATName(query_parent_names[query_idx],
+ parent_chain[chain_idx])) {
+ ++query_idx;
+ ++chain_idx;
+ } else {
+ // Name does not match, try next parent_chain entry if the current entry
+ // is namespace because the current one can be an inline namespace.
----------------
felipepiovezan wrote:
Ok, good to know we have a mechanism to detect inline namespaces.
That still leaves the question of how to avoid false results though. I understand peeking at the DIE would be expensive for `dwo`s, but I don't think we can sacrifice the correctness of the answer for these queries. One possibility to explore is to add another IDX entry for namespaces, which would include whether they export symbols or not.
https://github.com/llvm/llvm-project/pull/108907
More information about the lldb-commits
mailing list