This revision was automatically updated to reflect the committed changes.
Closed by commit rG3f3db135251c: [lldb/crashlog] Add `-V|--version` option 
(authored by mib).

Changed prior to commit:
  https://reviews.llvm.org/D131542?vs=451358&id=451669#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131542/new/

https://reviews.llvm.org/D131542

Files:
  lldb/examples/python/crashlog.py
  
lldb/test/Shell/ScriptInterpreter/Python/Crashlog/interactive_crashlog_invalid_target.test


Index: 
lldb/test/Shell/ScriptInterpreter/Python/Crashlog/interactive_crashlog_invalid_target.test
===================================================================
--- 
lldb/test/Shell/ScriptInterpreter/Python/Crashlog/interactive_crashlog_invalid_target.test
+++ 
lldb/test/Shell/ScriptInterpreter/Python/Crashlog/interactive_crashlog_invalid_target.test
@@ -1,8 +1,11 @@
 # REQUIRES: python, native && target-aarch64 && system-darwin
 
 # RUN: %lldb -o 'command script import lldb.macosx.crashlog' \
+# RUN: -o 'crashlog -V' \
 # RUN: -o 'crashlog -a -i -t /this_file_does_not_exist 
%S/Inputs/interactive_crashlog/multithread-test.ips' 2>&1 | FileCheck %s
 
 # CHECK: "crashlog" {{.*}} commands have been installed, use the "--help" 
options on these commands
 
+# CHECK: lldb{{.*}}version
+
 # CHECK: error: couldn't create target provided by the user 
(/this_file_does_not_exist)
Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -1089,6 +1089,13 @@
     usage = "usage: %prog [options] <FILE> [FILE ...]"
     option_parser = optparse.OptionParser(
         description=description, prog='crashlog', usage=usage)
+    option_parser.add_option(
+        '--version',
+        '-V',
+        dest='version',
+        action='store_true',
+        help='Show crashlog version',
+        default=False)
     option_parser.add_option(
         '--verbose',
         '-v',
@@ -1233,6 +1240,10 @@
     except:
         return
 
+    if options.version:
+        print(debugger.GetVersionString())
+        return
+
     if options.debug:
         print('command_args = %s' % command_args)
         print('options', options)


Index: lldb/test/Shell/ScriptInterpreter/Python/Crashlog/interactive_crashlog_invalid_target.test
===================================================================
--- lldb/test/Shell/ScriptInterpreter/Python/Crashlog/interactive_crashlog_invalid_target.test
+++ lldb/test/Shell/ScriptInterpreter/Python/Crashlog/interactive_crashlog_invalid_target.test
@@ -1,8 +1,11 @@
 # REQUIRES: python, native && target-aarch64 && system-darwin
 
 # RUN: %lldb -o 'command script import lldb.macosx.crashlog' \
+# RUN: -o 'crashlog -V' \
 # RUN: -o 'crashlog -a -i -t /this_file_does_not_exist %S/Inputs/interactive_crashlog/multithread-test.ips' 2>&1 | FileCheck %s
 
 # CHECK: "crashlog" {{.*}} commands have been installed, use the "--help" options on these commands
 
+# CHECK: lldb{{.*}}version
+
 # CHECK: error: couldn't create target provided by the user (/this_file_does_not_exist)
Index: lldb/examples/python/crashlog.py
===================================================================
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -1089,6 +1089,13 @@
     usage = "usage: %prog [options] <FILE> [FILE ...]"
     option_parser = optparse.OptionParser(
         description=description, prog='crashlog', usage=usage)
+    option_parser.add_option(
+        '--version',
+        '-V',
+        dest='version',
+        action='store_true',
+        help='Show crashlog version',
+        default=False)
     option_parser.add_option(
         '--verbose',
         '-v',
@@ -1233,6 +1240,10 @@
     except:
         return
 
+    if options.version:
+        print(debugger.GetVersionString())
+        return
+
     if options.debug:
         print('command_args = %s' % command_args)
         print('options', options)
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to