summaryrefslogtreecommitdiff
path: root/lldb/utils
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2020-01-22 10:46:43 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2020-01-22 13:24:12 -0800
commit31662e67e089264dabc9d1f915aa1d7b4d51c0a3 (patch)
tree89eccdeb31afcc2d61b0c16eb1adf0a1ff1e3932 /lldb/utils
parent89c8866c0417a415ab546aa870569308f15b0ec8 (diff)
downloadllvm-31662e67e089264dabc9d1f915aa1d7b4d51c0a3.tar.gz
[lldb/Util] Fix lldb-repro now it doesn't take a path to lldb
The indices into the arguments array were off because we no longer pass the path to lldb as the first argument.
Diffstat (limited to 'lldb/utils')
-rwxr-xr-xlldb/utils/lldb-repro/lldb-repro.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/lldb/utils/lldb-repro/lldb-repro.py b/lldb/utils/lldb-repro/lldb-repro.py
index c925c474619e..f7579e8d14d3 100755
--- a/lldb/utils/lldb-repro/lldb-repro.py
+++ b/lldb/utils/lldb-repro/lldb-repro.py
@@ -21,17 +21,17 @@ import subprocess
def help():
- print("usage: {} capture|replay [args]".fmt(sys.argv[0]))
+ print("usage: {} capture|replay [args]".format(sys.argv[0]))
def main():
- if len(sys.argv) < 3:
+ if len(sys.argv) < 2:
help()
return 1
# Compute a hash based on the input arguments and the current working
# directory.
- args = ' '.join(sys.argv[3:])
+ args = ' '.join(sys.argv[2:])
cwd = os.getcwd()
input_hash = str(hash((cwd, args)))
@@ -40,15 +40,15 @@ def main():
# Create a new lldb invocation with capture or replay enabled.
lldb = os.path.join(os.path.dirname(sys.argv[0]), 'lldb')
- new_args = [sys.argv[1]]
- if sys.argv[2] == "replay":
+ new_args = [lldb]
+ if sys.argv[1] == "replay":
new_args.extend(['--replay', reproducer_path])
- elif sys.argv[2] == "capture":
+ elif sys.argv[1] == "capture":
new_args.extend([
'--capture', '--capture-path', reproducer_path,
'--reproducer-auto-generate'
])
- new_args.extend(sys.argv[1:])
+ new_args.extend(sys.argv[2:])
else:
help()
return 1