[Lldb-commits] [lldb] [lldb] Add config and decorator for wide character support in Editline (PR #66447)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu Sep 14 17:11:12 PDT 2023
https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/66447:
>From 1d9a7f7302b57883d316205967904268e0e54e59 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Thu, 14 Sep 2023 16:47:49 -0700
Subject: [PATCH] [lldb] Add config and decorator for wide character support in
Editline
Add a configuration entry for whether LLDB was configured with wide
character support in Editline and use it in a decorator to guard the
UTF-8 prompt test.
---
lldb/packages/Python/lldbsuite/test/decorators.py | 4 ++++
lldb/source/API/SBDebugger.cpp | 3 +++
lldb/test/API/terminal/TestEditline.py | 1 +
3 files changed, 8 insertions(+)
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index 5562130aa34079c..6194862f8fe60f9 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -1027,6 +1027,10 @@ def skipIfEditlineSupportMissing(func):
return _get_bool_config_skip_if_decorator("editline")(func)
+def skipIfEditlineWideCharSupportMissing(func):
+ return _get_bool_config_skip_if_decorator("editline_wchar")(func)
+
+
def skipIfFBSDVMCoreSupportMissing(func):
return _get_bool_config_skip_if_decorator("fbsdvmcore")(func)
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 5328e079564f322..fbcf30e67fc1cd5 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -781,6 +781,9 @@ SBStructuredData SBDebugger::GetBuildConfiguration() {
AddBoolConfigEntry(
*config_up, "editline", LLDB_ENABLE_LIBEDIT,
"A boolean value that indicates if editline support is enabled in LLDB");
+ AddBoolConfigEntry(*config_up, "editline_wchar", LLDB_EDITLINE_USE_WCHAR,
+ "A boolean value that indicates if editline wide "
+ "characters support is enabled in LLDB");
AddBoolConfigEntry(
*config_up, "lzma", LLDB_ENABLE_LZMA,
"A boolean value that indicates if lzma support is enabled in LLDB");
diff --git a/lldb/test/API/terminal/TestEditline.py b/lldb/test/API/terminal/TestEditline.py
index 0c6d16ff66da04e..aa7d827e5994413 100644
--- a/lldb/test/API/terminal/TestEditline.py
+++ b/lldb/test/API/terminal/TestEditline.py
@@ -47,6 +47,7 @@ def test_left_right_arrow(self):
@skipIfAsan
@skipIfEditlineSupportMissing
+ @skipIfEditlineWideCharSupportMissing
def test_prompt_unicode(self):
"""Test that we can use Unicode in the LLDB prompt."""
self.launch(use_colors=True, encoding="utf-8")
More information about the lldb-commits
mailing list