[Lldb-commits] [lldb] Implement data formatters for LibStdC++ std::variant (PR #68012)

via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 2 11:08:01 PDT 2023


github-actions[bot] wrote:


<!--LLVM CODE FORMAT COMMENT: {darker}-->

:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r 2db8540a71ef546087158fcbf38e3b1883c5df48..e7e47a211ebaaa0f6380810b6573fadde12ca02d lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/variant/TestDataFormatterLibStdcxxVariant.py lldb/examples/synthetic/gnu_libstdcpp.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- examples/synthetic/gnu_libstdcpp.py	2023-10-02 17:53:17.000000 +0000
+++ examples/synthetic/gnu_libstdcpp.py	2023-10-02 18:07:54.852096 +0000
@@ -896,16 +896,11 @@
 
 def VariantSummaryProvider(valobj, dict):
     raw_obj = valobj.GetNonSyntheticValue()
     index_obj = raw_obj.GetChildMemberWithName("_M_index")
     data_obj = raw_obj.GetChildMemberWithName("_M_u")
-    if not (
-        index_obj
-        and index_obj.IsValid()
-        and data_obj
-        and data_obj.IsValid()
-    ):
+    if not (index_obj and index_obj.IsValid() and data_obj and data_obj.IsValid()):
         return "<Can't find _M_index or _M_u>"
 
     def get_variant_npos_value(index_byte_size):
         if index_byte_size == 1:
             return 0xFF

``````````

</details>


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


More information about the lldb-commits mailing list