[Lldb-commits] [lldb] [lldb] Add config and decorator for wide character support in Editline (PR #66447)

via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 14 16:51:26 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb
            
<details>
<summary>Changes</summary>
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.
--
Full diff: https://github.com/llvm/llvm-project/pull/66447.diff

3 Files Affected:

- (modified) lldb/packages/Python/lldbsuite/test/decorators.py (+4) 
- (modified) lldb/source/API/SBDebugger.cpp (+3) 
- (modified) lldb/test/API/terminal/TestEditline.py (+1) 


<pre>
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(&quot;editline&quot;)(func)
 
 
+def skipIfEditlineWideCharSupportMissing(func):
+    return _get_bool_config_skip_if_decorator(&quot;editline_wchar&quot;)(func)
+
+
 def skipIfFBSDVMCoreSupportMissing(func):
     return _get_bool_config_skip_if_decorator(&quot;fbsdvmcore&quot;)(func)
 
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 5328e079564f322..0c4b8ca1617abbe 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -781,6 +781,9 @@ SBStructuredData SBDebugger::GetBuildConfiguration() {
   AddBoolConfigEntry(
       *config_up, &quot;editline&quot;, LLDB_ENABLE_LIBEDIT,
       &quot;A boolean value that indicates if editline support is enabled in LLDB&quot;);
+  AddBoolConfigEntry(
+      *config_up, &quot;editline_wchar&quot;, LLDB_EDITLINE_USE_WCHAR,
+      &quot;A boolean value that indicates if editline  wide characters support is enabled in LLDB&quot;);
   AddBoolConfigEntry(
       *config_up, &quot;lzma&quot;, LLDB_ENABLE_LZMA,
       &quot;A boolean value that indicates if lzma support is enabled in LLDB&quot;);
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):
         &quot;&quot;&quot;Test that we can use Unicode in the LLDB prompt.&quot;&quot;&quot;
         self.launch(use_colors=True, encoding=&quot;utf-8&quot;)
</pre>
</details>


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


More information about the lldb-commits mailing list