[Lldb-commits] [lldb] [LLDB] Fix symbol breakpoint lookups for non-C-like languages (PR #110543)

via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 30 12:14:31 PDT 2024


================
@@ -797,6 +797,10 @@ void Module::LookupInfo::Prune(SymbolContextList &sc_list,
     while (i < sc_list.GetSize()) {
       if (!sc_list.GetContextAtIndex(i, sc))
         break;
+      if (!lldb_private::Language::LanguageIsCFamily(sc.GetLanguage())) {
----------------
jimingham wrote:

This sort of code in generic parts of lldb is formally wrong, you shouldn't pretend to know that only C does something, you should ask the language plugin for the current context to do the job for you, and if it's a no-op, it should be that in the language plugin.

Of course, the code below this which you are circumventing ALSO doesn't belong in Module.cpp since it explicitly mentions CPlusPlusLanguage.

OTOH, maybe this should get a pass because you didn't cause the problem.  OTOH, given you're adding support for a new and enough different language that it trips up on these sorts of things, for your purposes, making sure these little tasks are properly factored out is of more importance, perhaps...

https://github.com/llvm/llvm-project/pull/110543


More information about the lldb-commits mailing list