[Lldb-commits] [PATCH] D15175: Fix breakpoint language filtering for other C variants (like C99) and Pascal.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 3 15:41:09 PST 2015

jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

If we really can't tell whether a symbol is CPP or Pascal based on the name, then GetLanguageForSymbolByName should be reworked to take a std::vector& in which to return the "possible" language types.  Then for Pascal or C++ symbols it should return "Pascal or CPP".  Then the rest of the breakpoint filtering would pass the symbol if the requested language was one of the return values in the vector.  It would mean "breakpoint set -l pascal/c++" will not limit the breakpoint to only Pascal/C++ symbols, but to Pascal and C++.  But by definition we can't do any better here.

Alternatively, you could replace GetLanguageForSymbolByName with "GetLanguageForSymbolContext(SymbolContext &sc)" instead, and if there's more info in the Symbol Context that can help you figure out that it is Pascal then you could do a better job that way.  This function is currently only used to filter breakpoints, and it always has a SymbolContext, so that would also be appropriate.

Or do both...

Comment at: source/Breakpoint/BreakpointResolverName.cpp:297-302
@@ -295,2 +296,8 @@
+                        // Note: This code prevents us from being able to find symbols
+                        // like 'printf' if the target language's option is set.  It
+                        // would be better to limit this filtering to only when the
+                        // breakpoint's language option is set (and not the target's),
+                        // but we can't know if m_language was set from the target or
+                        // breakpoint option.
                         remove_it = true;
Maybe it is not appropriate to use Target::GetLanguage to prime the breakpoint language (in the Target::CreateBreakpoint* routines.)  I was never really clear what the target level language setting was for.  But if it isn't appropriate to seed the breakpoint language with the target language, I'm fine with the breakpoint language defaulting to eLanguageTypeAny and then you will only get breakpoint language filtering if you call it out explicitly.



More information about the lldb-commits mailing list