mib created this revision.
mib added reviewers: JDevlieghere, kastiglione, bulbazord.
mib added a project: LLDB.
Herald added a project: All.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

In 21a597c 
<https://reviews.llvm.org/rG21a597c31cb8ad03e18a293c73ecd7c498387ef8>, we fixed 
a module loading issue by using the new
`argparse.BooleanOptionalAction`. However, this is only available
starting python 3.9 and causes test failures on bots that don't fulfill
this requirement.

To address that, this patch replaces the use of `BooleanOptionalAction`
by a pair of 2 opposite `store` actions pointing to the same destination
variable.

Signed-off-by: Med Ismail Bennani <ism...@bennani.ma>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158452

Files:
  lldb/examples/python/crashlog.py


Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -1603,14 +1603,29 @@
         help="pause for NSEC seconds for debugger",
         default=0,
     )
+    # NOTE: Requires python 3.9
+    # arg_parser.add_argument(
+    #     "--crashed-only",
+    #     "-c",
+    #     action=argparse.BooleanOptionalAction,
+    #     dest="crashed_only",
+    #     help="only symbolicate the crashed thread",
+    #     default=True,
+    # )
     arg_parser.add_argument(
         "--crashed-only",
         "-c",
-        action=argparse.BooleanOptionalAction,
+        action="store_true",
         dest="crashed_only",
         help="only symbolicate the crashed thread",
         default=True,
     )
+    arg_parser.add_argument(
+        "--no-crashed-only",
+        action="store_false",
+        dest="crashed_only",
+        help="do not symbolicate the crashed thread",
+    )
     arg_parser.add_argument(
         "--disasm-depth",
         "-d",


Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -1603,14 +1603,29 @@
         help="pause for NSEC seconds for debugger",
         default=0,
     )
+    # NOTE: Requires python 3.9
+    # arg_parser.add_argument(
+    #     "--crashed-only",
+    #     "-c",
+    #     action=argparse.BooleanOptionalAction,
+    #     dest="crashed_only",
+    #     help="only symbolicate the crashed thread",
+    #     default=True,
+    # )
     arg_parser.add_argument(
         "--crashed-only",
         "-c",
-        action=argparse.BooleanOptionalAction,
+        action="store_true",
         dest="crashed_only",
         help="only symbolicate the crashed thread",
         default=True,
     )
+    arg_parser.add_argument(
+        "--no-crashed-only",
+        action="store_false",
+        dest="crashed_only",
+        help="do not symbolicate the crashed thread",
+    )
     arg_parser.add_argument(
         "--disasm-depth",
         "-d",
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH]... Med Ismail Bennani via Phabricator via lldb-commits

Reply via email to