-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb][DWARF] Search for symbols in all external modules #75927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-lldb Author: David Spickett (DavidSpickett) ChangesThe way this code was updated in dd95877 meant that if the first module did not have the symbol, the iteration stopped as returning true means stop. So only if every module had the symbol would we find it, in the last module. Invert the condition to break when we find the first instance, which is what the previous code did. Full diff: https://github.com/llvm/llvm-project/pull/75927.diff 1 Files Affected:
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 334876620249fc..a07fa760b1b401 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -175,7 +175,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromClangModule(const SymbolContext &sc,
*sc.comp_unit, results.GetSearchedSymbolFiles(), [&](Module &module) {
module.FindTypes(query, results);
pcm_type_sp = results.GetTypeMap().FirstType();
- return !pcm_type_sp;
+ return pcm_type_sp != nullptr;
});
}
|
I would have guessed true means continue. Also, changing this didn't break any tests. So it would be nice to cover this but I don't know how. Would the whole test suite have to be built with modules enabled? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hmmm we used to have a debug-info category for |
I would have thought Do you know what "external module" means in this context, as opposed to just module? The code searches "the clang Module" first, then the external modules. |
Looks like external module are The executable for I wonder if this "search all breadcrumbs" codepath only gets triggered when we try to parse a forward declaration under a |
The way this code was updated in dd95877 meant that if the first module did not have the symbol, the iteration stopped as returning true means stop. So only if every module had the symbol would we find it, in the last module. Invert the condition to break when we find the first instance, which is what the previous code did.
2ad3331
to
a7770da
Compare
Didn't want to leave this broken over the holiday break so I've merged it as obvious. I would still like to add a test so if @adrian-prantl or anyone else can tell me how to write one, I'll do that as a follow up. Need some clues as I've not used modules before. |
The way this code was updated in dd95877 meant that if the first module did not have the symbol, the iteration stopped as returning true means stop. So only if every module had the symbol would we find it, in the last module.
Invert the condition to break when we find the first instance, which is what the previous code did.