[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
https://github.com/DrSergei created
https://github.com/llvm/llvm-project/pull/171854
This patch introduces general summary provider for `std::string_view` and
simial types. I tried to remove copy-paste between different stl
implementations. I cannot check now how it works on Windows machine, but I hope
it works as expected (I used msvc stl implementation as a base).
>From ef8a0e118f394df64e14d4f399ce1246d5ab53f7 Mon Sep 17 00:00:00 2001
From: Druzhkov Sergei
Date: Thu, 11 Dec 2025 18:19:30 +0300
Subject: [PATCH] [lldb] Add generic string view summary provider
---
.../Plugins/Language/CPlusPlus/CMakeLists.txt | 1 +
.../Language/CPlusPlus/CPlusPlusLanguage.cpp | 95 +++--
.../Plugins/Language/CPlusPlus/Generic.h | 8 ++
.../Language/CPlusPlus/GenericStringView.cpp | 131 ++
.../Plugins/Language/CPlusPlus/LibCxx.cpp | 96 +
.../Plugins/Language/CPlusPlus/LibCxx.h | 16 ---
.../Plugins/Language/CPlusPlus/MsvcStl.cpp| 63 -
.../Plugins/Language/CPlusPlus/MsvcStl.h | 9 --
.../TestDataFormatterStdStringView.py | 5 +
.../TestDataFormatterStdU8StringView.py | 2 -
10 files changed, 196 insertions(+), 230 deletions(-)
create mode 100644 lldb/source/Plugins/Language/CPlusPlus/GenericStringView.cpp
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
index c52d3bdb31284..940737068fd47 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
+++ b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
@@ -17,6 +17,7 @@ add_lldb_library(lldbPluginCPlusPlusLanguage PLUGIN
GenericInitializerList.cpp
GenericList.cpp
GenericOptional.cpp
+ GenericStringView.cpp
LibCxx.cpp
LibCxxAtomic.cpp
LibCxxMap.cpp
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
index ae6086ff89d71..bd58abca7ab04 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -54,6 +54,8 @@ using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::formatters;
+using StringElementType = StringPrinter::StringElementType;
+
LLDB_PLUGIN_DEFINE(CPlusPlusLanguage)
void CPlusPlusLanguage::Initialize() {
@@ -799,42 +801,47 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP
cpp_category_sp) {
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderASCII,
+GenericStringViewSummaryProvider,
"std::string_view summary provider",
"^std::__[[:alnum:]]+::string_view$", stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderASCII,
+GenericStringViewSummaryProvider,
"std::string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderASCII,
+GenericStringViewSummaryProvider,
"std::string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderUTF16,
+GenericStringViewSummaryProvider,
+"std::u8string_view summary provider",
+"^std::__[[:alnum:]]+::basic_string_view >$",
+stl_summary_flags, true);
+
+ AddCXXSummary(cpp_category_sp,
+GenericStringViewSummaryProvider,
"std::u16string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderUTF32,
+GenericStringViewSummaryProvider,
"std::u32string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
- AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxWStringViewSummaryProvider,
+ AddCXXSummary(cpp_category_sp, GenericWStringViewSummaryProvider,
"std::wstring_view summary provider",
"^std::__[[:alnum:]]+::wstring_view$", stl_summary_flags,
true);
- AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxWStringViewSummaryProvider,
+ AddCXXSummary(cpp_category_sp, GenericWStringViewSummaryProvider,
"std::wstring_view summary provider",
"^std::__[[:alnum:]]+
[Lldb-commits] [lldb] 98aa840 - [lldb][Formatters] Simplify std::list libc++ formatter matching regex (#147709)
Author: Michael Buch
Date: 2025-12-11T17:25:56Z
New Revision: 98aa84075d3d2eeea4296d1e1a69c23db70edab2
URL:
https://github.com/llvm/llvm-project/commit/98aa84075d3d2eeea4296d1e1a69c23db70edab2
DIFF:
https://github.com/llvm/llvm-project/commit/98aa84075d3d2eeea4296d1e1a69c23db70edab2.diff
LOG: [lldb][Formatters] Simplify std::list libc++ formatter matching regex
(#147709)
The history on this is a bit confusing. The libc++ regexes were adjusted
in https://reviews.llvm.org/D57466, and so did the order in which we
load the formatters. Then https://reviews.llvm.org/D66398 changed the
`std::list` regex, to make sure the libc++ formatters don't match the
`cxx11` libstdc++ [Dual ABI
namespace](https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html).
But we changed the order in which we load the formatters again in
https://github.com/llvm/llvm-project/pull/140727. The intention there
was to load libstdc++ first, because it may have inline namespaces that
would match relaxed the libc++ regexes. So that should technically make
this complicated regex workaround obsolete.
I didn't quite follow the entire thread in D66398 because some of the
links are dead. So it's possible something does rely on this. I'd like
to remove it and see. I *think* this should be resolved now by virtue of
how we load the formatters, but if it does break someone, there ought to
be a better solution (as Pavel hinted at in D66398).
Added:
Modified:
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
Removed:
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
index ae6086ff89d71..dd3b84e47dec3 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -880,11 +880,7 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP
cpp_category_sp) {
AddCXXSynthetic(
cpp_category_sp,
lldb_private::formatters::LibcxxStdListSyntheticFrontEndCreator,
- "libc++ std::list synthetic children",
- // A POSIX variant of: "^std::__(?!cxx11:)[[:alnum:]]+::list<.+>$"
- // so that it does not clash with: "^std::(__cxx11::)?list<.+>$"
- "^std::__([A-Zabd-z0-9]|cx?[A-Za-wyz0-9]|cxx1?[A-Za-z02-9]|"
- "cxx11[[:alnum:]])[[:alnum:]]*::list<.+>$",
+ "libc++ std::list synthetic children", "^std::__[[:alnum:]]+::list<.+>$",
stl_deref_flags, true);
AddCXXSynthetic(
cpp_category_sp,
@@ -1006,14 +1002,10 @@ static void
LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider,
"libc++ std::list summary provider",
"^std::__[[:alnum:]]+::forward_list<.+>$", stl_summary_flags, true);
- AddCXXSummary(
- cpp_category_sp, lldb_private::formatters::ContainerSizeSummaryProvider,
- "libc++ std::list summary provider",
- // A POSIX variant of: "^std::__(?!cxx11:)[[:alnum:]]+::list<.+>$"
- // so that it does not clash with: "^std::(__cxx11::)?list<.+>$"
- "^std::__([A-Zabd-z0-9]|cx?[A-Za-wyz0-9]|cxx1?[A-Za-z02-9]|"
- "cxx11[[:alnum:]])[[:alnum:]]*::list<.+>$",
- stl_summary_flags, true);
+ AddCXXSummary(cpp_category_sp,
+lldb_private::formatters::ContainerSizeSummaryProvider,
+"libc++ std::list summary provider",
+"^std::__[[:alnum:]]+::list<.+>$", stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
lldb_private::formatters::ContainerSizeSummaryProvider,
"libc++ std::map summary provider",
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Formatters] Simplify std::list libc++ formatter matching regex (PR #147709)
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/147709 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 1b7f272 - [lldb][Module] Only log SDK search error once per debugger session (#171820)
Author: Michael Buch
Date: 2025-12-11T17:25:45Z
New Revision: 1b7f272906dee31d505ed74e0514d2c04c1b5f97
URL:
https://github.com/llvm/llvm-project/commit/1b7f272906dee31d505ed74e0514d2c04c1b5f97
DIFF:
https://github.com/llvm/llvm-project/commit/1b7f272906dee31d505ed74e0514d2c04c1b5f97.diff
LOG: [lldb][Module] Only log SDK search error once per debugger session
(#171820)
Currently if we are debugging an app that was compiled against an SDK
that we don't know about on the host, then every time we evaluate an
expression we get following spam on the console:
```
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
error: Error while searching for Xcode SDK: Unrecognized SDK type:
```
It is not a fatal error but the way we spam it pretty much ruins the
debugging experience.
This patch makes it so we only log this error once per debugger session.
Not sure how to best test it since we'd need to build a program with a
particular SDK and then make it unrecognized by LLDB. Confirmed manually
that the error only gets reported once after this patch.
Added:
Modified:
lldb/source/Core/Module.cpp
Removed:
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index da2c188899f03..3580918980bbd 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1569,7 +1569,9 @@ void Module::RegisterXcodeSDK(llvm::StringRef sdk_name,
if (!sdk_path_or_err) {
Debugger::ReportError("Error while searching for Xcode SDK: " +
- toString(sdk_path_or_err.takeError()));
+ toString(sdk_path_or_err.takeError()),
+ /*debugger_id=*/std::nullopt,
+ GetDiagnosticOnceFlag(sdk_name));
return;
}
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Module] Only log SDK search error once per debugger session (PR #171820)
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/171820 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
https://github.com/DrSergei updated
https://github.com/llvm/llvm-project/pull/171854
>From ef8a0e118f394df64e14d4f399ce1246d5ab53f7 Mon Sep 17 00:00:00 2001
From: Druzhkov Sergei
Date: Thu, 11 Dec 2025 18:19:30 +0300
Subject: [PATCH 1/3] [lldb] Add generic string view summary provider
---
.../Plugins/Language/CPlusPlus/CMakeLists.txt | 1 +
.../Language/CPlusPlus/CPlusPlusLanguage.cpp | 95 +++--
.../Plugins/Language/CPlusPlus/Generic.h | 8 ++
.../Language/CPlusPlus/GenericStringView.cpp | 131 ++
.../Plugins/Language/CPlusPlus/LibCxx.cpp | 96 +
.../Plugins/Language/CPlusPlus/LibCxx.h | 16 ---
.../Plugins/Language/CPlusPlus/MsvcStl.cpp| 63 -
.../Plugins/Language/CPlusPlus/MsvcStl.h | 9 --
.../TestDataFormatterStdStringView.py | 5 +
.../TestDataFormatterStdU8StringView.py | 2 -
10 files changed, 196 insertions(+), 230 deletions(-)
create mode 100644 lldb/source/Plugins/Language/CPlusPlus/GenericStringView.cpp
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
index c52d3bdb31284..940737068fd47 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
+++ b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
@@ -17,6 +17,7 @@ add_lldb_library(lldbPluginCPlusPlusLanguage PLUGIN
GenericInitializerList.cpp
GenericList.cpp
GenericOptional.cpp
+ GenericStringView.cpp
LibCxx.cpp
LibCxxAtomic.cpp
LibCxxMap.cpp
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
index ae6086ff89d71..bd58abca7ab04 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -54,6 +54,8 @@ using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::formatters;
+using StringElementType = StringPrinter::StringElementType;
+
LLDB_PLUGIN_DEFINE(CPlusPlusLanguage)
void CPlusPlusLanguage::Initialize() {
@@ -799,42 +801,47 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP
cpp_category_sp) {
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderASCII,
+GenericStringViewSummaryProvider,
"std::string_view summary provider",
"^std::__[[:alnum:]]+::string_view$", stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderASCII,
+GenericStringViewSummaryProvider,
"std::string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderASCII,
+GenericStringViewSummaryProvider,
"std::string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderUTF16,
+GenericStringViewSummaryProvider,
+"std::u8string_view summary provider",
+"^std::__[[:alnum:]]+::basic_string_view >$",
+stl_summary_flags, true);
+
+ AddCXXSummary(cpp_category_sp,
+GenericStringViewSummaryProvider,
"std::u16string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderUTF32,
+GenericStringViewSummaryProvider,
"std::u32string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
- AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxWStringViewSummaryProvider,
+ AddCXXSummary(cpp_category_sp, GenericWStringViewSummaryProvider,
"std::wstring_view summary provider",
"^std::__[[:alnum:]]+::wstring_view$", stl_summary_flags,
true);
- AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxWStringViewSummaryProvider,
+ AddCXXSummary(cpp_category_sp, GenericWStringViewSummaryProvider,
"std::wstring_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
@@ -1696,8 +1703,6 @@ static void
LoadCommonStlFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(
false);
- using StringElementType = StringPrinter::StringElementTyp
[Lldb-commits] [lldb] [llvm] [lldb] Add WebAssembly platform (PR #171507)
https://github.com/adrian-prantl approved this pull request. https://github.com/llvm/llvm-project/pull/171507 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Run MSVC variant test with PDB (PR #171858)
https://github.com/Nerixyz created
https://github.com/llvm/llvm-project/pull/171858
Split off from #171489. This only adds the lookup of the active type for a
`std::variant` based on the head type (since PDB doesn't have template info).
>From dc76f82f9b3356aac7299f1cb6e2ad77e59b53c9 Mon Sep 17 00:00:00 2001
From: Nerixyz
Date: Thu, 11 Dec 2025 16:59:48 +0100
Subject: [PATCH] [LLDB] Run MSVC variant test with PDB
---
.../Plugins/Language/CPlusPlus/MsvcStlVariant.cpp | 10 --
.../generic/variant/TestDataFormatterStdVariant.py | 2 ++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlVariant.cpp
b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlVariant.cpp
index 52a3d98d2af4b..ecf4a3220cd9f 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlVariant.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlVariant.cpp
@@ -119,8 +119,14 @@ bool formatters::MsvcStlVariantSummaryProvider(
storage_type = storage_type.GetTypedefedType();
CompilerType active_type = storage_type.GetTypeTemplateArgument(1, true);
- if (!active_type)
-return false;
+ if (!active_type) {
+// PDB: get the type from the head as we don't have template arguments
+// there.
+ValueObjectSP head = GetHead(*storage);
+active_type = head->GetCompilerType();
+if (!active_type)
+ return false;
+ }
stream << " Active Type = " << active_type.GetDisplayTypeName() << " ";
return true;
diff --git
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/variant/TestDataFormatterStdVariant.py
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/variant/TestDataFormatterStdVariant.py
index 9f32ad97c1f0a..1ae07a91dfe3d 100644
---
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/variant/TestDataFormatterStdVariant.py
+++
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/variant/TestDataFormatterStdVariant.py
@@ -9,6 +9,8 @@
class StdVariantDataFormatterTestCase(TestBase):
+TEST_WITH_PDB_DEBUG_INFO = True
+
def do_test(self):
"""Test that that file and class static variables display correctly."""
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
https://github.com/Michael137 requested changes to this pull request. Thanks for the patch. I'm all in favour of de-duplicating the formatter code, but I'd prefer it if we kept the individual SummaryProvider's per STL. I.e., the code that extracts the data and size from the type should live in the individual STL files. But the code that then formats the strings can be generic. Is that feasible? https://github.com/llvm/llvm-project/pull/171854 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/171854 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/171854 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Run MSVC variant test with PDB (PR #171858)
@@ -119,8 +119,14 @@ bool formatters::MsvcStlVariantSummaryProvider(
storage_type = storage_type.GetTypedefedType();
CompilerType active_type = storage_type.GetTypeTemplateArgument(1, true);
- if (!active_type)
-return false;
+ if (!active_type) {
+// PDB: get the type from the head as we don't have template arguments
+// there.
+ValueObjectSP head = GetHead(*storage);
Michael137 wrote:
Do we need a `nullcheck` on `head` here?
https://github.com/llvm/llvm-project/pull/171858
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Run MSVC variant test with PDB (PR #171858)
https://github.com/Michael137 approved this pull request. LGTM (module comment) https://github.com/llvm/llvm-project/pull/171858 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
@@ -0,0 +1,131 @@
+//===-- GenericStringView.cpp ===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===-===//
+
+#include "Generic.h"
+#include "LibCxx.h"
+
+#include "lldb/ValueObject/ValueObject.h"
+#include "lldb/lldb-forward.h"
+
+#include "Plugins/Language/CPlusPlus/CxxStringTypes.h"
+#include
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace lldb_private::formatters;
+
+using StringElementType = StringPrinter::StringElementType;
+
+enum class StlType {
+ LibCxx,
+ LibStdcpp,
+ MsvcStl,
+};
+
+std::tuple
+extractStringViewData(ValueObject &valobj) {
+ auto data_sp = valobj.GetChildMemberWithName("_Mydata");
+ if (data_sp)
+return std::make_tuple(StlType::MsvcStl, data_sp,
+ valobj.GetChildMemberWithName("_Mysize"));
+ data_sp = valobj.GetChildMemberWithName("_M_str");
+ if (data_sp)
+return std::make_tuple(StlType::LibStdcpp, data_sp,
+ valobj.GetChildMemberWithName("_M_len"));
+ return std::make_tuple(
+ StlType::LibCxx,
+ GetChildMemberWithName(valobj,
+ {ConstString("__data_"), ConstString("__data")}),
+ GetChildMemberWithName(valobj,
+ {ConstString("__size_"), ConstString("__size")}));
+}
+
+template
+static bool formatStringViewImpl(lldb::ValueObjectSP data_sp,
+ lldb::ValueObjectSP size_sp, Stream &stream,
+ const TypeSummaryOptions &summary_options,
+ std::string prefix_token) {
+ if (!data_sp || !size_sp)
+return false;
+
+ bool success = false;
+ uint64_t size = size_sp->GetValueAsUnsigned(0, &success);
+ if (!success) {
+stream << "Summary Unavailable";
+return true;
+ }
+
+ StreamString scratch_stream;
+ success = StringBufferSummaryProvider(
+ scratch_stream, summary_options, data_sp, size, prefix_token);
+
+ if (success)
+stream << scratch_stream.GetData();
+ else
+stream << "Summary Unavailable";
+ return true;
+}
+
+template
+static constexpr const char *getPrefixToken() {
+ if constexpr (element_type == StringElementType::ASCII)
+return "";
+ if constexpr (element_type == StringElementType::UTF8)
+return "u8";
+ if constexpr (element_type == StringElementType::UTF16)
+return "u";
+ if constexpr (element_type == StringElementType::UTF32)
+return "U";
+ llvm_unreachable("invalid element type");
+}
+
+template
+bool lldb_private::formatters::GenericStringViewSummaryProvider(
+ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
+ auto [_, data_sp, size_sp] = extractStringViewData(valobj);
+ return formatStringViewImpl(data_sp, size_sp, stream, options,
+getPrefixToken());
+}
+
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::ASCII>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::UTF8>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::UTF16>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::UTF32>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+
+bool lldb_private::formatters::GenericWStringViewSummaryProvider(
+ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
+ auto [stl, data_sp, size_sp] = extractStringViewData(valobj);
+ if (stl == StlType::LibStdcpp)
+return formatStringViewImpl(data_sp, size_sp,
+ stream, options,
"L");
Nerixyz wrote:
Is this always the case in libstdc++? On MinGW, it's UTF16 as well, since
that's the size of `wchar_t`. The following compiles without errors on MinGW:
```cpp
#include
int main() {
static_assert(std::is_same_v);
static_assert(sizeof(wchar_t) == 2);
return 0;
}
```
https://github.com/llvm/llvm-project/pull/171854
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Run MSVC variant test with PDB (PR #171858)
https://github.com/Nerixyz updated
https://github.com/llvm/llvm-project/pull/171858
Unicorn! · GitHub
body {
background-color: #f1f1f1;
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.container { margin: 50px auto 40px auto; width: 600px; text-align:
center; }
a { color: #4183c4; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { letter-spacing: -1px; line-height: 60px; font-size: 60px;
font-weight: 100; margin: 0px; text-shadow: 0 1px 0 #fff; }
p { color: rgba(0, 0, 0, 0.5); margin: 10px 0 10px; font-size: 18px;
font-weight: 200; line-height: 1.6em;}
ul { list-style: none; margin: 25px 0; padding: 0; }
li { display: table-cell; font-weight: bold; width: 1%; }
.logo { display: inline-block; margin-top: 35px; }
.logo-img-2x { display: none; }
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
}
#suggestions {
margin-top: 35px;
color: #ccc;
}
#suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
}
No server is currently available to service your
request.
Sorry about that. Please try refreshing and contact us if the problem
persists.
https://github.com/contact";>Contact Support —
https://www.githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] improve the heuristics for checking if a terminal supports Unicode (PR #171832)
@@ -400,6 +400,22 @@ llvm::Error Terminal::SetHardwareFlowControl(bool enabled)
{
#endif // LLDB_ENABLE_TERMIOS
}
+bool Terminal::SupportsUnicode() {
+ static std::optional g_result;
slydiman wrote:
It seems you don't need g_result on Windows at all. Just move it after #else
https://github.com/llvm/llvm-project/pull/171832
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Formatters] Simplify std::list libc++ formatter matching regex (PR #147709)
https://github.com/adrian-prantl approved this pull request. https://github.com/llvm/llvm-project/pull/147709 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Module] Only log SDK search error once per debugger session (PR #171820)
https://github.com/adrian-prantl approved this pull request. https://github.com/llvm/llvm-project/pull/171820 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
llvmbot wrote:
@llvm/pr-subscribers-lldb
Author: Sergei Druzhkov (DrSergei)
Changes
This patch introduces general summary provider for `std::string_view` and
simial types. I tried to remove copy-paste between different stl
implementations. I cannot check now how it works on Windows machine, but I hope
it works as expected (I used msvc stl implementation as a base).
---
Patch is 27.42 KiB, truncated to 20.00 KiB below, full version:
https://github.com/llvm/llvm-project/pull/171854.diff
10 Files Affected:
- (modified) lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt (+1)
- (modified) lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
(+49-46)
- (modified) lldb/source/Plugins/Language/CPlusPlus/Generic.h (+8)
- (added) lldb/source/Plugins/Language/CPlusPlus/GenericStringView.cpp (+131)
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp (+2-94)
- (modified) lldb/source/Plugins/Language/CPlusPlus/LibCxx.h (-16)
- (modified) lldb/source/Plugins/Language/CPlusPlus/MsvcStl.cpp (-63)
- (modified) lldb/source/Plugins/Language/CPlusPlus/MsvcStl.h (-9)
- (modified)
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/string_view/TestDataFormatterStdStringView.py
(+5)
- (modified)
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/u8string_view/TestDataFormatterStdU8StringView.py
(-2)
``diff
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
index c52d3bdb31284..940737068fd47 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
+++ b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
@@ -17,6 +17,7 @@ add_lldb_library(lldbPluginCPlusPlusLanguage PLUGIN
GenericInitializerList.cpp
GenericList.cpp
GenericOptional.cpp
+ GenericStringView.cpp
LibCxx.cpp
LibCxxAtomic.cpp
LibCxxMap.cpp
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
index ae6086ff89d71..bd58abca7ab04 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -54,6 +54,8 @@ using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::formatters;
+using StringElementType = StringPrinter::StringElementType;
+
LLDB_PLUGIN_DEFINE(CPlusPlusLanguage)
void CPlusPlusLanguage::Initialize() {
@@ -799,42 +801,47 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP
cpp_category_sp) {
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderASCII,
+GenericStringViewSummaryProvider,
"std::string_view summary provider",
"^std::__[[:alnum:]]+::string_view$", stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderASCII,
+GenericStringViewSummaryProvider,
"std::string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderASCII,
+GenericStringViewSummaryProvider,
"std::string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderUTF16,
+GenericStringViewSummaryProvider,
+"std::u8string_view summary provider",
+"^std::__[[:alnum:]]+::basic_string_view >$",
+stl_summary_flags, true);
+
+ AddCXXSummary(cpp_category_sp,
+GenericStringViewSummaryProvider,
"std::u16string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxStringViewSummaryProviderUTF32,
+GenericStringViewSummaryProvider,
"std::u32string_view summary provider",
"^std::__[[:alnum:]]+::basic_string_view >$",
stl_summary_flags, true);
- AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxWStringViewSummaryProvider,
+ AddCXXSummary(cpp_category_sp, GenericWStringViewSummaryProvider,
"std::wstring_view summary provider",
"^std::__[[:alnum:]]+::wstring_view$", stl_summary_flags,
true);
- AddCXXSummary(cpp_category_sp,
-lldb_private::formatters::LibcxxWStringViewSummaryProvider,
+ AddCXXSummary(cpp_category_sp, GenericWStringViewSummaryProvider,
[Lldb-commits] [lldb] [LLDB] Run MSVC variant test with PDB (PR #171858)
llvmbot wrote:
@llvm/pr-subscribers-lldb
Author: nerix (Nerixyz)
Changes
Split off from #171489. This only adds the lookup of the active type
for a `std::variant` based on the head type (since PDB doesn't have template
info).
---
Full diff: https://github.com/llvm/llvm-project/pull/171858.diff
2 Files Affected:
- (modified) lldb/source/Plugins/Language/CPlusPlus/MsvcStlVariant.cpp (+10-2)
- (modified)
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/variant/TestDataFormatterStdVariant.py
(+2)
``diff
diff --git a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlVariant.cpp
b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlVariant.cpp
index 52a3d98d2af4b..3e7647be48bb0 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/MsvcStlVariant.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/MsvcStlVariant.cpp
@@ -119,8 +119,16 @@ bool formatters::MsvcStlVariantSummaryProvider(
storage_type = storage_type.GetTypedefedType();
CompilerType active_type = storage_type.GetTypeTemplateArgument(1, true);
- if (!active_type)
-return false;
+ if (!active_type) {
+// PDB: get the type from the head as we don't have template arguments
+// there.
+ValueObjectSP head = GetHead(*storage);
+if (!head)
+ return false;
+active_type = head->GetCompilerType();
+if (!active_type)
+ return false;
+ }
stream << " Active Type = " << active_type.GetDisplayTypeName() << " ";
return true;
diff --git
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/variant/TestDataFormatterStdVariant.py
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/variant/TestDataFormatterStdVariant.py
index 9f32ad97c1f0a..1ae07a91dfe3d 100644
---
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/variant/TestDataFormatterStdVariant.py
+++
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/variant/TestDataFormatterStdVariant.py
@@ -9,6 +9,8 @@
class StdVariantDataFormatterTestCase(TestBase):
+TEST_WITH_PDB_DEBUG_INFO = True
+
def do_test(self):
"""Test that that file and class static variables display correctly."""
``
https://github.com/llvm/llvm-project/pull/171858
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] [lldb] Add WebAssembly platform (PR #171507)
https://github.com/JDevlieghere updated
https://github.com/llvm/llvm-project/pull/171507
>From 417bf4882e9a6be920e6a728e5de1d62eedc9e38 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere
Date: Mon, 8 Dec 2025 17:01:18 -0800
Subject: [PATCH 1/4] [lldb] Add WebAssembly platform
This PR adds a platform for WebAssembly. Inspired by QemuUser, the
platform lets you configure a WebAssembly runtime to run a Wasm binary.
For example, the following configuration can be used to launch binaries
under the WebAssembly Micro Runtime (WARM):
```
settings set -- platform.plugin.wasm.runtime-args --heap-size=1048576
settings set -- platform.plugin.wasm.port-arg -g=127.0.0.1:
settings set -- platform.plugin.wasm.runtime-path /path/to/iwasm-2.4.0
```
---
lldb/source/Plugins/Platform/CMakeLists.txt | 1 +
.../Platform/WebAssembly/CMakeLists.txt | 23 ++
.../Platform/WebAssembly/PlatformWasm.cpp | 197 ++
.../Platform/WebAssembly/PlatformWasm.h | 79 +++
.../WebAssembly/PlatformWasmProperties.td | 21 ++
5 files changed, 321 insertions(+)
create mode 100644 lldb/source/Plugins/Platform/WebAssembly/CMakeLists.txt
create mode 100644 lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
create mode 100644 lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.h
create mode 100644
lldb/source/Plugins/Platform/WebAssembly/PlatformWasmProperties.td
diff --git a/lldb/source/Plugins/Platform/CMakeLists.txt
b/lldb/source/Plugins/Platform/CMakeLists.txt
index f4753ab47ce11..cc1432aa4754b 100644
--- a/lldb/source/Plugins/Platform/CMakeLists.txt
+++ b/lldb/source/Plugins/Platform/CMakeLists.txt
@@ -15,4 +15,5 @@ add_subdirectory(NetBSD)
add_subdirectory(OpenBSD)
add_subdirectory(POSIX)
add_subdirectory(QemuUser)
+add_subdirectory(WebAssembly)
add_subdirectory(Windows)
diff --git a/lldb/source/Plugins/Platform/WebAssembly/CMakeLists.txt
b/lldb/source/Plugins/Platform/WebAssembly/CMakeLists.txt
new file mode 100644
index 0..7fb17b295fbb8
--- /dev/null
+++ b/lldb/source/Plugins/Platform/WebAssembly/CMakeLists.txt
@@ -0,0 +1,23 @@
+lldb_tablegen(PlatformWasmProperties.inc -gen-lldb-property-defs
+ SOURCE PlatformWasmProperties.td
+ TARGET LLDBPluginPlatformWasmPropertiesGen)
+
+lldb_tablegen(PlatformWasmPropertiesEnum.inc -gen-lldb-property-enum-defs
+ SOURCE PlatformWasmProperties.td
+ TARGET LLDBPluginPlatformWasmPropertiesEnumGen)
+
+add_lldb_library(lldbPluginPlatformWasm PLUGIN
+ PlatformWasm.cpp
+
+ LINK_LIBS
+lldbCore
+lldbHost
+lldbTarget
+lldbUtility
+ LINK_COMPONENTS
+Support
+ )
+
+add_dependencies(lldbPluginPlatformWasm
+ LLDBPluginPlatformWasmPropertiesGen
+ LLDBPluginPlatformWasmPropertiesEnumGen)
diff --git a/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
b/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
new file mode 100644
index 0..fc00db50ffc0c
--- /dev/null
+++ b/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
@@ -0,0 +1,197 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "Plugins/Platform/WebAssembly/PlatformWasm.h"
+#include "Plugins/Process/wasm/ProcessWasm.h"
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Host/FileSystem.h"
+#include "lldb/Host/ProcessLaunchInfo.h"
+#include "lldb/Host/common/TCPSocket.h"
+#include "lldb/Interpreter/OptionValueProperties.h"
+#include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
+#include "lldb/Utility/LLDBLog.h"
+#include "lldb/Utility/Listener.h"
+#include "lldb/Utility/Log.h"
+#include "llvm/ADT/StringExtras.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+LLDB_PLUGIN_DEFINE(PlatformWasm)
+
+namespace {
+#define LLDB_PROPERTIES_platformwasm
+#include "PlatformWasmProperties.inc"
+
+enum {
+#define LLDB_PROPERTIES_platformwasm
+#include "PlatformWasmPropertiesEnum.inc"
+};
+
+class PluginProperties : public Properties {
+public:
+ PluginProperties() {
+m_collection_sp = std::make_shared(
+PlatformWasm::GetPluginNameStatic());
+m_collection_sp->Initialize(g_platformwasm_properties);
+ }
+
+ FileSpec GetRuntimePath() const {
+return GetPropertyAtIndexAs(ePropertyRuntimePath, {});
+ }
+
+ Args GetRuntimeArgs() const {
+Args result;
+m_collection_sp->GetPropertyAtIndexAsArgs(ePropertyRuntimeArgs, result);
+return result;
+ }
+
+ llvm::StringRef GetPortArg() const {
+return GetPropertyAtIndexAs(ePropertyPortArg, {});
+ }
+};
+
+} // namespace
+
+static PluginProperties &GetGlobalProperties() {
+ static PluginProperties g_settings;
+ return g_settings;
+}
+
+llvm::StringRef PlatformWasm::GetPluginDescriptionStatic() {
+ return
[Lldb-commits] [lldb] 7fdf800 - [LLDB] Run MSVC variant test with PDB (#171858)
Author: nerix
Date: 2025-12-11T18:03:42+01:00
New Revision: 7fdf800a91a37dc915fec2cca2d8539ec5070d8a
URL:
https://github.com/llvm/llvm-project/commit/7fdf800a91a37dc915fec2cca2d8539ec5070d8a
DIFF:
https://github.com/llvm/llvm-project/commit/7fdf800a91a37dc915fec2cca2d8539ec5070d8a.diff
LOG: [LLDB] Run MSVC variant test with PDB (#171858)
Split off from #171489. This only adds the lookup of the active type for
a `std::variant` based on the head type (since PDB doesn't have template
info).
Added:
Modified:
lldb/source/Plugins/Language/CPlusPlus/MsvcStlVariant.cpp
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/variant/TestDataFormatterStdVariant.py
Removed:
Unicorn! · GitHub
body {
background-color: #f1f1f1;
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.container { margin: 50px auto 40px auto; width: 600px; text-align:
center; }
a { color: #4183c4; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { letter-spacing: -1px; line-height: 60px; font-size: 60px;
font-weight: 100; margin: 0px; text-shadow: 0 1px 0 #fff; }
p { color: rgba(0, 0, 0, 0.5); margin: 10px 0 10px; font-size: 18px;
font-weight: 200; line-height: 1.6em;}
ul { list-style: none; margin: 25px 0; padding: 0; }
li { display: table-cell; font-weight: bold; width: 1%; }
.logo { display: inline-block; margin-top: 35px; }
.logo-img-2x { display: none; }
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
}
#suggestions {
margin-top: 35px;
color: #ccc;
}
#suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
}
No server is currently available to service your
request.
Sorry about that. Please try refreshing and contact us if the problem
persists.
https://github.com/contact";>Contact Support —
https://www.githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Run MSVC variant test with PDB (PR #171858)
https://github.com/Nerixyz closed https://github.com/llvm/llvm-project/pull/171858 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][NFC] Change ObjectFile argument type (PR #171574)
https://github.com/JDevlieghere approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/171574 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Correct use_editline check in IOHandlerEditline (PR #171733)
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/171733 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Correct use_editline check in IOHandlerEditline (PR #171733)
@@ -245,8 +245,10 @@ IOHandlerEditline::IOHandlerEditline( SetPrompt(prompt); #if LLDB_ENABLE_LIBEDIT - const bool use_editline = m_input_sp && m_output_sp && m_error_sp && -m_input_sp->GetIsRealTerminal(); + const bool use_editline = + m_input_sp && m_input_sp->GetIsRealTerminal() && // Input + m_output_sp && m_output_sp->GetUnlockedFile().GetStream() && // Output + m_error_sp && m_error_sp->GetUnlockedFile().GetStream(); // Error DavidSpickett wrote: What does it mean to not be able to get a stream for a file? Does it mean that that is a file as in a file on disk, rather than an output channel into something like a terminal? Then I would understand this as use editline if: * the input is coming from a real terminal * the output and error are going to something we can stream to In other words, don't use editline if it's not interactive or we'd be writing to things which must be handled like files on disk. https://github.com/llvm/llvm-project/pull/171733 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Correct use_editline check in IOHandlerEditline (PR #171733)
https://github.com/DavidSpickett approved this pull request. I might have the details wrong but I see the overall idea. This LGTM as long as you add clarifying comments about what a file without a stream would actually represent. https://github.com/llvm/llvm-project/pull/171733 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix failing tests due to CI diagnostics rendering (PR #171685)
charles-zablit wrote: > Nothing changed > [lab.llvm.org/buildbot#/builders/197/builds/11757](https://lab.llvm.org/buildbot/#/builders/197/builds/11757) > > [lab.llvm.org/buildbot#/builders/211/builds/4494](https://lab.llvm.org/buildbot/#/builders/211/builds/4494) I reverted the changes. > Windows will not print unicode chars to stdout without a special system > settings. I don't think that's what's happening in the CI, because the logs do say: ``` # | :19:19: note: possible intended match here # | ╰─ error: use of undeclared identifier 'a' ``` https://github.com/llvm/llvm-project/pull/171685 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add WebAssembly platform (PR #171507)
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/171507 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add WebAssembly platform (PR #171507)
@@ -0,0 +1,19 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "platformwasm" in {
+ def RuntimePath : Property<"runtime-path", "FileSpec">,
+Global,
+DefaultStringValue<"">,
+Desc<"Path to the WebAssembly runtime binary.">;
+ def RuntimeArgs : Property<"runtime-args", "Args">,
+Global,
+DefaultStringValue<"">,
+Desc<"Extra arguments to pass to the WebAssembly
runtime.">;
+ def PortArg : Property<"port-arg", "String">,
+Global,
+DefaultStringValue<"">,
+Desc<"Argument to the WebAssembly runtime to specify the "
+ "GDB remote port. The port number chosen by LLDB will be "
+ "concatenated to this argument. For example: "
+ "-g=127.0.0.1: or --debugger-port.">;
DavidSpickett wrote:
This is ok but the pedant in me wants to know whether this is an example of
what I should enter, or what I would expect lldb to produce from what I enter.
Also, `--debugger-port` presumably would need to be `--debugger-port ` with a
space, so it's probably a worse example to put here.
How about:
For example setting this to "-g=127.0.0.1:" will result in "-g127.0.0.1:".
https://github.com/llvm/llvm-project/pull/171507
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add WebAssembly platform (PR #171507)
@@ -0,0 +1,19 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "platformwasm" in {
+ def RuntimePath : Property<"runtime-path", "FileSpec">,
+Global,
+DefaultStringValue<"">,
+Desc<"Path to the WebAssembly runtime binary.">;
DavidSpickett wrote:
Will this get looked up on path?
I don't think you have to mention that here because many people will just put
`programname` anyway. But worth checking if it does use the PATH because that'd
be convenient.
https://github.com/llvm/llvm-project/pull/171507
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add WebAssembly platform (PR #171507)
@@ -0,0 +1,19 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "platformwasm" in {
+ def RuntimePath : Property<"runtime-path", "FileSpec">,
+Global,
+DefaultStringValue<"">,
+Desc<"Path to the WebAssembly runtime binary.">;
+ def RuntimeArgs : Property<"runtime-args", "Args">,
DavidSpickett wrote:
How do we order settings, if at all?
Wondering if this should be below PortArg because it's for everything but the
port. Also would be good to add a note like "(for port related arguments, use
port-arg instead)".
https://github.com/llvm/llvm-project/pull/171507
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add WebAssembly platform (PR #171507)
https://github.com/DavidSpickett approved this pull request. Pedantry on the settings text but otherwise LGTM. You may want to revise the existing release note for WASM debug. Perhaps adding to it "LLDB can also start a runtime for you...". https://github.com/llvm/llvm-project/pull/171507 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add WebAssembly platform (PR #171507)
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/171507 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add WebAssembly platform (PR #171507)
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/171507 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add WebAssembly platform (PR #171507)
@@ -0,0 +1,19 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "platformwasm" in {
+ def RuntimePath : Property<"runtime-path", "FileSpec">,
+Global,
+DefaultStringValue<"">,
+Desc<"Path to the WebAssembly runtime binary.">;
+ def RuntimeArgs : Property<"runtime-args", "Args">,
+Global,
+DefaultStringValue<"">,
+Desc<"Extra arguments to pass to the WebAssembly
runtime.">;
+ def PortArg : Property<"port-arg", "String">,
+Global,
+DefaultStringValue<"">,
+Desc<"Argument to the WebAssembly runtime to specify the "
+ "GDB remote port. The port number chosen by LLDB will be "
+ "concatenated to this argument. For example: "
+ "-g=127.0.0.1: or --debugger-port.">;
DavidSpickett wrote:
I suggested only keeping the `-g` example but now I realise because of the
space issue, `--debugger port ` is good to include.
https://github.com/llvm/llvm-project/pull/171507
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add WebAssembly platform (PR #171507)
@@ -0,0 +1,19 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "platformwasm" in {
+ def RuntimePath : Property<"runtime-path", "FileSpec">,
+Global,
+DefaultStringValue<"">,
+Desc<"Path to the WebAssembly runtime binary.">;
+ def RuntimeArgs : Property<"runtime-args", "Args">,
+Global,
+DefaultStringValue<"">,
+Desc<"Extra arguments to pass to the WebAssembly
runtime.">;
+ def PortArg : Property<"port-arg", "String">,
+Global,
+DefaultStringValue<"">,
+Desc<"Argument to the WebAssembly runtime to specify the "
+ "GDB remote port. The port number chosen by LLDB will be "
+ "concatenated to this argument. For example: "
+ "-g=127.0.0.1: or --debugger-port.">;
DavidSpickett wrote:
Also you should quote the arguments here somehow, especially the
`--debugger-port ` one. I know it won't format like Markdown but perhaps
backticks would look ok on the terminal still.
https://github.com/llvm/llvm-project/pull/171507
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Revert "[lldb] fix failing tests due to CI diagnostics rendering (PR #171791)
llvmbot wrote:
@llvm/pr-subscribers-lldb
Author: Charles Zablit (charles-zablit)
Changes
This patch reverts https://github.com/llvm/llvm-project/pull/171685 and
https://github.com/llvm/llvm-project/pull/171491, which introduces bot failures.
---
Full diff: https://github.com/llvm/llvm-project/pull/171791.diff
8 Files Affected:
- (modified) lldb/include/lldb/Host/Terminal.h (-12)
- (modified) lldb/include/lldb/Host/common/DiagnosticsRendering.h (+1-18)
- (modified) lldb/source/Host/common/DiagnosticsRendering.cpp (+6-5)
- (modified) lldb/source/Host/common/Terminal.cpp (-16)
- (modified) lldb/test/Shell/Commands/command-dwim-print.test (+3-3)
- (modified) lldb/test/Shell/Commands/command-expr-diagnostics.test (+5-5)
- (modified) lldb/test/Shell/Commands/command-options.test (+3-3)
- (modified) lldb/unittests/Host/common/DiagnosticsRenderingTest.cpp (+1-1)
``diff
diff --git a/lldb/include/lldb/Host/Terminal.h
b/lldb/include/lldb/Host/Terminal.h
index 3d66515c18812..da0d05e8bd265 100644
--- a/lldb/include/lldb/Host/Terminal.h
+++ b/lldb/include/lldb/Host/Terminal.h
@@ -68,18 +68,6 @@ class Terminal {
llvm::Error SetHardwareFlowControl(bool enabled);
- /// Returns whether or not the current terminal supports Unicode rendering.
- ///
- /// The value is cached after the first computation.
- ///
- /// On POSIX systems, we check if the LANG environment variable contains the
- /// substring "UTF-8", case insensitive.
- ///
- /// On Windows, we always return true since we use the `WriteConsoleW` API
- /// internally. Note that the default Windows codepage (437) does not support
- /// all Unicode characters. This function does not check the codepage.
- static bool SupportsUnicode();
-
protected:
struct Data;
diff --git a/lldb/include/lldb/Host/common/DiagnosticsRendering.h
b/lldb/include/lldb/Host/common/DiagnosticsRendering.h
index 3eea0647da37e..dd33d671c24a5 100644
--- a/lldb/include/lldb/Host/common/DiagnosticsRendering.h
+++ b/lldb/include/lldb/Host/common/DiagnosticsRendering.h
@@ -59,27 +59,10 @@ struct DiagnosticDetail {
StructuredData::ObjectSP Serialize(llvm::ArrayRef details);
-/// Renders an array of DiagnosticDetail instances.
-///
-/// \param[in] stream
-/// The stream to render the diagnostics to.
-/// \param offset_in_command
-/// An optional offset to the column position of the diagnostic in the
-/// source.
-/// \param show_inline
-/// Whether to show the diagnostics inline.
-/// \param details
-/// The array of DiagnosticsDetail to render.
-/// \param force_ascii
-/// Whether to force ascii rendering. If false, Unicode characters will be
-/// used if the output file supports them.
-///
-/// \see lldb_private::Terminal::SupportsUnicode
void RenderDiagnosticDetails(Stream &stream,
std::optional offset_in_command,
bool show_inline,
- llvm::ArrayRef details,
- bool force_ascii = false);
+ llvm::ArrayRef details);
class DiagnosticError
: public llvm::ErrorInfo {
diff --git a/lldb/source/Host/common/DiagnosticsRendering.cpp
b/lldb/source/Host/common/DiagnosticsRendering.cpp
index 2c9d33a6c325c..f2cd3968967fb 100644
--- a/lldb/source/Host/common/DiagnosticsRendering.cpp
+++ b/lldb/source/Host/common/DiagnosticsRendering.cpp
@@ -7,8 +7,6 @@
//===--===//
#include "lldb/Host/common/DiagnosticsRendering.h"
-#include "lldb/Host/Terminal.h"
-
#include
using namespace lldb_private;
@@ -87,8 +85,7 @@ static llvm::raw_ostream &PrintSeverity(Stream &stream,
void RenderDiagnosticDetails(Stream &stream,
std::optional offset_in_command,
bool show_inline,
- llvm::ArrayRef details,
- bool force_ascii) {
+ llvm::ArrayRef details) {
if (details.empty())
return;
@@ -100,8 +97,12 @@ void RenderDiagnosticDetails(Stream &stream,
return;
}
+ // Since there is no other way to find this out, use the color
+ // attribute as a proxy for whether the terminal supports Unicode
+ // characters. In the future it might make sense to move this into
+ // Host so it can be customized for a specific platform.
llvm::StringRef cursor, underline, vbar, joint, hbar, spacer;
- if (Terminal::SupportsUnicode() && !force_ascii) {
+ if (stream.AsRawOstream().colors_enabled()) {
cursor = "˄";
underline = "˜";
vbar = "│";
diff --git a/lldb/source/Host/common/Terminal.cpp
b/lldb/source/Host/common/Terminal.cpp
index d3647835e3937..436dfd8130d9b 100644
--- a/lldb/source/Host/common/Terminal.cpp
+++ b/lldb/source/Host/common/Terminal.cpp
@@ -400,22 +400,6 @@ llvm::Error Terminal::SetHardwareFlowControl(bool enabled)
{
#endif // LLDB_ENABLE_TERMIOS
[Lldb-commits] [lldb] Revert "[lldb] fix failing tests due to CI diagnostics rendering (PR #171791)
https://github.com/charles-zablit auto_merge_enabled https://github.com/llvm/llvm-project/pull/171791 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 0b522d9 - Revert "[lldb] fix failing tests due to CI diagnostics rendering (#171791)
Author: Charles Zablit
Date: 2025-12-11T10:16:01Z
New Revision: 0b522d9e8e450a38fea1ac14b7ec67f682f43725
URL:
https://github.com/llvm/llvm-project/commit/0b522d9e8e450a38fea1ac14b7ec67f682f43725
DIFF:
https://github.com/llvm/llvm-project/commit/0b522d9e8e450a38fea1ac14b7ec67f682f43725.diff
LOG: Revert "[lldb] fix failing tests due to CI diagnostics rendering (#171791)
Added:
Modified:
lldb/include/lldb/Host/Terminal.h
lldb/include/lldb/Host/common/DiagnosticsRendering.h
lldb/source/Host/common/DiagnosticsRendering.cpp
lldb/source/Host/common/Terminal.cpp
lldb/test/Shell/Commands/command-dwim-print.test
lldb/test/Shell/Commands/command-expr-diagnostics.test
lldb/test/Shell/Commands/command-options.test
lldb/unittests/Host/common/DiagnosticsRenderingTest.cpp
Removed:
diff --git a/lldb/include/lldb/Host/Terminal.h
b/lldb/include/lldb/Host/Terminal.h
index 3d66515c18812..da0d05e8bd265 100644
--- a/lldb/include/lldb/Host/Terminal.h
+++ b/lldb/include/lldb/Host/Terminal.h
@@ -68,18 +68,6 @@ class Terminal {
llvm::Error SetHardwareFlowControl(bool enabled);
- /// Returns whether or not the current terminal supports Unicode rendering.
- ///
- /// The value is cached after the first computation.
- ///
- /// On POSIX systems, we check if the LANG environment variable contains the
- /// substring "UTF-8", case insensitive.
- ///
- /// On Windows, we always return true since we use the `WriteConsoleW` API
- /// internally. Note that the default Windows codepage (437) does not support
- /// all Unicode characters. This function does not check the codepage.
- static bool SupportsUnicode();
-
protected:
struct Data;
diff --git a/lldb/include/lldb/Host/common/DiagnosticsRendering.h
b/lldb/include/lldb/Host/common/DiagnosticsRendering.h
index 3eea0647da37e..dd33d671c24a5 100644
--- a/lldb/include/lldb/Host/common/DiagnosticsRendering.h
+++ b/lldb/include/lldb/Host/common/DiagnosticsRendering.h
@@ -59,27 +59,10 @@ struct DiagnosticDetail {
StructuredData::ObjectSP Serialize(llvm::ArrayRef details);
-/// Renders an array of DiagnosticDetail instances.
-///
-/// \param[in] stream
-/// The stream to render the diagnostics to.
-/// \param offset_in_command
-/// An optional offset to the column position of the diagnostic in the
-/// source.
-/// \param show_inline
-/// Whether to show the diagnostics inline.
-/// \param details
-/// The array of DiagnosticsDetail to render.
-/// \param force_ascii
-/// Whether to force ascii rendering. If false, Unicode characters will be
-/// used if the output file supports them.
-///
-/// \see lldb_private::Terminal::SupportsUnicode
void RenderDiagnosticDetails(Stream &stream,
std::optional offset_in_command,
bool show_inline,
- llvm::ArrayRef details,
- bool force_ascii = false);
+ llvm::ArrayRef details);
class DiagnosticError
: public llvm::ErrorInfo {
diff --git a/lldb/source/Host/common/DiagnosticsRendering.cpp
b/lldb/source/Host/common/DiagnosticsRendering.cpp
index 2c9d33a6c325c..f2cd3968967fb 100644
--- a/lldb/source/Host/common/DiagnosticsRendering.cpp
+++ b/lldb/source/Host/common/DiagnosticsRendering.cpp
@@ -7,8 +7,6 @@
//===--===//
#include "lldb/Host/common/DiagnosticsRendering.h"
-#include "lldb/Host/Terminal.h"
-
#include
using namespace lldb_private;
@@ -87,8 +85,7 @@ static llvm::raw_ostream &PrintSeverity(Stream &stream,
void RenderDiagnosticDetails(Stream &stream,
std::optional offset_in_command,
bool show_inline,
- llvm::ArrayRef details,
- bool force_ascii) {
+ llvm::ArrayRef details) {
if (details.empty())
return;
@@ -100,8 +97,12 @@ void RenderDiagnosticDetails(Stream &stream,
return;
}
+ // Since there is no other way to find this out, use the color
+ // attribute as a proxy for whether the terminal supports Unicode
+ // characters. In the future it might make sense to move this into
+ // Host so it can be customized for a specific platform.
llvm::StringRef cursor, underline, vbar, joint, hbar, spacer;
- if (Terminal::SupportsUnicode() && !force_ascii) {
+ if (stream.AsRawOstream().colors_enabled()) {
cursor = "˄";
underline = "˜";
vbar = "│";
diff --git a/lldb/source/Host/common/Terminal.cpp
b/lldb/source/Host/common/Terminal.cpp
index d3647835e3937..436dfd8130d9b 100644
--- a/lldb/source/Host/common/Terminal.cpp
+++ b/lldb/source/Host/common/Terminal.cpp
@@ -400,22 +400,6 @@ llvm::Error Terminal::SetHardwareFlowControl(bool enabled)
{
#endif // LLDB_EN
[Lldb-commits] [lldb] Revert "[lldb] fix failing tests due to CI diagnostics rendering (PR #171791)
https://github.com/charles-zablit closed https://github.com/llvm/llvm-project/pull/171791 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Fix toolchain-msvc.test for native ARM64 MSVC environment (PR #171797)
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/171797 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Fix toolchain-msvc.test for native ARM64 MSVC environment (PR #171797)
@@ -23,15 +23,15 @@ RUN:| FileCheck --check-prefix=64BIT %s
32BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.pdb
32BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.exe
32BIT: compiling foobar.c -> foo.exe-foobar.obj
-32BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x86|arm)}}\cl.{{EXE|exe}}
+32BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|arm)}}\cl.{{EXE|exe}}
32BIT: linking foo.exe-foobar.obj -> foo.exe
-32BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x86|arm)}}\link.{{EXE|exe}}
+32BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|arm)}}\link.{{EXE|exe}}
32BIT: Env
32BIT: LIB = {{.*}}\ATLMFC\lib\{{(x86|arm)}}
32BIT: {{.*}}\lib\{{(x86|arm)}}
32BIT: {{.*}}\ucrt\{{(x86|arm)}}
32BIT: {{.*}}\um\{{(x86|arm)}}
-32BIT: PATH = {{.*}}\bin\{{[Hh]ost[Xx](64|86)}}\{{(x86|x64)}}
+32BIT: PATH =
{{.*}}\bin\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|x64|arm64)}}
DavidSpickett wrote:
Should the second one allow ARM64 as well?
https://github.com/llvm/llvm-project/pull/171797
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Fix toolchain-msvc.test for native ARM64 MSVC environment (PR #171797)
https://github.com/DavidSpickett approved this pull request. Confused as to where we expect to get ARM64 vs. arm64 but assuming it's just how Microsoft chose to name things, this LGTM. https://github.com/llvm/llvm-project/pull/171797 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Fix toolchain-msvc.test for native ARM64 MSVC environment (PR #171797)
@@ -51,12 +51,12 @@ RUN:| FileCheck --check-prefix=64BIT %s
64BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.pdb
64BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.exe
64BIT: compiling foobar.c -> foo.exe-foobar.obj
-64BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x64|arm64)}}\cl.{{EXE|exe}}
+64BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x64|arm64)}}\cl.{{EXE|exe}}
64BIT: linking foo.exe-foobar.obj -> foo.exe
-64BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x64|arm64)}}\link.{{EXE|exe}}
+64BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x64|arm64)}}\link.{{EXE|exe}}
DavidSpickett wrote:
Should the second one allow ARM64 too?
https://github.com/llvm/llvm-project/pull/171797
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix toolchain-msvc.test for native ARM64 MSVC environment (PR #171797)
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/171797 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][NFC] Change ObjectFile argument type (PR #171574)
DavidSpickett wrote: > I didn't want to get too deep into details not directly related to this PR, > but the overall project is a mac specific one. Thanks for explaining and now you've explained, I feel justified in getting Jonas to review :) https://github.com/llvm/llvm-project/pull/171574 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix failing tests due to CI diagnostics rendering (PR #171685)
slydiman wrote:
I was able to pass the test `command-options.test` on Windows with the
following regex
```
# CHECK1: {{^ *(\^|˄)(~|˜)}}
# CHECK1: {{^ *.*error: unknown or ambiguous option}}
```
https://github.com/llvm/llvm-project/pull/171685
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 60b5d06 - [lldb][lldb-dap] Remove unused variable
Author: David Spickett
Date: 2025-12-11T13:54:19Z
New Revision: 60b5d06f7cb0a4de6417f6e6d05ed780e45d844d
URL:
https://github.com/llvm/llvm-project/commit/60b5d06f7cb0a4de6417f6e6d05ed780e45d844d
DIFF:
https://github.com/llvm/llvm-project/commit/60b5d06f7cb0a4de6417f6e6d05ed780e45d844d.diff
LOG: [lldb][lldb-dap] Remove unused variable
Fixes warning:
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\tools\lldb-dap\tool\lldb-dap.cpp(446,27):
warning: unused variable 'dap_sessions_condition' [-Wunused-variable]
Variable is unused since #163653 / 5ab3375b2cf461ab02704d129a1f4d5ba1a1e275.
Added:
Modified:
lldb/tools/lldb-dap/tool/lldb-dap.cpp
Removed:
Unicorn! · GitHub
body {
background-color: #f1f1f1;
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.container { margin: 50px auto 40px auto; width: 600px; text-align:
center; }
a { color: #4183c4; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { letter-spacing: -1px; line-height: 60px; font-size: 60px;
font-weight: 100; margin: 0px; text-shadow: 0 1px 0 #fff; }
p { color: rgba(0, 0, 0, 0.5); margin: 10px 0 10px; font-size: 18px;
font-weight: 200; line-height: 1.6em;}
ul { list-style: none; margin: 25px 0; padding: 0; }
li { display: table-cell; font-weight: bold; width: 1%; }
.logo { display: inline-block; margin-top: 35px; }
.logo-img-2x { display: none; }
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
}
#suggestions {
margin-top: 35px;
color: #ccc;
}
#suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
}
No server is currently available to service your
request.
Sorry about that. Please try refreshing and contact us if the problem
persists.
https://github.com/contact";>Contact Support —
https://www.githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 90c340a - [lldb[test] Fix compiler warning in AdbClientTest.cpp
Author: David Spickett
Date: 2025-12-11T13:57:26Z
New Revision: 90c340a64b1ce0fa2617994457b091e5ca4b
URL:
https://github.com/llvm/llvm-project/commit/90c340a64b1ce0fa2617994457b091e5ca4b
DIFF:
https://github.com/llvm/llvm-project/commit/90c340a64b1ce0fa2617994457b091e5ca4b.diff
LOG: [lldb[test] Fix compiler warning in AdbClientTest.cpp
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\unittests\Platform\Android\AdbClientTest.cpp(100,17):
warning: unused function 'FindUnusedPort' [-Wunused-function]
Function is used by a test that is disabled on Windows.
Added:
Modified:
lldb/unittests/Platform/Android/AdbClientTest.cpp
Removed:
Unicorn! · GitHub
body {
background-color: #f1f1f1;
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.container { margin: 50px auto 40px auto; width: 600px; text-align:
center; }
a { color: #4183c4; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { letter-spacing: -1px; line-height: 60px; font-size: 60px;
font-weight: 100; margin: 0px; text-shadow: 0 1px 0 #fff; }
p { color: rgba(0, 0, 0, 0.5); margin: 10px 0 10px; font-size: 18px;
font-weight: 200; line-height: 1.6em;}
ul { list-style: none; margin: 25px 0; padding: 0; }
li { display: table-cell; font-weight: bold; width: 1%; }
.logo { display: inline-block; margin-top: 35px; }
.logo-img-2x { display: none; }
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
}
#suggestions {
margin-top: 35px;
color: #ccc;
}
#suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
}
No server is currently available to service your
request.
Sorry about that. Please try refreshing and contact us if the problem
persists.
https://github.com/contact";>Contact Support —
https://www.githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Module] Only log SDK search error once per debugger session (PR #171820)
https://github.com/Michael137 converted_to_draft https://github.com/llvm/llvm-project/pull/171820 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Module] Only log SDK search error once per debugger session (PR #171820)
https://github.com/Michael137 updated
https://github.com/llvm/llvm-project/pull/171820
>From fcbe4c42381cf6b895bfcf484af82f79d9f1d75f Mon Sep 17 00:00:00 2001
From: Michael Buch
Date: Thu, 11 Dec 2025 12:42:10 +
Subject: [PATCH] [lldb][Module] Only log SDK search error once per debugger
session
---
lldb/include/lldb/Core/Module.h | 4
lldb/source/Core/Module.cpp | 11 ++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h
index 40ce23e3d2ffb..0c51808ed5073 100644
--- a/lldb/include/lldb/Core/Module.h
+++ b/lldb/include/lldb/Core/Module.h
@@ -1094,6 +1094,9 @@ class Module : public
std::enable_shared_from_this,
m_shown_diagnostics;
std::recursive_mutex m_diagnostic_mutex;
+ llvm::StringMap> m_shown_sdk_errors;
+ std::recursive_mutex m_shown_sdk_errors_mutex;
+
void SymbolIndicesToSymbolContextList(Symtab *symtab,
std::vector &symbol_indexes,
SymbolContextList &sc_list);
@@ -1121,6 +1124,7 @@ class Module : public
std::enable_shared_from_this,
void ReportError(const llvm::formatv_object_base &payload);
void ReportErrorIfModifyDetected(const llvm::formatv_object_base &payload);
std::once_flag *GetDiagnosticOnceFlag(llvm::StringRef msg);
+ std::once_flag *GetSDKErrorOnceFlag(llvm::StringRef msg);
};
} // namespace lldb_private
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index da2c188899f03..8527001abd678 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1117,6 +1117,13 @@ void Module::ReportErrorIfModifyDetected(
}
}
+std::once_flag *Module::GetSDKErrorOnceFlag(llvm::StringRef msg) {
+ std::lock_guard guard(m_shown_sdk_errors_mutex);
+ auto [it, _] =
+ m_shown_sdk_errors.try_emplace(msg, std::make_unique());
+ return it->getValue().get();
+}
+
std::once_flag *Module::GetDiagnosticOnceFlag(llvm::StringRef msg) {
std::lock_guard guard(m_diagnostic_mutex);
auto &once_ptr = m_shown_diagnostics[llvm::stable_hash_name(msg)];
@@ -1569,7 +1576,9 @@ void Module::RegisterXcodeSDK(llvm::StringRef sdk_name,
if (!sdk_path_or_err) {
Debugger::ReportError("Error while searching for Xcode SDK: " +
- toString(sdk_path_or_err.takeError()));
+ toString(sdk_path_or_err.takeError()),
+ /*debugger_id=*/std::nullopt,
+ /*once=*/GetSDKErrorOnceFlag(sdk_name));
return;
}
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Module] Only log SDK search error once per debugger session (PR #171820)
https://github.com/Michael137 updated
https://github.com/llvm/llvm-project/pull/171820
>From b31aa38353ed622285802623b26bbed7cbec2185 Mon Sep 17 00:00:00 2001
From: Michael Buch
Date: Thu, 11 Dec 2025 12:42:10 +
Subject: [PATCH] [lldb][Module] Only log SDK search error once per debugger
session
---
lldb/include/lldb/Core/Module.h | 1 +
lldb/source/Core/Module.cpp | 11 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h
index 40ce23e3d2ffb..90333a842fe33 100644
--- a/lldb/include/lldb/Core/Module.h
+++ b/lldb/include/lldb/Core/Module.h
@@ -1121,6 +1121,7 @@ class Module : public
std::enable_shared_from_this,
void ReportError(const llvm::formatv_object_base &payload);
void ReportErrorIfModifyDetected(const llvm::formatv_object_base &payload);
std::once_flag *GetDiagnosticOnceFlag(llvm::StringRef msg);
+ std::once_flag *GetSDKErrorOnceFlag(llvm::StringRef msg);
};
} // namespace lldb_private
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index da2c188899f03..7cf3ed65c926e 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1117,6 +1117,13 @@ void Module::ReportErrorIfModifyDetected(
}
}
+std::once_flag *Module::GetSDKErrorOnceFlag(llvm::StringRef msg) {
+ std::lock_guard guard(m_shown_sdk_errors_mutex);
+ auto [it, _] =
+ m_shown_sdk_errors.try_emplace(msg, std::make_unique());
+ return it->getValue().get();
+}
+
std::once_flag *Module::GetDiagnosticOnceFlag(llvm::StringRef msg) {
std::lock_guard guard(m_diagnostic_mutex);
auto &once_ptr = m_shown_diagnostics[llvm::stable_hash_name(msg)];
@@ -1569,7 +1576,9 @@ void Module::RegisterXcodeSDK(llvm::StringRef sdk_name,
if (!sdk_path_or_err) {
Debugger::ReportError("Error while searching for Xcode SDK: " +
- toString(sdk_path_or_err.takeError()));
+ toString(sdk_path_or_err.takeError()),
+ /*debugger_id=*/std::nullopt,
+ /*once=*/GetDiagnosticOnceFlag(sdk_name));
return;
}
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Module] Only log SDK search error once per debugger session (PR #171820)
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/171820 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] improve the heuristics for checking if a terminal supports Unicode (PR #171491)
slydiman wrote: https://github.com/llvm/llvm-project/pull/171685#issuecomment-3642033568 https://github.com/llvm/llvm-project/pull/171491 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Module] Only log SDK search error once per debugger session (PR #171820)
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/171820 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Module] Only log SDK search error once per debugger session (PR #171820)
https://github.com/Michael137 ready_for_review https://github.com/llvm/llvm-project/pull/171820 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add WebAssembly platform (PR #171507)
@@ -0,0 +1,19 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "platformwasm" in {
+ def RuntimePath : Property<"runtime-path", "FileSpec">,
+Global,
+DefaultStringValue<"">,
+Desc<"Path to the WebAssembly runtime binary.">;
+ def RuntimeArgs : Property<"runtime-args", "Args">,
+Global,
+DefaultStringValue<"">,
+Desc<"Extra arguments to pass to the WebAssembly
runtime.">;
+ def PortArg : Property<"port-arg", "String">,
+Global,
+DefaultStringValue<"">,
+Desc<"Argument to the WebAssembly runtime to specify the "
+ "GDB remote port. The port number chosen by LLDB will be "
+ "concatenated to this argument. For example: "
+ "-g=127.0.0.1: or --debugger-port.">;
MaxDesiatov wrote:
+1 for backticks
https://github.com/llvm/llvm-project/pull/171507
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] b2dae2b - [lldb][test] Skip all of JSONTransportTest.cpp file on Windows
Author: David Spickett
Date: 2025-12-11T14:04:51Z
New Revision: b2dae2ba6ecaa2d424649fbd9dd6c4d3934b4f2b
URL:
https://github.com/llvm/llvm-project/commit/b2dae2ba6ecaa2d424649fbd9dd6c4d3934b4f2b
DIFF:
https://github.com/llvm/llvm-project/commit/b2dae2ba6ecaa2d424649fbd9dd6c4d3934b4f2b.diff
LOG: [lldb][test] Skip all of JSONTransportTest.cpp file on Windows
We were cutting out the tests but leaving the utility functions,
leading to warnings like:
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\unittests\Host\JSONTransportTest.cpp(65,6):
warning: unused function 'operator==' [-Wunused-function]
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\unittests\Host\JSONTransportTest.cpp(72,6):
warning: unused function 'PrintTo' [-Wunused-function]
I've moved the ifndef to the start of the file to fix those.
Added:
Modified:
lldb/unittests/Host/JSONTransportTest.cpp
Removed:
Unicorn! · GitHub
body {
background-color: #f1f1f1;
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.container { margin: 50px auto 40px auto; width: 600px; text-align:
center; }
a { color: #4183c4; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { letter-spacing: -1px; line-height: 60px; font-size: 60px;
font-weight: 100; margin: 0px; text-shadow: 0 1px 0 #fff; }
p { color: rgba(0, 0, 0, 0.5); margin: 10px 0 10px; font-size: 18px;
font-weight: 200; line-height: 1.6em;}
ul { list-style: none; margin: 25px 0; padding: 0; }
li { display: table-cell; font-weight: bold; width: 1%; }
.logo { display: inline-block; margin-top: 35px; }
.logo-img-2x { display: none; }
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
}
#suggestions {
margin-top: 35px;
color: #ccc;
}
#suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
}
No server is currently available to service your
request.
Sorry about that. Please try refreshing and contact us if the problem
persists.
https://github.com/contact";>Contact Support —
https://www.githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Module] Only log SDK search error once per debugger session (PR #171820)
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/171820 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Module] Only log SDK search error once per debugger session (PR #171820)
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/171820 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Module] Only log SDK search error once per debugger session (PR #171820)
https://github.com/Michael137 updated
https://github.com/llvm/llvm-project/pull/171820
>From 8591030480b7f752e94ec289be0ba1fb306caa6f Mon Sep 17 00:00:00 2001
From: Michael Buch
Date: Thu, 11 Dec 2025 12:42:10 +
Subject: [PATCH] [lldb][Module] Only log SDK search error once per debugger
session
---
lldb/source/Core/Module.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index da2c188899f03..3580918980bbd 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1569,7 +1569,9 @@ void Module::RegisterXcodeSDK(llvm::StringRef sdk_name,
if (!sdk_path_or_err) {
Debugger::ReportError("Error while searching for Xcode SDK: " +
- toString(sdk_path_or_err.takeError()));
+ toString(sdk_path_or_err.takeError()),
+ /*debugger_id=*/std::nullopt,
+ GetDiagnosticOnceFlag(sdk_name));
return;
}
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] improve the heuristics for checking if a terminal supports Unicode (PR #171832)
https://github.com/charles-zablit created
https://github.com/llvm/llvm-project/pull/171832
This patch improves the way lldb checks if the terminal it's opened in (if any)
supports Unicode or not.
On POSIX systems, we check if `LANG` contains `UTF-8`.
On Windows, we always return `true` since we use the `WriteToConsoleW` api.
This is a relanding of https://github.com/llvm/llvm-project/pull/168603.
The tests failed because the bots support Unicode but the tests expect ASCII.
To avoid different outputs depending on the environment the tests are running
in, this patch always force ASCII in the tests.
>From e46383656970d88e4a73b5406c4a04eb7bea48a5 Mon Sep 17 00:00:00 2001
From: Charles Zablit
Date: Thu, 11 Dec 2025 14:02:09 +
Subject: [PATCH] [lldb] improve the heuristics for checking if a terminal
supports Unicode
---
lldb/include/lldb/Host/Terminal.h | 12
.../lldb/Host/common/DiagnosticsRendering.h | 19 ++-
.../Host/common/DiagnosticsRendering.cpp | 11 +--
lldb/source/Host/common/Terminal.cpp | 16
.../Shell/Commands/command-dwim-print.test| 8
.../Commands/command-expr-diagnostics.test| 15 +++
lldb/test/Shell/Commands/command-options.test | 12 ++--
.../Host/common/DiagnosticsRenderingTest.cpp | 2 +-
8 files changed, 69 insertions(+), 26 deletions(-)
diff --git a/lldb/include/lldb/Host/Terminal.h
b/lldb/include/lldb/Host/Terminal.h
index da0d05e8bd265..3d66515c18812 100644
--- a/lldb/include/lldb/Host/Terminal.h
+++ b/lldb/include/lldb/Host/Terminal.h
@@ -68,6 +68,18 @@ class Terminal {
llvm::Error SetHardwareFlowControl(bool enabled);
+ /// Returns whether or not the current terminal supports Unicode rendering.
+ ///
+ /// The value is cached after the first computation.
+ ///
+ /// On POSIX systems, we check if the LANG environment variable contains the
+ /// substring "UTF-8", case insensitive.
+ ///
+ /// On Windows, we always return true since we use the `WriteConsoleW` API
+ /// internally. Note that the default Windows codepage (437) does not support
+ /// all Unicode characters. This function does not check the codepage.
+ static bool SupportsUnicode();
+
protected:
struct Data;
diff --git a/lldb/include/lldb/Host/common/DiagnosticsRendering.h
b/lldb/include/lldb/Host/common/DiagnosticsRendering.h
index dd33d671c24a5..3eea0647da37e 100644
--- a/lldb/include/lldb/Host/common/DiagnosticsRendering.h
+++ b/lldb/include/lldb/Host/common/DiagnosticsRendering.h
@@ -59,10 +59,27 @@ struct DiagnosticDetail {
StructuredData::ObjectSP Serialize(llvm::ArrayRef details);
+/// Renders an array of DiagnosticDetail instances.
+///
+/// \param[in] stream
+/// The stream to render the diagnostics to.
+/// \param offset_in_command
+/// An optional offset to the column position of the diagnostic in the
+/// source.
+/// \param show_inline
+/// Whether to show the diagnostics inline.
+/// \param details
+/// The array of DiagnosticsDetail to render.
+/// \param force_ascii
+/// Whether to force ascii rendering. If false, Unicode characters will be
+/// used if the output file supports them.
+///
+/// \see lldb_private::Terminal::SupportsUnicode
void RenderDiagnosticDetails(Stream &stream,
std::optional offset_in_command,
bool show_inline,
- llvm::ArrayRef details);
+ llvm::ArrayRef details,
+ bool force_ascii = false);
class DiagnosticError
: public llvm::ErrorInfo {
diff --git a/lldb/source/Host/common/DiagnosticsRendering.cpp
b/lldb/source/Host/common/DiagnosticsRendering.cpp
index f2cd3968967fb..2c9d33a6c325c 100644
--- a/lldb/source/Host/common/DiagnosticsRendering.cpp
+++ b/lldb/source/Host/common/DiagnosticsRendering.cpp
@@ -7,6 +7,8 @@
//===--===//
#include "lldb/Host/common/DiagnosticsRendering.h"
+#include "lldb/Host/Terminal.h"
+
#include
using namespace lldb_private;
@@ -85,7 +87,8 @@ static llvm::raw_ostream &PrintSeverity(Stream &stream,
void RenderDiagnosticDetails(Stream &stream,
std::optional offset_in_command,
bool show_inline,
- llvm::ArrayRef details) {
+ llvm::ArrayRef details,
+ bool force_ascii) {
if (details.empty())
return;
@@ -97,12 +100,8 @@ void RenderDiagnosticDetails(Stream &stream,
return;
}
- // Since there is no other way to find this out, use the color
- // attribute as a proxy for whether the terminal supports Unicode
- // characters. In the future it might make sense to move this into
- // Host so it can be customized for a specific platform.
llvm::StringRef cursor, underline, vbar, join
[Lldb-commits] [lldb] [lldb] improve the heuristics for checking if a terminal supports Unicode (PR #171832)
llvmbot wrote:
@llvm/pr-subscribers-lldb
Author: Charles Zablit (charles-zablit)
Changes
This patch improves the way lldb checks if the terminal it's opened in (if any)
supports Unicode or not.
On POSIX systems, we check if `LANG` contains `UTF-8`.
On Windows, we always return `true` since we use the `WriteToConsoleW` api.
This is a relanding of https://github.com/llvm/llvm-project/pull/168603.
The tests failed because the bots support Unicode but the tests expect ASCII.
To avoid different outputs depending on the environment the tests are running
in, this patch always force ASCII in the tests.
---
Patch is 53.61 KiB, truncated to 20.00 KiB below, full version:
https://github.com/llvm/llvm-project/pull/171832.diff
8 Files Affected:
- (modified) lldb/include/lldb/Host/Terminal.h (+12)
- (modified) lldb/include/lldb/Host/common/DiagnosticsRendering.h (+18-1)
- (modified) lldb/source/Host/common/DiagnosticsRendering.cpp (+5-6)
- (modified) lldb/source/Host/common/Terminal.cpp (+16)
- (modified) lldb/test/Shell/Commands/command-dwim-print.test (+4-4)
- (modified) lldb/test/Shell/Commands/command-expr-diagnostics.test (+7-8)
- (modified) lldb/test/Shell/Commands/command-options.test (+6-6)
- (modified) lldb/unittests/Host/common/DiagnosticsRenderingTest.cpp (+1-1)
``diff
Unicorn! · GitHub
body {
background-color: #f1f1f1;
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.container { margin: 50px auto 40px auto; width: 600px; text-align:
center; }
a { color: #4183c4; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { letter-spacing: -1px; line-height: 60px; font-size: 60px;
font-weight: 100; margin: 0px; text-shadow: 0 1px 0 #fff; }
p { color: rgba(0, 0, 0, 0.5); margin: 10px 0 10px; font-size: 18px;
font-weight: 200; line-height: 1.6em;}
ul { list-style: none; margin: 25px 0; padding: 0; }
li { display: table-cell; font-weight: bold; width: 1%; }
.logo { display: inline-block; margin-top: 35px; }
.logo-img-2x { display: none; }
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
}
#suggestions {
margin-top: 35px;
color: #ccc;
}
#suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
}
https://github.com/llvm/llvm-project/pull/171832
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix failing tests due to CI diagnostics rendering (PR #171685)
charles-zablit wrote: Thanks for looking into this! I was able to get all the tests to pass on Windows: https://github.com/llvm/llvm-project/pull/171832 I'm not sure about `lldb/test/Shell/Commands/command-expr-diagnostics.test` however, as it's XFAILed on Windows. I passes on macOS. The previous failure was on which is [lldb-remote-linux-win](https://lab.llvm.org/buildbot/#/builders/197). I want to reproduce it first. https://github.com/llvm/llvm-project/pull/171685 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
https://github.com/Nerixyz edited https://github.com/llvm/llvm-project/pull/171854 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
https://github.com/Nerixyz edited https://github.com/llvm/llvm-project/pull/171854 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] Adjusting the initialize/launch flow to better match the spec. (PR #171549)
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/171549
>From 714a50cee306e1437ef38c08232700a164cdea55 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Tue, 9 Dec 2025 17:00:56 -0800
Subject: [PATCH 1/2] [lldb-dap] Adjusting the initialize/launch flow to better
match the spec.
In https://github.com/llvm/llvm-project/pull/170523 it was pointed out that the
spec does specifically specify that launch/attach should not respond until
configurationDone is handled.
This means we do need to support async request handlers. To better align with
the spec, I've added a new `lldb_dap::AsyncRequestHandler`. This is an
additional handler type that allows us to respond at a later point.
Additionally, I refactored `launch` and `attach` to only respond once the
`configurationDone` is complete, specifically during the `PostRun` operation of
the `configurationDone` handler.
I merged some of the common behavior between `RequestHandler` and
`AsyncRequestHandler` into their common `BaseRequestHandler`.
---
.../test/tools/lldb-dap/dap_server.py | 27 ++--
.../test/tools/lldb-dap/lldbdap_testcase.py | 38 ++---
.../attach-commands/TestDAP_attachCommands.py | 2 +-
.../tools/lldb-dap/attach/TestDAP_attach.py | 4 +-
.../attach/TestDAP_attachByPortNum.py | 12 +-
.../TestDAP_breakpointAssembly.py | 7 +-
.../lldb-dap/commands/TestDAP_commands.py | 4 +-
.../lldb-dap/coreFile/TestDAP_coreFile.py | 2 +-
.../tools/lldb-dap/launch/TestDAP_launch.py | 26 ++--
.../runInTerminal/TestDAP_runInTerminal.py| 2 +-
lldb/tools/lldb-dap/DAP.h | 2 +
.../lldb-dap/Handler/AttachRequestHandler.cpp | 46 +++---
.../ConfigurationDoneRequestHandler.cpp | 10 +-
.../lldb-dap/Handler/LaunchRequestHandler.cpp | 24 +--
.../tools/lldb-dap/Handler/RequestHandler.cpp | 46 +-
lldb/tools/lldb-dap/Handler/RequestHandler.h | 138 ++
16 files changed, 241 insertions(+), 149 deletions(-)
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index 7a9d5a82983d7..dddcafc2630f8 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -46,7 +46,7 @@ class Event(TypedDict):
body: Any
-class Request(TypedDict, total=False):
+class Request(TypedDict):
type: Literal["request"]
seq: int
command: str
@@ -477,6 +477,7 @@ def _handle_reverse_request(self, request: Request) -> None:
"seq": 0,
"request_seq": request["seq"],
"success": True,
+"message": None,
"command": "runInTerminal",
"body": body,
}
@@ -502,7 +503,7 @@ def _process_continued(self, all_threads_continued: bool):
if all_threads_continued:
self.thread_stop_reasons = {}
-def _update_verified_breakpoints(self, breakpoints: list[Breakpoint]):
+def _update_verified_breakpoints(self, breakpoints: List[Breakpoint]):
for bp in breakpoints:
# If no id is set, we cannot correlate the given breakpoint across
# requests, ignore it.
@@ -537,7 +538,7 @@ def send_packet(self, packet: ProtocolMessage) -> int:
return packet["seq"]
-def _send_recv(self, request: Request) -> Optional[Response]:
+def _send_recv(self, request: Request) -> Response:
"""Send a command python dictionary as JSON and receive the JSON
response. Validates that the response is the correct sequence and
command in the reply. Any events that are received are added to the
@@ -598,7 +599,7 @@ def wait_for_breakpoint_events(self):
breakpoint_events.append(event)
return breakpoint_events
-def wait_for_breakpoints_to_be_verified(self, breakpoint_ids: list[str]):
+def wait_for_breakpoints_to_be_verified(self, breakpoint_ids: List[str]):
"""Wait for all breakpoints to be verified. Return all unverified
breakpoints."""
while any(id not in self.resolved_breakpoints for id in
breakpoint_ids):
breakpoint_event = self.wait_for_event(["breakpoint"])
@@ -800,7 +801,7 @@ def request_attach(
sourceMap: Optional[Union[list[tuple[str, str]], dict[str, str]]] =
None,
gdbRemotePort: Optional[int] = None,
gdbRemoteHostname: Optional[str] = None,
-):
+) -> int:
args_dict = {}
if pid is not None:
args_dict["pid"] = pid
@@ -838,7 +839,7 @@ def request_attach(
if gdbRemoteHostname is not None:
args_dict["gdb-remote-hostname"] = gdbRemoteHostname
command_dict = {"command": "attach", "type": "request", "arguments":
args_dict}
-return self._send_recv(command_dict)
+return self.send_packet(c
[Lldb-commits] [lldb] [lldb-dap] Adjusting the initialize/launch flow to better match the spec. (PR #171549)
@@ -21,16 +21,18 @@ using namespace lldb_dap::protocol;
namespace lldb_dap {
/// Launch request; value of command field is 'launch'.
-Error LaunchRequestHandler::Run(const LaunchRequestArguments &arguments) const
{
+void LaunchRequestHandler::Run(
+const LaunchRequestArguments &arguments,
+llvm::unique_function callback) const {
// Initialize DAP debugger.
if (Error err = dap.InitializeDebugger())
ashgti wrote:
With
https://github.com/llvm/llvm-project/commit/5ab3375b2cf461ab02704d129a1f4d5ba1a1e275
this was moved into attach/launch because there is a possibility of a debugger
being shared between sessions but with different targets. Although I'm not sure
if that is fully operational yet...
https://github.com/llvm/llvm-project/pull/171549
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
@@ -0,0 +1,131 @@
+//===-- GenericStringView.cpp ===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===-===//
+
+#include "Generic.h"
+#include "LibCxx.h"
+
+#include "lldb/ValueObject/ValueObject.h"
+#include "lldb/lldb-forward.h"
+
+#include "Plugins/Language/CPlusPlus/CxxStringTypes.h"
+#include
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace lldb_private::formatters;
+
+using StringElementType = StringPrinter::StringElementType;
+
+enum class StlType {
+ LibCxx,
+ LibStdcpp,
+ MsvcStl,
+};
+
+std::tuple
+extractStringViewData(ValueObject &valobj) {
+ auto data_sp = valobj.GetChildMemberWithName("_Mydata");
+ if (data_sp)
+return std::make_tuple(StlType::MsvcStl, data_sp,
+ valobj.GetChildMemberWithName("_Mysize"));
+ data_sp = valobj.GetChildMemberWithName("_M_str");
+ if (data_sp)
+return std::make_tuple(StlType::LibStdcpp, data_sp,
+ valobj.GetChildMemberWithName("_M_len"));
+ return std::make_tuple(
+ StlType::LibCxx,
+ GetChildMemberWithName(valobj,
+ {ConstString("__data_"), ConstString("__data")}),
+ GetChildMemberWithName(valobj,
+ {ConstString("__size_"), ConstString("__size")}));
+}
+
+template
+static bool formatStringViewImpl(lldb::ValueObjectSP data_sp,
+ lldb::ValueObjectSP size_sp, Stream &stream,
+ const TypeSummaryOptions &summary_options,
+ std::string prefix_token) {
+ if (!data_sp || !size_sp)
+return false;
+
+ bool success = false;
+ uint64_t size = size_sp->GetValueAsUnsigned(0, &success);
+ if (!success) {
+stream << "Summary Unavailable";
+return true;
+ }
+
+ StreamString scratch_stream;
+ success = StringBufferSummaryProvider(
+ scratch_stream, summary_options, data_sp, size, prefix_token);
+
+ if (success)
+stream << scratch_stream.GetData();
+ else
+stream << "Summary Unavailable";
+ return true;
+}
+
+template
+static constexpr const char *getPrefixToken() {
+ if constexpr (element_type == StringElementType::ASCII)
+return "";
+ if constexpr (element_type == StringElementType::UTF8)
+return "u8";
+ if constexpr (element_type == StringElementType::UTF16)
+return "u";
+ if constexpr (element_type == StringElementType::UTF32)
+return "U";
+ llvm_unreachable("invalid element type");
+}
+
+template
+bool lldb_private::formatters::GenericStringViewSummaryProvider(
+ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
+ auto [_, data_sp, size_sp] = extractStringViewData(valobj);
+ return formatStringViewImpl(data_sp, size_sp, stream, options,
+getPrefixToken());
+}
+
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::ASCII>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::UTF8>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::UTF16>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::UTF32>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+
+bool lldb_private::formatters::GenericWStringViewSummaryProvider(
+ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
+ auto [stl, data_sp, size_sp] = extractStringViewData(valobj);
+ if (stl == StlType::LibStdcpp)
+return formatStringViewImpl(data_sp, size_sp,
+ stream, options,
"L");
DrSergei wrote:
Sorry, It was a typo. I mean we should use utf32 for msvc stl and try to get
exact wchar size for libstdcpp and libcxx.
https://github.com/llvm/llvm-project/pull/171854
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
DrSergei wrote: > Thanks for the patch. I'm all in favour of de-duplicating the formatter code, > but I'd prefer it if we kept the individual SummaryProvider's per STL. > > I.e., the code that extracts the data and size from the type should live in > the individual STL files. But the code that then formats the strings can be > generic. > > Is that feasible? > > Note, copy-paste between the formatters is not actually a bad thing per-se, > imo. It's useful for them to be developed separately because layouts can > drastically change, and at that point a generic implementation may become > convoluted to maintain. Also not every developer has access to every STL. > Having them separate also means a developer can focus on the specific STL > they're worried about, without breaking it for other STLs. That being said, > the stuff that just prints the data can definitely be generic, as it's not > STL specific. I added special function to access data and size fields for each stl. `GenericInitializerList` already have data access functions inside it, so I thought it is normal. https://github.com/llvm/llvm-project/pull/171854 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Correct use_editline check in IOHandlerEditline (PR #171733)
https://github.com/JDevlieghere auto_merge_enabled https://github.com/llvm/llvm-project/pull/171733 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Correct use_editline check in IOHandlerEditline (PR #171733)
https://github.com/JDevlieghere updated
https://github.com/llvm/llvm-project/pull/171733
>From cb83cdce863b25bf7eda68889cc772e1cfda8ad8 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere
Date: Wed, 10 Dec 2025 15:03:42 -0800
Subject: [PATCH 1/2] [lldb] Correct use_editline check in IOHandlerEditline
Correct the use_editline check in IOHandlerEditline to prevent a crash
when we have an output and/or error file, but no stream. This fixes a
regression introduced by 58279d1 that results in a crash when calling
el_init with a NULL stream.
The original code was checking the stream: GetOutputFILE and
GetErrorFILE.
```
use_editline = GetInputFILE() && GetOutputFILE() && GetErrorFILE() &&
m_input_sp && m_input_sp->GetIsRealTerminal();
```
The new code is checking the file: `m_output_sp` and `m_error_sp`.
```
use_editline = m_input_sp && m_output_sp && m_error_sp &&
m_input_sp->GetIsRealTerminal();
```
The correct check is:
```
use_editline =
m_input_sp && m_input_sp->GetIsRealTerminal() &&
m_output_sp && m_output_sp->GetUnlockedFile().GetStream() &&
m_error_sp && m_error_sp->GetUnlockedFile().GetStream();
```
We don't need to update the check for the input, because we're handling
the missing stream there correctly in the call to the constructor:
```
m_editline_up = std::make_unique(
editline_name, m_input_sp ? m_input_sp->GetStream() : nullptr,
m_output_sp, m_error_sp, m_color);
```
We can't do the same for the output and error because we need to pass
the file, not the stream (to do proper locking).
As I was debugging this I added some more assertions. They're generally
useful so I'm keeping them.
Fixes #170891
---
lldb/include/lldb/Host/StreamFile.h | 5 -
lldb/source/Core/IOHandler.cpp | 6 --
lldb/source/Host/common/Editline.cpp | 3 ++-
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/lldb/include/lldb/Host/StreamFile.h
b/lldb/include/lldb/Host/StreamFile.h
index 8b01eeab6f586..172a9a29bf491 100644
--- a/lldb/include/lldb/Host/StreamFile.h
+++ b/lldb/include/lldb/Host/StreamFile.h
@@ -92,7 +92,10 @@ class LockableStreamFile {
/// Unsafe accessors to get the underlying File without a lock. Exists for
/// legacy reasons.
/// @{
- File &GetUnlockedFile() { return *m_file_sp; }
+ File &GetUnlockedFile() {
+assert(m_file_sp && "GetUnlockedFile requires a valid FileSP");
+return *m_file_sp;
+ }
std::shared_ptr GetUnlockedFileSP() { return m_file_sp; }
/// @}
diff --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp
index c2530aa0d00c5..752390aeef659 100644
--- a/lldb/source/Core/IOHandler.cpp
+++ b/lldb/source/Core/IOHandler.cpp
@@ -245,8 +245,10 @@ IOHandlerEditline::IOHandlerEditline(
SetPrompt(prompt);
#if LLDB_ENABLE_LIBEDIT
- const bool use_editline = m_input_sp && m_output_sp && m_error_sp &&
-m_input_sp->GetIsRealTerminal();
+ const bool use_editline =
+ m_input_sp && m_input_sp->GetIsRealTerminal() && // Input
+ m_output_sp && m_output_sp->GetUnlockedFile().GetStream() && // Output
+ m_error_sp && m_error_sp->GetUnlockedFile().GetStream(); // Error
if (use_editline) {
m_editline_up = std::make_unique(
editline_name, m_input_sp ? m_input_sp->GetStream() : nullptr,
diff --git a/lldb/source/Host/common/Editline.cpp
b/lldb/source/Host/common/Editline.cpp
index e2995b37429fd..39b0a649a7f60 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -1511,7 +1511,8 @@ Editline::Editline(const char *editline_name, FILE
*input_file,
: m_editor_status(EditorStatus::Complete), m_input_file(input_file),
m_output_stream_sp(output_stream_sp), m_error_stream_sp(error_stream_sp),
m_input_connection(fileno(input_file), false), m_color(color) {
- assert(output_stream_sp && error_stream_sp);
+ assert(output_stream_sp && output_stream_sp->GetUnlockedFile().GetStream());
+ assert(error_stream_sp && output_stream_sp->GetUnlockedFile().GetStream());
// Get a shared history instance
m_editor_name = (editline_name == nullptr) ? "lldb-tmp" : editline_name;
m_history_sp = EditlineHistory::GetHistory(m_editor_name);
>From fe2d87e88f3634471a867d734a27c8110d6efbee Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere
Date: Thu, 11 Dec 2025 09:17:38 -0800
Subject: [PATCH 2/2] Address David's request for a comment
---
lldb/source/Core/IOHandler.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp
index 752390aeef659..5cc15ad2ed6ff 100644
--- a/lldb/source/Core/IOHandler.cpp
+++ b/lldb/source/Core/IOHandler.cpp
@@ -245,6 +245,9 @@ IOHandlerEditline::IOHandlerEditline(
SetPrompt(prompt);
#if LLDB_ENABLE_LIBEDIT
+ // To use Editline, we need an input, output, and error stream. Not all valid
+ // files will have a FILE* stream. Don't use Editline
[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
@@ -0,0 +1,131 @@
+//===-- GenericStringView.cpp ===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===-===//
+
+#include "Generic.h"
+#include "LibCxx.h"
+
+#include "lldb/ValueObject/ValueObject.h"
+#include "lldb/lldb-forward.h"
+
+#include "Plugins/Language/CPlusPlus/CxxStringTypes.h"
+#include
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace lldb_private::formatters;
+
+using StringElementType = StringPrinter::StringElementType;
+
+enum class StlType {
+ LibCxx,
+ LibStdcpp,
+ MsvcStl,
+};
+
+std::tuple
+extractStringViewData(ValueObject &valobj) {
+ auto data_sp = valobj.GetChildMemberWithName("_Mydata");
+ if (data_sp)
+return std::make_tuple(StlType::MsvcStl, data_sp,
+ valobj.GetChildMemberWithName("_Mysize"));
+ data_sp = valobj.GetChildMemberWithName("_M_str");
+ if (data_sp)
+return std::make_tuple(StlType::LibStdcpp, data_sp,
+ valobj.GetChildMemberWithName("_M_len"));
+ return std::make_tuple(
+ StlType::LibCxx,
+ GetChildMemberWithName(valobj,
+ {ConstString("__data_"), ConstString("__data")}),
+ GetChildMemberWithName(valobj,
+ {ConstString("__size_"), ConstString("__size")}));
+}
+
+template
+static bool formatStringViewImpl(lldb::ValueObjectSP data_sp,
+ lldb::ValueObjectSP size_sp, Stream &stream,
+ const TypeSummaryOptions &summary_options,
+ std::string prefix_token) {
+ if (!data_sp || !size_sp)
+return false;
+
+ bool success = false;
+ uint64_t size = size_sp->GetValueAsUnsigned(0, &success);
+ if (!success) {
+stream << "Summary Unavailable";
+return true;
+ }
+
+ StreamString scratch_stream;
+ success = StringBufferSummaryProvider(
+ scratch_stream, summary_options, data_sp, size, prefix_token);
+
+ if (success)
+stream << scratch_stream.GetData();
+ else
+stream << "Summary Unavailable";
+ return true;
+}
+
+template
+static constexpr const char *getPrefixToken() {
+ if constexpr (element_type == StringElementType::ASCII)
+return "";
+ if constexpr (element_type == StringElementType::UTF8)
+return "u8";
+ if constexpr (element_type == StringElementType::UTF16)
+return "u";
+ if constexpr (element_type == StringElementType::UTF32)
+return "U";
+ llvm_unreachable("invalid element type");
+}
+
+template
+bool lldb_private::formatters::GenericStringViewSummaryProvider(
+ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
+ auto [_, data_sp, size_sp] = extractStringViewData(valobj);
+ return formatStringViewImpl(data_sp, size_sp, stream, options,
+getPrefixToken());
+}
+
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::ASCII>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::UTF8>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::UTF16>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+template bool lldb_private::formatters::GenericStringViewSummaryProvider<
+StringElementType::UTF32>(ValueObject &, Stream &,
+ const TypeSummaryOptions &);
+
+bool lldb_private::formatters::GenericWStringViewSummaryProvider(
+ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
+ auto [stl, data_sp, size_sp] = extractStringViewData(valobj);
+ if (stl == StlType::LibStdcpp)
+return formatStringViewImpl(data_sp, size_sp,
+ stream, options,
"L");
Nerixyz wrote:
For MSVC's STL, we should use utf16, but it shouldn't hurt to get the size
there as well.
https://github.com/llvm/llvm-project/pull/171854
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Correct use_editline check in IOHandlerEditline (PR #171733)
@@ -245,8 +245,10 @@ IOHandlerEditline::IOHandlerEditline( SetPrompt(prompt); #if LLDB_ENABLE_LIBEDIT - const bool use_editline = m_input_sp && m_output_sp && m_error_sp && -m_input_sp->GetIsRealTerminal(); + const bool use_editline = + m_input_sp && m_input_sp->GetIsRealTerminal() && // Input + m_output_sp && m_output_sp->GetUnlockedFile().GetStream() && // Output + m_error_sp && m_error_sp->GetUnlockedFile().GetStream(); // Error JDevlieghere wrote: Added a comment. I kept it slightly more generic than what you're suggesting here as I don't want to codify which files have a FILE*. We have a similar comment in the `File` class, saying that not all files have `FILE*`. The bug report includes an example that goes through the Python read/write APIs. https://github.com/llvm/llvm-project/pull/171733 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] c814ac1 - [lldb] Correct use_editline check in IOHandlerEditline (#171733)
Author: Jonas Devlieghere
Date: 2025-12-11T17:24:04Z
New Revision: c814ac1928b264a5bdeb98ec9035412fa37fb243
URL:
https://github.com/llvm/llvm-project/commit/c814ac1928b264a5bdeb98ec9035412fa37fb243
DIFF:
https://github.com/llvm/llvm-project/commit/c814ac1928b264a5bdeb98ec9035412fa37fb243.diff
LOG: [lldb] Correct use_editline check in IOHandlerEditline (#171733)
Correct the use_editline check in IOHandlerEditline to prevent a crash
when we have an output and/or error file, but no stream. This fixes a
regression introduced by 58279d1 that results in a crash when calling
el_init with a NULL stream.
The original code was checking the stream: GetOutputFILE and
GetErrorFILE.
```
use_editline = GetInputFILE() && GetOutputFILE() && GetErrorFILE() &&
m_input_sp && m_input_sp->GetIsRealTerminal();
```
The new code is checking the file: `m_output_sp` and `m_error_sp`.
```
use_editline = m_input_sp && m_output_sp && m_error_sp &&
m_input_sp->GetIsRealTerminal();
```
The correct check is:
```
use_editline =
m_input_sp && m_input_sp->GetIsRealTerminal() &&
m_output_sp && m_output_sp->GetUnlockedFile().GetStream() &&
m_error_sp && m_error_sp->GetUnlockedFile().GetStream();
```
We don't need to update the check for the input, because we're handling
the missing stream there correctly in the call to the constructor:
```
m_editline_up = std::make_unique(
editline_name, m_input_sp ? m_input_sp->GetStream() : nullptr,
m_output_sp, m_error_sp, m_color);
```
We can't do the same for the output and error because we need to pass
the file, not the stream (to do proper locking).
As I was debugging this I added some more assertions. They're generally
useful so I'm keeping them.
Fixes #170891
Added:
Modified:
lldb/include/lldb/Host/StreamFile.h
lldb/source/Core/IOHandler.cpp
lldb/source/Host/common/Editline.cpp
Removed:
diff --git a/lldb/include/lldb/Host/StreamFile.h
b/lldb/include/lldb/Host/StreamFile.h
index 8b01eeab6f586..172a9a29bf491 100644
--- a/lldb/include/lldb/Host/StreamFile.h
+++ b/lldb/include/lldb/Host/StreamFile.h
@@ -92,7 +92,10 @@ class LockableStreamFile {
/// Unsafe accessors to get the underlying File without a lock. Exists for
/// legacy reasons.
/// @{
- File &GetUnlockedFile() { return *m_file_sp; }
+ File &GetUnlockedFile() {
+assert(m_file_sp && "GetUnlockedFile requires a valid FileSP");
+return *m_file_sp;
+ }
std::shared_ptr GetUnlockedFileSP() { return m_file_sp; }
/// @}
diff --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp
index c2530aa0d00c5..5cc15ad2ed6ff 100644
--- a/lldb/source/Core/IOHandler.cpp
+++ b/lldb/source/Core/IOHandler.cpp
@@ -245,8 +245,13 @@ IOHandlerEditline::IOHandlerEditline(
SetPrompt(prompt);
#if LLDB_ENABLE_LIBEDIT
- const bool use_editline = m_input_sp && m_output_sp && m_error_sp &&
-m_input_sp->GetIsRealTerminal();
+ // To use Editline, we need an input, output, and error stream. Not all valid
+ // files will have a FILE* stream. Don't use Editline if the input is not a
+ // real terminal.
+ const bool use_editline =
+ m_input_sp && m_input_sp->GetIsRealTerminal() && // Input
+ m_output_sp && m_output_sp->GetUnlockedFile().GetStream() && // Output
+ m_error_sp && m_error_sp->GetUnlockedFile().GetStream(); // Error
if (use_editline) {
m_editline_up = std::make_unique(
editline_name, m_input_sp ? m_input_sp->GetStream() : nullptr,
diff --git a/lldb/source/Host/common/Editline.cpp
b/lldb/source/Host/common/Editline.cpp
index e2995b37429fd..39b0a649a7f60 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -1511,7 +1511,8 @@ Editline::Editline(const char *editline_name, FILE
*input_file,
: m_editor_status(EditorStatus::Complete), m_input_file(input_file),
m_output_stream_sp(output_stream_sp), m_error_stream_sp(error_stream_sp),
m_input_connection(fileno(input_file), false), m_color(color) {
- assert(output_stream_sp && error_stream_sp);
+ assert(output_stream_sp && output_stream_sp->GetUnlockedFile().GetStream());
+ assert(error_stream_sp && output_stream_sp->GetUnlockedFile().GetStream());
// Get a shared history instance
m_editor_name = (editline_name == nullptr) ? "lldb-tmp" : editline_name;
m_history_sp = EditlineHistory::GetHistory(m_editor_name);
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Correct use_editline check in IOHandlerEditline (PR #171733)
https://github.com/JDevlieghere closed https://github.com/llvm/llvm-project/pull/171733 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][NFC] Change ObjectFile argument type (PR #171574)
https://github.com/jasonmolenda closed https://github.com/llvm/llvm-project/pull/171574 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 8d59cca - [lldb] Add WebAssembly platform (#171507)
Author: Jonas Devlieghere
Date: 2025-12-11T11:12:26-08:00
New Revision: 8d59cca1ab9cf4e39e43bf695e415de9ccd41115
URL:
https://github.com/llvm/llvm-project/commit/8d59cca1ab9cf4e39e43bf695e415de9ccd41115
DIFF:
https://github.com/llvm/llvm-project/commit/8d59cca1ab9cf4e39e43bf695e415de9ccd41115.diff
LOG: [lldb] Add WebAssembly platform (#171507)
This PR adds a platform for WebAssembly. Heavily inspired by Pavel's
QemuUser, the platform lets you configure a WebAssembly runtime to run a
Wasm binary.
For example, the following configuration can be used to launch binaries
under the WebAssembly Micro Runtime (WARM):
```
settings set -- platform.plugin.wasm.runtime-args --heap-size=1048576
settings set -- platform.plugin.wasm.port-arg -g=127.0.0.1:
settings set -- platform.plugin.wasm.runtime-path /path/to/iwasm-2.4.0
```
With the settings above, you can now launch a binary directly under
WAMR:
```
❯ lldb simple.wasm
(lldb) target create
"/Users/jonas/wasm-micro-runtime/product-mini/platforms/darwin/build/simple.wasm"
Current executable set to
'/Users/jonas/wasm-micro-runtime/product-mini/platforms/darwin/build/simple.wasm'
(wasm32).
(lldb) b main
Breakpoint 1: 2 locations.
(lldb) r
Process 1 launched:
'/Users/jonas/wasm-micro-runtime/product-mini/platforms/darwin/build/simple.wasm'
(wasm32)
2 locations added to breakpoint 1
[22:28:05:124 - 16FE27000]: control thread of debug object 0x1005e9020 start
[22:28:05:124 - 16FE27000]: Debug server listening on 127.0.0.1:49170
the module name is
/Users/jonas/wasm-micro-runtime/product-mini/platforms/darwin/build/simple.wasm
Process 1 stopped
* thread #1, name = 'nobody', stop reason = breakpoint 1.3
frame #0: 0x41d3 simple.wasm`main at simple.c:8:7
5}
6
7int main() {
-> 8 int i = 1;
9 int j = 2;
10 return add(i, j);
11 }
(lldb)
```
Added:
lldb/source/Plugins/Platform/WebAssembly/CMakeLists.txt
lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.h
lldb/source/Plugins/Platform/WebAssembly/PlatformWasmProperties.td
Modified:
lldb/source/Plugins/Platform/CMakeLists.txt
llvm/docs/ReleaseNotes.md
Removed:
diff --git a/lldb/source/Plugins/Platform/CMakeLists.txt
b/lldb/source/Plugins/Platform/CMakeLists.txt
index f4753ab47ce11..cc1432aa4754b 100644
--- a/lldb/source/Plugins/Platform/CMakeLists.txt
+++ b/lldb/source/Plugins/Platform/CMakeLists.txt
@@ -15,4 +15,5 @@ add_subdirectory(NetBSD)
add_subdirectory(OpenBSD)
add_subdirectory(POSIX)
add_subdirectory(QemuUser)
+add_subdirectory(WebAssembly)
add_subdirectory(Windows)
diff --git a/lldb/source/Plugins/Platform/WebAssembly/CMakeLists.txt
b/lldb/source/Plugins/Platform/WebAssembly/CMakeLists.txt
new file mode 100644
index 0..7fb17b295fbb8
--- /dev/null
+++ b/lldb/source/Plugins/Platform/WebAssembly/CMakeLists.txt
@@ -0,0 +1,23 @@
+lldb_tablegen(PlatformWasmProperties.inc -gen-lldb-property-defs
+ SOURCE PlatformWasmProperties.td
+ TARGET LLDBPluginPlatformWasmPropertiesGen)
+
+lldb_tablegen(PlatformWasmPropertiesEnum.inc -gen-lldb-property-enum-defs
+ SOURCE PlatformWasmProperties.td
+ TARGET LLDBPluginPlatformWasmPropertiesEnumGen)
+
+add_lldb_library(lldbPluginPlatformWasm PLUGIN
+ PlatformWasm.cpp
+
+ LINK_LIBS
+lldbCore
+lldbHost
+lldbTarget
+lldbUtility
+ LINK_COMPONENTS
+Support
+ )
+
+add_dependencies(lldbPluginPlatformWasm
+ LLDBPluginPlatformWasmPropertiesGen
+ LLDBPluginPlatformWasmPropertiesEnumGen)
diff --git a/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
b/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
new file mode 100644
index 0..f77ac7abbb678
--- /dev/null
+++ b/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
@@ -0,0 +1,213 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "Plugins/Platform/WebAssembly/PlatformWasm.h"
+#include "Plugins/Process/wasm/ProcessWasm.h"
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Host/FileSystem.h"
+#include "lldb/Host/ProcessLaunchInfo.h"
+#include "lldb/Host/common/TCPSocket.h"
+#include "lldb/Interpreter/OptionValueProperties.h"
+#include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
+#include "lldb/Utility/LLDBLog.h"
+#include "lldb/Utility/Listener.h"
+#include "lldb/Utility/Log.h"
+#include "llvm/ADT/StringExtras.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+LLDB_PLUGIN_DEFINE(PlatformWasm)
+
+namespace {
+#define LLDB_PROPERTIES_platformwasm
+#include "Platform
[Lldb-commits] [lldb] [llvm] [lldb] Add WebAssembly platform (PR #171507)
https://github.com/JDevlieghere closed https://github.com/llvm/llvm-project/pull/171507 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Fix MS STL `variant` with non-trivial types and PDB (PR #171489)
@@ -67,12 +67,18 @@ std::optional GetIndexValue(ValueObject &valobj) {
ValueObjectSP GetNthStorage(ValueObject &outer, int64_t index) {
// We need to find the std::_Variant_storage base class.
- // -> std::_SMF_control (typedef to std::_Variant_base)
- ValueObjectSP container_sp = outer.GetSP()->GetChildAtIndex(0);
- if (!container_sp)
+ // Navigate "down" to std::_Variant_base by finding the holder of "_Which".
+ // This might be down a few levels if a variant member isn't trivially
+ // destructible/copyable/etc.
+ ValueObjectSP which_sp = outer.GetChildMemberWithName("_Which");
Michael137 wrote:
Oh the title of this PR answers my question. Yea probably better to do the two
changes separately
https://github.com/llvm/llvm-project/pull/171489
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Fix MS STL `variant` with non-trivial types and PDB (PR #171489)
@@ -67,12 +67,18 @@ std::optional GetIndexValue(ValueObject &valobj) {
ValueObjectSP GetNthStorage(ValueObject &outer, int64_t index) {
// We need to find the std::_Variant_storage base class.
- // -> std::_SMF_control (typedef to std::_Variant_base)
- ValueObjectSP container_sp = outer.GetSP()->GetChildAtIndex(0);
- if (!container_sp)
+ // Navigate "down" to std::_Variant_base by finding the holder of "_Which".
+ // This might be down a few levels if a variant member isn't trivially
+ // destructible/copyable/etc.
+ ValueObjectSP which_sp = outer.GetChildMemberWithName("_Which");
Michael137 wrote:
Is this related to making it run with PDB? Or is this about handling more kinds
of variant layouts in general? Is that where the additional test-case comes
from? If it's the latter I'd prefer it if we split it into a separate PR
https://github.com/llvm/llvm-project/pull/171489
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix toolchain-msvc.test for native ARM64 MSVC environment (PR #171797)
@@ -23,15 +23,15 @@ RUN:| FileCheck --check-prefix=64BIT %s
32BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.pdb
32BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.exe
32BIT: compiling foobar.c -> foo.exe-foobar.obj
-32BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x86|arm)}}\cl.{{EXE|exe}}
+32BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|arm)}}\cl.{{EXE|exe}}
32BIT: linking foo.exe-foobar.obj -> foo.exe
-32BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x86|arm)}}\link.{{EXE|exe}}
+32BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|arm)}}\link.{{EXE|exe}}
32BIT: Env
32BIT: LIB = {{.*}}\ATLMFC\lib\{{(x86|arm)}}
32BIT: {{.*}}\lib\{{(x86|arm)}}
32BIT: {{.*}}\ucrt\{{(x86|arm)}}
32BIT: {{.*}}\um\{{(x86|arm)}}
-32BIT: PATH = {{.*}}\bin\{{[Hh]ost[Xx](64|86)}}\{{(x86|x64)}}
+32BIT: PATH =
{{.*}}\bin\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|x64|arm64)}}
omjavaid wrote:
On 64bit host path was hostarm64 while on 32bit it was hostARM64. But lower
case is fairly consistent on target arch path (second one)
https://github.com/llvm/llvm-project/pull/171797
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix toolchain-msvc.test for native ARM64 MSVC environment (PR #171797)
@@ -51,12 +51,12 @@ RUN:| FileCheck --check-prefix=64BIT %s
64BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.pdb
64BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.exe
64BIT: compiling foobar.c -> foo.exe-foobar.obj
-64BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x64|arm64)}}\cl.{{EXE|exe}}
+64BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x64|arm64)}}\cl.{{EXE|exe}}
64BIT: linking foo.exe-foobar.obj -> foo.exe
-64BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x64|arm64)}}\link.{{EXE|exe}}
+64BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x64|arm64)}}\link.{{EXE|exe}}
omjavaid wrote:
Likewise
https://github.com/llvm/llvm-project/pull/171797
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] c89d87a - [lldb][test] Fix toolchain-msvc.test for native ARM64 MSVC environment (#171797)
Author: Omair Javaid
Date: 2025-12-11T16:15:10+05:00
New Revision: c89d87a512ed5b4bfeedb5d7ae22ae8cba1b123a
URL:
https://github.com/llvm/llvm-project/commit/c89d87a512ed5b4bfeedb5d7ae22ae8cba1b123a
DIFF:
https://github.com/llvm/llvm-project/commit/c89d87a512ed5b4bfeedb5d7ae22ae8cba1b123a.diff
LOG: [lldb][test] Fix toolchain-msvc.test for native ARM64 MSVC environment
(#171797)
This patch fixes toolchain-msvc.test on Windows ARM64 hosts running
under native ARM64 environment via vcvarsarm64.bat. Our lab buildbot
recently switched from using cross vcvarsamd64_arm64.bat environment to
native vcvarsarm64.bat. This patch updates FileCheck patterns to also
allow HostARM64 and arm64 PATH entries.
Changes:
-> Extend host regex to match HostARM64 (case-insensitive)
-> Allow arm64 in PATH tail.
-> Apply same fix in both 32-bit and 64-bit sections.
Added:
Modified:
lldb/test/Shell/BuildScript/toolchain-msvc.test
Removed:
diff --git a/lldb/test/Shell/BuildScript/toolchain-msvc.test
b/lldb/test/Shell/BuildScript/toolchain-msvc.test
index dce87d5aee2af..bde895fa6dbaf 100644
--- a/lldb/test/Shell/BuildScript/toolchain-msvc.test
+++ b/lldb/test/Shell/BuildScript/toolchain-msvc.test
@@ -23,15 +23,15 @@ RUN:| FileCheck --check-prefix=64BIT %s
32BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.pdb
32BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.exe
32BIT: compiling foobar.c -> foo.exe-foobar.obj
-32BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x86|arm)}}\cl.{{EXE|exe}}
+32BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|arm)}}\cl.{{EXE|exe}}
32BIT: linking foo.exe-foobar.obj -> foo.exe
-32BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x86|arm)}}\link.{{EXE|exe}}
+32BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|arm)}}\link.{{EXE|exe}}
32BIT: Env
32BIT: LIB = {{.*}}\ATLMFC\lib\{{(x86|arm)}}
32BIT: {{.*}}\lib\{{(x86|arm)}}
32BIT: {{.*}}\ucrt\{{(x86|arm)}}
32BIT: {{.*}}\um\{{(x86|arm)}}
-32BIT: PATH = {{.*}}\bin\{{[Hh]ost[Xx](64|86)}}\{{(x86|x64)}}
+32BIT: PATH =
{{.*}}\bin\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|x64|arm64)}}
64BIT: Script Arguments:
@@ -51,12 +51,12 @@ RUN:| FileCheck --check-prefix=64BIT %s
64BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.pdb
64BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.exe
64BIT: compiling foobar.c -> foo.exe-foobar.obj
-64BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x64|arm64)}}\cl.{{EXE|exe}}
+64BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x64|arm64)}}\cl.{{EXE|exe}}
64BIT: linking foo.exe-foobar.obj -> foo.exe
-64BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x64|arm64)}}\link.{{EXE|exe}}
+64BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x64|arm64)}}\link.{{EXE|exe}}
64BIT: Env
64BIT: LIB = {{.*}}\ATLMFC\lib\{{(x64|arm64)}}
64BIT: {{.*}}\lib\{{(x64|arm64)}}
64BIT: {{.*}}\ucrt\{{(x64|arm64)}}
64BIT: {{.*}}\um\{{(x64|arm64)}}
-64BIT: PATH = {{.*}}\bin\{{[Hh]ost[Xx](64|86)}}\{{(x86|x64)}}
+64BIT: PATH =
{{.*}}\bin\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|x64|arm64)}}
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] improve the heuristics for checking if a terminal supports Unicode (PR #171832)
github-actions[bot] wrote:
# :penguin: Linux x64 Test Results
* 33219 tests passed
* 506 tests skipped
* 3 tests failed
## Failed Tests
(click on a test name to see its output)
### lldb-shell
lldb-shell.Commands/command-dwim-print.test
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
echo quit |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/lldb
--no-lldbinit -S
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/lldb/test/Shell/lit-lldb-init-quiet
-o "dwim-print a"|
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck
/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/Shell/Commands/command-dwim-print.test
--strict-whitespace --check-prefix=CHECK1
# executed command: echo quit
# note: command had no output on stdout or stderr
# executed command:
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/lldb
--no-lldbinit -S
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/lldb/test/Shell/lit-lldb-init-quiet
-o 'dwim-print a'
# note: command had no output on stdout or stderr
# executed command:
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck
/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/Shell/Commands/command-dwim-print.test
--strict-whitespace --check-prefix=CHECK1
# .---command stderr
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/Shell/Commands/command-dwim-print.test:5:11:
error: CHECK1: expected string not found in input
# | # CHECK1: {{^ (╰─)? error: use of undeclared identifier
'a'}}
# | :5:20: note: scanning from here
# | ^
# |^
# | :6:19: note: possible intended match here
# | error: use of undeclared identifier 'a'
# | ^
# |
# | Input file:
# | Check file:
/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/Shell/Commands/command-dwim-print.test
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<
# |1: (lldb) command source -s 0
'/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/lldb/test/Shell/lit-lldb-init-quiet'
# |2: Executing commands in
'/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/lldb/test/Shell/lit-lldb-init-quiet'.
# |3: (lldb) command source -C --silent-run true lit-lldb-init
# |4: (lldb) dwim-print a
# |5: ^
# | check:5'0X error: no match found
# |6: error: use of undeclared identifier 'a'
# | check:5'0 ~~
# | check:5'1 ?
possible intended match
# |7: note: Falling back to default language. Ran expression as
'Objective C++'.
# | check:5'0
~~~
# |8: (lldb) quit
# | check:5'0
# | >>
# `-
# error: command failed with exit status: 1
--
```
lldb-shell.Commands/command-expr-diagnostics.test
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
echo quit |
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/lldb
--no-lldbinit -S
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/lldb/test/Shell/lit-lldb-init-quiet
-o "expression a+b"|
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck
/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/Shell/Commands/command-expr-diagnostics.test
--strict-whitespace --check-prefix=CHECK1
# executed command: echo quit
# note: command had no output on stdout or stderr
# executed command:
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/lldb
--no-lldbinit -S
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/lldb/test/Shell/lit-lldb-init-quiet
-o 'expression a+b'
# note: command had no output on stdout or stderr
# executed command:
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck
/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/Shell/Commands/command-expr-diagnostics.test
--strict-whitespace --check-prefix=CHECK1
# .---command stderr
# |
/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/Shell/Commands/command-expr-diagnostics.test:5:11:
error: CHECK1: expected string not found in input
# | # CHECK1: {{^ (\||│) (╰─)? error: use of undeclared
identifier 'b'}}
# | :5:22: note: scanning from here
# | ^ ^
# | ^
# | :6:19: note: possible intended match here
# | | error: use of undeclared identifier 'b'
# | ^
# |
# | Input file:
#
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
@@ -740,16 +764,182 @@ Interpreter::Visit(const BooleanLiteralNode *node) {
return ValueObject::CreateValueObjectFromBool(m_target, value, "result");
}
+llvm::Expected
+Interpreter::VerifyCastType(lldb::ValueObjectSP operand, CompilerType op_type,
+CompilerType target_type, int location) {
Michael137 wrote:
Why pass the `op_type` separately? Can't we just derive it from `operand` in
this function?
Also can we rename `op_type` to `source_type`? I find that's an easier
counter-part to `target_type` when reading the code
https://github.com/llvm/llvm-project/pull/170332
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
@@ -740,16 +764,182 @@ Interpreter::Visit(const BooleanLiteralNode *node) {
return ValueObject::CreateValueObjectFromBool(m_target, value, "result");
}
+llvm::Expected
+Interpreter::VerifyCastType(lldb::ValueObjectSP operand, CompilerType op_type,
+CompilerType target_type, int location) {
+
+ if (target_type.IsScalarType()) {
+if (op_type.IsPointerType() || op_type.IsNullPtrType()) {
+ // Cast from pointer to float/double is not allowed.
+ if (target_type.IsFloat()) {
+std::string errMsg = llvm::formatv(
+"Cast from {0} to {1} is not allowed", op_type.TypeDescription(),
+target_type.TypeDescription());
+return llvm::make_error(
+m_expr, std::move(errMsg), location,
+op_type.TypeDescription().length());
+ }
+ // Casting pointer to bool is valid. Otherwise check if the result type
+ // is at least as big as the pointer size.
+ uint64_t type_byte_size = 0;
+ uint64_t rhs_type_byte_size = 0;
+ if (auto temp = target_type.GetByteSize(m_exe_ctx_scope.get()))
+type_byte_size = *temp;
+ if (auto temp = op_type.GetByteSize(m_exe_ctx_scope.get()))
+rhs_type_byte_size = *temp;
+ if (!target_type.IsBoolean() && type_byte_size < rhs_type_byte_size) {
+std::string errMsg = llvm::formatv(
+"cast from pointer to smaller type {0} loses information",
+target_type.TypeDescription());
+return llvm::make_error(
+m_expr, std::move(errMsg), location,
+op_type.TypeDescription().length());
+ }
+} else if (!op_type.IsScalarType() && !op_type.IsEnumerationType()) {
+ // Otherwise accept only arithmetic types and enums.
+ std::string errMsg = llvm::formatv(
+ "cannot convert {0} to {1} without a conversion operator",
Michael137 wrote:
I'm not sure DIL should be responsible for dealing with casts through
conversion operators. At that point we're re-implementing Clang's casting
logic. For these kinds of casts i think deferring to the expression evaluator
is the most appropriate (maybe we should say so in the errornot sure)
https://github.com/llvm/llvm-project/pull/170332
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
@@ -40,12 +40,21 @@ enum class UnaryOpKind {
/// The type casts allowed by DIL.
enum class CastKind {
+ eArithmetic, ///< Casting to a scalar.
eEnumeration, ///< Casting from a scalar to an enumeration type
eNullptr, ///< Casting to a nullptr type
+ ePointer, ///< Casting to a pointer type.
eReference, ///< Casting to a reference type
- eNone,///< Type promotion casting
+ eNone,///< Invalid promotion type (results in error).
};
+/// Promotions allowed for type casts in DIL.
+//enum CastPromotionKind {
+// eArithmetic, ///< Casting to a scalar.
+// ePointer,///< Casting to a pointer type.
+// eNone, ///< Invalid promotion type (results in error).
+//};
+
Michael137 wrote:
Is this meant to be here?
https://github.com/llvm/llvm-project/pull/170332
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
@@ -740,16 +764,182 @@ Interpreter::Visit(const BooleanLiteralNode *node) {
return ValueObject::CreateValueObjectFromBool(m_target, value, "result");
}
+llvm::Expected
+Interpreter::VerifyCastType(lldb::ValueObjectSP operand, CompilerType op_type,
+CompilerType target_type, int location) {
+
+ if (target_type.IsScalarType()) {
+if (op_type.IsPointerType() || op_type.IsNullPtrType()) {
+ // Cast from pointer to float/double is not allowed.
+ if (target_type.IsFloat()) {
+std::string errMsg = llvm::formatv(
+"Cast from {0} to {1} is not allowed", op_type.TypeDescription(),
+target_type.TypeDescription());
+return llvm::make_error(
+m_expr, std::move(errMsg), location,
+op_type.TypeDescription().length());
+ }
+ // Casting pointer to bool is valid. Otherwise check if the result type
+ // is at least as big as the pointer size.
+ uint64_t type_byte_size = 0;
+ uint64_t rhs_type_byte_size = 0;
+ if (auto temp = target_type.GetByteSize(m_exe_ctx_scope.get()))
+type_byte_size = *temp;
+ if (auto temp = op_type.GetByteSize(m_exe_ctx_scope.get()))
+rhs_type_byte_size = *temp;
+ if (!target_type.IsBoolean() && type_byte_size < rhs_type_byte_size) {
+std::string errMsg = llvm::formatv(
+"cast from pointer to smaller type {0} loses information",
+target_type.TypeDescription());
+return llvm::make_error(
+m_expr, std::move(errMsg), location,
+op_type.TypeDescription().length());
+ }
+} else if (!op_type.IsScalarType() && !op_type.IsEnumerationType()) {
+ // Otherwise accept only arithmetic types and enums.
+ std::string errMsg = llvm::formatv(
+ "cannot convert {0} to {1} without a conversion operator",
Michael137 wrote:
Does that mean if a user implementerd a conversion operator than the cast would
work? If that's not the case, I wouldn't mention it in the error
https://github.com/llvm/llvm-project/pull/170332
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
@@ -43,7 +65,8 @@ static CompilerType GetBasicType(lldb::TypeSystemSP
type_system,
}
static lldb::ValueObjectSP
-ArrayToPointerConversion(ValueObject &valobj, ExecutionContextScope &ctx) {
+ArrayToPointerConversion(ValueObject &valobj, ExecutionContextScope &ctx,
+ llvm::StringRef name) {
Michael137 wrote:
This new parameter is unused. Did you mean to pass it to
`CreateValueObjectFromAddress`?
https://github.com/llvm/llvm-project/pull/170332
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
@@ -740,16 +764,182 @@ Interpreter::Visit(const BooleanLiteralNode *node) {
return ValueObject::CreateValueObjectFromBool(m_target, value, "result");
}
+llvm::Expected
+Interpreter::VerifyCastType(lldb::ValueObjectSP operand, CompilerType op_type,
+CompilerType target_type, int location) {
+
+ if (target_type.IsScalarType()) {
+if (op_type.IsPointerType() || op_type.IsNullPtrType()) {
+ // Cast from pointer to float/double is not allowed.
+ if (target_type.IsFloat()) {
+std::string errMsg = llvm::formatv(
+"Cast from {0} to {1} is not allowed", op_type.TypeDescription(),
+target_type.TypeDescription());
+return llvm::make_error(
+m_expr, std::move(errMsg), location,
+op_type.TypeDescription().length());
+ }
+ // Casting pointer to bool is valid. Otherwise check if the result type
+ // is at least as big as the pointer size.
+ uint64_t type_byte_size = 0;
+ uint64_t rhs_type_byte_size = 0;
+ if (auto temp = target_type.GetByteSize(m_exe_ctx_scope.get()))
+type_byte_size = *temp;
+ if (auto temp = op_type.GetByteSize(m_exe_ctx_scope.get()))
+rhs_type_byte_size = *temp;
Michael137 wrote:
We should probably return an error if we didn't manage to read the size here?
https://github.com/llvm/llvm-project/pull/170332
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
@@ -740,16 +764,182 @@ Interpreter::Visit(const BooleanLiteralNode *node) {
return ValueObject::CreateValueObjectFromBool(m_target, value, "result");
}
+llvm::Expected
+Interpreter::VerifyCastType(lldb::ValueObjectSP operand, CompilerType op_type,
+CompilerType target_type, int location) {
+
+ if (target_type.IsScalarType()) {
+if (op_type.IsPointerType() || op_type.IsNullPtrType()) {
+ // Cast from pointer to float/double is not allowed.
+ if (target_type.IsFloat()) {
+std::string errMsg = llvm::formatv(
+"Cast from {0} to {1} is not allowed", op_type.TypeDescription(),
+target_type.TypeDescription());
+return llvm::make_error(
+m_expr, std::move(errMsg), location,
+op_type.TypeDescription().length());
+ }
+ // Casting pointer to bool is valid. Otherwise check if the result type
+ // is at least as big as the pointer size.
Michael137 wrote:
I would have an early return here:
```
if (target_type.IsBoolean())
return CastKind::eArithmetic;
```
Makes the logic easier to read imo
https://github.com/llvm/llvm-project/pull/170332
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
@@ -740,16 +764,182 @@ Interpreter::Visit(const BooleanLiteralNode *node) {
return ValueObject::CreateValueObjectFromBool(m_target, value, "result");
}
+llvm::Expected
+Interpreter::VerifyCastType(lldb::ValueObjectSP operand, CompilerType op_type,
+CompilerType target_type, int location) {
+
+ if (target_type.IsScalarType()) {
+if (op_type.IsPointerType() || op_type.IsNullPtrType()) {
+ // Cast from pointer to float/double is not allowed.
+ if (target_type.IsFloat()) {
+std::string errMsg = llvm::formatv(
+"Cast from {0} to {1} is not allowed", op_type.TypeDescription(),
+target_type.TypeDescription());
+return llvm::make_error(
+m_expr, std::move(errMsg), location,
+op_type.TypeDescription().length());
+ }
+ // Casting pointer to bool is valid. Otherwise check if the result type
+ // is at least as big as the pointer size.
+ uint64_t type_byte_size = 0;
+ uint64_t rhs_type_byte_size = 0;
+ if (auto temp = target_type.GetByteSize(m_exe_ctx_scope.get()))
+type_byte_size = *temp;
+ if (auto temp = op_type.GetByteSize(m_exe_ctx_scope.get()))
+rhs_type_byte_size = *temp;
+ if (!target_type.IsBoolean() && type_byte_size < rhs_type_byte_size) {
+std::string errMsg = llvm::formatv(
+"cast from pointer to smaller type {0} loses information",
+target_type.TypeDescription());
+return llvm::make_error(
+m_expr, std::move(errMsg), location,
+op_type.TypeDescription().length());
+ }
+} else if (!op_type.IsScalarType() && !op_type.IsEnumerationType()) {
+ // Otherwise accept only arithmetic types and enums.
+ std::string errMsg = llvm::formatv(
+ "cannot convert {0} to {1} without a conversion operator",
+ op_type.TypeDescription(), target_type.TypeDescription());
+
+ return llvm::make_error(
+ m_expr, std::move(errMsg), location,
+ op_type.TypeDescription().length());
+}
+return CastKind::eArithmetic;
+ }
+
+ if (target_type.IsEnumerationType()) {
+// Cast to enum type.
+if (!op_type.IsScalarType() && !op_type.IsEnumerationType()) {
+ std::string errMsg = llvm::formatv("Cast from {0} to {1} is not allowed",
+ op_type.TypeDescription(),
+ target_type.TypeDescription());
+
+ return llvm::make_error(
+ m_expr, std::move(errMsg), location,
+ op_type.TypeDescription().length());
+}
+return CastKind::eEnumeration;
+ }
+
+ if (target_type.IsPointerType()) {
+if (!op_type.IsInteger() && !op_type.IsEnumerationType() &&
+!op_type.IsArrayType() && !op_type.IsPointerType() &&
+!op_type.IsNullPtrType()) {
+ std::string errMsg = llvm::formatv(
+ "cannot cast from type {0} to pointer type {1}",
+ op_type.TypeDescription(), target_type.TypeDescription());
+
+ return llvm::make_error(
+ m_expr, std::move(errMsg), location,
+ op_type.TypeDescription().length());
+}
+return CastKind::ePointer;
+ }
+
+ if (target_type.IsNullPtrType()) {
+// Cast to nullptr type.
+bool is_signed;
+if (!target_type.IsNullPtrType() &&
Michael137 wrote:
This condition can never fire since we already checked
`target_type.IsNullPtrType()`
What's the intention behind these checks?
https://github.com/llvm/llvm-project/pull/170332
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
@@ -99,8 +122,9 @@ Interpreter::UnaryConversion(lldb::ValueObjectSP valobj,
uint32_t location) {
}
}
+ llvm::StringRef name = "result";
if (in_type.IsArrayType())
-valobj = ArrayToPointerConversion(*valobj, *m_exe_ctx_scope);
+valobj = ArrayToPointerConversion(*valobj, *m_exe_ctx_scope, name);
Michael137 wrote:
```suggestion
if (in_type.IsArrayType())
valobj = ArrayToPointerConversion(*valobj, *m_exe_ctx_scope, "result");
```
https://github.com/llvm/llvm-project/pull/170332
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
@@ -740,16 +764,182 @@ Interpreter::Visit(const BooleanLiteralNode *node) {
return ValueObject::CreateValueObjectFromBool(m_target, value, "result");
}
+llvm::Expected
+Interpreter::VerifyCastType(lldb::ValueObjectSP operand, CompilerType op_type,
+CompilerType target_type, int location) {
+
+ if (target_type.IsScalarType()) {
Michael137 wrote:
Can we put everything that's inside this `target_type.IsScalarType()` if-block
into a helper. Call it, e.g., `VerifyArithmeticCastType` or something
https://github.com/llvm/llvm-project/pull/170332
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
https://github.com/Michael137 commented: Looks better, left some more comments https://github.com/llvm/llvm-project/pull/170332 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 2 or 3 (PR #170332)
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/170332 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Fix toolchain-msvc.test for native ARM64 MSVC environment (PR #171797)
https://github.com/omjavaid created
https://github.com/llvm/llvm-project/pull/171797
This patch fixes toolchain-msvc.test on Windows ARM64 hosts running under
native ARM64 environment via vcvarsarm64.bat. Our lab buildbot recently
switched from using cross vcvarsamd64_arm64.bat environment to native
vcvarsarm64.bat. This patch updates FileCheck patterns to also allow HostARM64
and arm64 PATH entries.
Changes:
-> Extend host regex to match HostARM64 (case-insensitive)
-> Allow arm64 in PATH tail.
-> Apply same fix in both 32-bit and 64-bit sections.
>From 1d9c3418272efb7b6362816181c680879773dbb0 Mon Sep 17 00:00:00 2001
From: Muhammad Omair Javaid
Date: Thu, 11 Dec 2025 15:10:40 +0500
Subject: [PATCH] Fix toolchain-msvc.test for native ARM64 MSVC env
This patch fixes toolchain-msvc.test on Windows ARM64 hosts running
under native ARM64 environment via vcvarsarm64.bat. Our lab buildbot
recently switched from using cross vcvarsamd64_arm64.bat environment
to native vcvarsarm64.bat. This patch updates FileCheck patterns to
also allow HostARM64 and arm64 PATH entries.
Changes:
-> Extend host regex to match HostARM64 (case-insensitive).
-> Allow arm64 in PATH tail.
-> Apply same fix in both 32-bit and 64-bit sections.
---
lldb/test/Shell/BuildScript/toolchain-msvc.test | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lldb/test/Shell/BuildScript/toolchain-msvc.test
b/lldb/test/Shell/BuildScript/toolchain-msvc.test
index dce87d5aee2af..bde895fa6dbaf 100644
--- a/lldb/test/Shell/BuildScript/toolchain-msvc.test
+++ b/lldb/test/Shell/BuildScript/toolchain-msvc.test
@@ -23,15 +23,15 @@ RUN:| FileCheck --check-prefix=64BIT %s
32BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.pdb
32BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.exe
32BIT: compiling foobar.c -> foo.exe-foobar.obj
-32BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x86|arm)}}\cl.{{EXE|exe}}
+32BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|arm)}}\cl.{{EXE|exe}}
32BIT: linking foo.exe-foobar.obj -> foo.exe
-32BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x86|arm)}}\link.{{EXE|exe}}
+32BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|arm)}}\link.{{EXE|exe}}
32BIT: Env
32BIT: LIB = {{.*}}\ATLMFC\lib\{{(x86|arm)}}
32BIT: {{.*}}\lib\{{(x86|arm)}}
32BIT: {{.*}}\ucrt\{{(x86|arm)}}
32BIT: {{.*}}\um\{{(x86|arm)}}
-32BIT: PATH = {{.*}}\bin\{{[Hh]ost[Xx](64|86)}}\{{(x86|x64)}}
+32BIT: PATH =
{{.*}}\bin\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|x64|arm64)}}
64BIT: Script Arguments:
@@ -51,12 +51,12 @@ RUN:| FileCheck --check-prefix=64BIT %s
64BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.pdb
64BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.exe
64BIT: compiling foobar.c -> foo.exe-foobar.obj
-64BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x64|arm64)}}\cl.{{EXE|exe}}
+64BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x64|arm64)}}\cl.{{EXE|exe}}
64BIT: linking foo.exe-foobar.obj -> foo.exe
-64BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x64|arm64)}}\link.{{EXE|exe}}
+64BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x64|arm64)}}\link.{{EXE|exe}}
64BIT: Env
64BIT: LIB = {{.*}}\ATLMFC\lib\{{(x64|arm64)}}
64BIT: {{.*}}\lib\{{(x64|arm64)}}
64BIT: {{.*}}\ucrt\{{(x64|arm64)}}
64BIT: {{.*}}\um\{{(x64|arm64)}}
-64BIT: PATH = {{.*}}\bin\{{[Hh]ost[Xx](64|86)}}\{{(x86|x64)}}
+64BIT: PATH =
{{.*}}\bin\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|x64|arm64)}}
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Fix toolchain-msvc.test for native ARM64 MSVC environment (PR #171797)
llvmbot wrote:
@llvm/pr-subscribers-lldb
Author: Omair Javaid (omjavaid)
Changes
This patch fixes toolchain-msvc.test on Windows ARM64 hosts running under
native ARM64 environment via vcvarsarm64.bat. Our lab buildbot recently
switched from using cross vcvarsamd64_arm64.bat environment to native
vcvarsarm64.bat. This patch updates FileCheck patterns to also allow HostARM64
and arm64 PATH entries.
Changes:
-> Extend host regex to match HostARM64 (case-insensitive)
-> Allow arm64 in PATH tail.
-> Apply same fix in both 32-bit and 64-bit sections.
---
Full diff: https://github.com/llvm/llvm-project/pull/171797.diff
1 Files Affected:
- (modified) lldb/test/Shell/BuildScript/toolchain-msvc.test (+6-6)
``diff
diff --git a/lldb/test/Shell/BuildScript/toolchain-msvc.test
b/lldb/test/Shell/BuildScript/toolchain-msvc.test
index dce87d5aee2af..bde895fa6dbaf 100644
--- a/lldb/test/Shell/BuildScript/toolchain-msvc.test
+++ b/lldb/test/Shell/BuildScript/toolchain-msvc.test
@@ -23,15 +23,15 @@ RUN:| FileCheck --check-prefix=64BIT %s
32BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.pdb
32BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.exe
32BIT: compiling foobar.c -> foo.exe-foobar.obj
-32BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x86|arm)}}\cl.{{EXE|exe}}
+32BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|arm)}}\cl.{{EXE|exe}}
32BIT: linking foo.exe-foobar.obj -> foo.exe
-32BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x86|arm)}}\link.{{EXE|exe}}
+32BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|arm)}}\link.{{EXE|exe}}
32BIT: Env
32BIT: LIB = {{.*}}\ATLMFC\lib\{{(x86|arm)}}
32BIT: {{.*}}\lib\{{(x86|arm)}}
32BIT: {{.*}}\ucrt\{{(x86|arm)}}
32BIT: {{.*}}\um\{{(x86|arm)}}
-32BIT: PATH = {{.*}}\bin\{{[Hh]ost[Xx](64|86)}}\{{(x86|x64)}}
+32BIT: PATH =
{{.*}}\bin\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|x64|arm64)}}
64BIT: Script Arguments:
@@ -51,12 +51,12 @@ RUN:| FileCheck --check-prefix=64BIT %s
64BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.pdb
64BIT: Cleaning {{.*}}toolchain-msvc.test.tmp\foo.exe
64BIT: compiling foobar.c -> foo.exe-foobar.obj
-64BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x64|arm64)}}\cl.{{EXE|exe}}
+64BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x64|arm64)}}\cl.{{EXE|exe}}
64BIT: linking foo.exe-foobar.obj -> foo.exe
-64BIT: Command Line:
{{.*}}\{{[Hh]ost[Xx](64|86)}}\{{(x64|arm64)}}\link.{{EXE|exe}}
+64BIT: Command Line:
{{.*}}\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x64|arm64)}}\link.{{EXE|exe}}
64BIT: Env
64BIT: LIB = {{.*}}\ATLMFC\lib\{{(x64|arm64)}}
64BIT: {{.*}}\lib\{{(x64|arm64)}}
64BIT: {{.*}}\ucrt\{{(x64|arm64)}}
64BIT: {{.*}}\um\{{(x64|arm64)}}
-64BIT: PATH = {{.*}}\bin\{{[Hh]ost[Xx](64|86)}}\{{(x86|x64)}}
+64BIT: PATH =
{{.*}}\bin\{{[Hh]ost([Xx](64|86)|(arm64|ARM64))}}\{{(x86|x64|arm64)}}
``
https://github.com/llvm/llvm-project/pull/171797
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
