[Lldb-commits] [lldb] [lldb] Suppress unsupported language warning for assembly (PR #95871)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 17 18:01:18 PDT 2024
https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/95871
>From 7956f02f180d9e7593e2ddaa2ed376ec926a6825 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Mon, 17 Jun 2024 17:41:03 -0700
Subject: [PATCH 1/2] [lldb] Suppress unsupported language warning for assembly
#95871
The following warning is technically correct, but pretty much useless,
since there aren't any frame variables that we'd expect the debugger to
understand.
> This version of LLDB has no plugin for the language "assembler".
> Inspection of frame variables will be limited.
This message is useful in the general case but should be suppressed for
the "assembler" case.
rdar://92745462
---
lldb/source/Target/Process.cpp | 4 +++-
lldb/test/Shell/Process/UnsupportedLanguage.test | 15 ++++++++++++---
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 1e321f8bde391..9b905663a2c32 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -5924,7 +5924,9 @@ void Process::PrintWarningUnsupportedLanguage(const SymbolContext &sc) {
if (!sc.module_sp)
return;
LanguageType language = sc.GetLanguage();
- if (language == eLanguageTypeUnknown)
+ if (language == eLanguageTypeUnknown ||
+ language == lldb::eLanguageTypeAssembly ||
+ language == lldb::eLanguageTypeMipsAssembler)
return;
LanguageSet plugins =
PluginManager::GetAllTypeSystemSupportedLanguagesForTypes();
diff --git a/lldb/test/Shell/Process/UnsupportedLanguage.test b/lldb/test/Shell/Process/UnsupportedLanguage.test
index 8cf0c048e366b..6490505033483 100644
--- a/lldb/test/Shell/Process/UnsupportedLanguage.test
+++ b/lldb/test/Shell/Process/UnsupportedLanguage.test
@@ -1,8 +1,17 @@
-Test warnings.
+Test unsupported language warning
+
REQUIRES: shell
+
RUN: %clang_host %S/Inputs/true.c -std=c99 -g -c -S -emit-llvm -o - \
RUN: | sed -e 's/DW_LANG_C99/DW_LANG_Mips_Assembler/g' >%t.ll
RUN: %clang_host %t.ll -g -o %t.exe
-RUN: %lldb -o "b main" -o r -o q -b %t.exe 2>&1 | FileCheck %s
+RUN: %lldb -o "b main" -o r -o q -b %t.exe 2>&1 | FileCheck %s --check-prefix ASM
+
+ASM-NOT: This version of LLDB has no plugin for the language "assembler"
+
+RUN: %clang_host %S/Inputs/true.c -std=c99 -g -c -S -emit-llvm -o - \
+RUN: | sed -e 's/DW_LANG_C99/DW_LANG_Cobol74/g' >%t.ll
+RUN: %clang_host %t.ll -g -o %t.exe
+RUN: %lldb -o "b main" -o r -o q -b %t.exe 2>&1 | FileCheck %s --check-prefix COBOL
-CHECK: This version of LLDB has no plugin for the language "assembler"
+COBOL-NOT: This version of LLDB has no plugin for the language "cobol"
>From b744ed0799cc01de5da3ab07c0166c98d4fd0848 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Mon, 17 Jun 2024 18:01:04 -0700
Subject: [PATCH 2/2] Fix test
---
lldb/test/Shell/Process/UnsupportedLanguage.test | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/test/Shell/Process/UnsupportedLanguage.test b/lldb/test/Shell/Process/UnsupportedLanguage.test
index 6490505033483..d7e6e5de77512 100644
--- a/lldb/test/Shell/Process/UnsupportedLanguage.test
+++ b/lldb/test/Shell/Process/UnsupportedLanguage.test
@@ -14,4 +14,4 @@ RUN: | sed -e 's/DW_LANG_C99/DW_LANG_Cobol74/g' >%t.ll
RUN: %clang_host %t.ll -g -o %t.exe
RUN: %lldb -o "b main" -o r -o q -b %t.exe 2>&1 | FileCheck %s --check-prefix COBOL
-COBOL-NOT: This version of LLDB has no plugin for the language "cobol"
+COBOL: This version of LLDB has no plugin for the language "cobol74"
More information about the lldb-commits
mailing list