summaryrefslogtreecommitdiff
path: root/lldb/examples
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2022-08-10 16:17:19 -0700
committerMed Ismail Bennani <medismail.bennani@gmail.com>2022-08-10 16:18:46 -0700
commit3f3db135251c85503fde681dd34e8ced0606aee2 (patch)
tree7b2bb54d187d4774c952f00468a3b379f9cdad64 /lldb/examples
parent27b1a8273dc9dc0f87fd7acc1b875e38ecd6b3bf (diff)
downloadllvm-3f3db135251c85503fde681dd34e8ced0606aee2.tar.gz
[lldb/crashlog] Add `-V|--version` option
This patch introduces a new option to the crashlog command to get the the script version. Since `crashlog.py` is not actually versioned, this returns lldb's version instead. rdar://98392669 Differential Revision: https://reviews.llvm.org/D131542 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/examples')
-rwxr-xr-xlldb/examples/python/crashlog.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 4773a136bfae..33f4c4f3b368 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -1090,6 +1090,13 @@ def CreateSymbolicateCrashLogOptions(
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',
action='store_true',
@@ -1233,6 +1240,10 @@ def SymbolicateCrashLogs(debugger, command_args, result):
except:
return
+ if options.version:
+ print(debugger.GetVersionString())
+ return
+
if options.debug:
print('command_args = %s' % command_args)
print('options', options)