[Lldb-commits] [PATCH] D158452: [lldb/crashlog] Fix python version requirement issue

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 21 13:32:47 PDT 2023


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 <ismail at 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",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158452.552120.patch
Type: text/x-patch
Size: 1086 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230821/7e299938/attachment-0001.bin>


More information about the lldb-commits mailing list