[Lldb-commits] [lldb] [lldb][Expression] Reject languages not supported by TypeSystems for expression evaluation (PR #156648)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 3 12:04:28 PDT 2025


================
@@ -44,18 +44,21 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue(
   const int short_option = GetDefinitions()[option_idx].short_option;
 
   switch (short_option) {
-  case 'l':
+  case 'l': {
     language = Language::GetLanguageTypeFromString(option_arg);
-    if (language == eLanguageTypeUnknown) {
+
+    if (const LanguageSet supported_languages =
+            Language::GetLanguagesSupportingTypeSystemsForExpressions();
+        !supported_languages[language]) {
       StreamString sstr;
-      sstr.Printf("unknown language type: '%s' for expression. "
+      sstr.Printf("invalid language '%s' for expression. "
----------------
Michael137 wrote:

done in latest commit

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


More information about the lldb-commits mailing list