[Lldb-commits] [lldb] 31662e6 - [lldb/Util] Fix lldb-repro now it doesn't take a path to lldb

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 22 13:24:21 PST 2020


Author: Jonas Devlieghere
Date: 2020-01-22T13:24:12-08:00
New Revision: 31662e67e089264dabc9d1f915aa1d7b4d51c0a3

URL: https://github.com/llvm/llvm-project/commit/31662e67e089264dabc9d1f915aa1d7b4d51c0a3
DIFF: https://github.com/llvm/llvm-project/commit/31662e67e089264dabc9d1f915aa1d7b4d51c0a3.diff

LOG: [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.

Added: 
    

Modified: 
    lldb/utils/lldb-repro/lldb-repro.py

Removed: 
    


################################################################################
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 @@
 
 
 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


        


More information about the lldb-commits mailing list