[Lldb-commits] [lldb] r154728 - /lldb/trunk/examples/python/disasm-stress-test.py

Sean Callanan scallanan at apple.com
Fri Apr 13 18:06:06 PDT 2012


Author: spyffe
Date: Fri Apr 13 20:06:06 2012
New Revision: 154728

URL: http://llvm.org/viewvc/llvm-project?rev=154728&view=rev
Log:
Added a --lldb option to override the location
of LLDB.framework.

Modified:
    lldb/trunk/examples/python/disasm-stress-test.py

Modified: lldb/trunk/examples/python/disasm-stress-test.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/disasm-stress-test.py?rev=154728&r1=154727&r2=154728&view=diff
==============================================================================
--- lldb/trunk/examples/python/disasm-stress-test.py (original)
+++ lldb/trunk/examples/python/disasm-stress-test.py Fri Apr 13 20:06:06 2012
@@ -2,6 +2,21 @@
 
 import argparse, datetime, re, subprocess, sys, time
 
+parser = argparse.ArgumentParser(description="Run an exhaustive test of the LLDB disassembler for a specific architecture.")
+
+parser.add_argument('--arch', required=True, action='store', help='The architecture whose disassembler is to be tested')
+parser.add_argument('--bytes', required=True, action='store', type=int, help='The byte width of instructions for that architecture')
+parser.add_argument('--random', required=False, action='store_true', help='Enables non-sequential testing')
+parser.add_argument('--start', required=False, action='store', type=int, help='The first instruction value to test')
+parser.add_argument('--skip', required=False, action='store', type=int, help='The interval between instructions to test')
+parser.add_argument('--log', required=False, action='store', help='A log file to write the most recent instruction being tested')
+parser.add_argument('--time', required=False, action='store_true', help='Every 100,000 instructions, print an ETA to standard out')
+parser.add_argument('--lldb', required=False, action='store', help='The path to LLDB.framework, if LLDB should be overridden')
+
+arguments = sys.argv[1:]
+
+arg_ns = parser.parse_args(arguments)
+
 def AddLLDBToSysPathOnMacOSX():
     def GetLLDBFrameworkPath():
         lldb_path = subprocess.check_output(["xcrun", "-find", "lldb"])
@@ -19,24 +34,13 @@
     
     sys.path.append(lldb_framework_path + "/Resources/Python")
 
-AddLLDBToSysPathOnMacOSX()
+if arg_ns.lldb == None:
+    AddLLDBToSysPathOnMacOSX()
+else:
+    sys.path.append(arg_ns.lldb + "/Resources/Python")
 
 import lldb
 
-parser = argparse.ArgumentParser(description="Run an exhaustive test of the LLDB disassembler for a specific architecture.")
-
-parser.add_argument('--arch', required=True, action='store', help='The architecture whose disassembler is to be tested')
-parser.add_argument('--bytes', required=True, action='store', type=int, help='The byte width of instructions for that architecture')
-parser.add_argument('--random', required=False, action='store_true', help='Enables non-sequential testing')
-parser.add_argument('--start', required=False, action='store', type=int, help='The first instruction value to test')
-parser.add_argument('--skip', required=False, action='store', type=int, help='The interval between instructions to test')
-parser.add_argument('--log', required=False, action='store', help='A log file to write the most recent instruction being tested')
-parser.add_argument('--time', required=False, action='store_true', help='Every 100,000 instructions, print an ETA to standard out')
-
-arguments = sys.argv[1:]
-
-arg_ns = parser.parse_args(arguments)
-
 debugger = lldb.SBDebugger.Create()
 
 if debugger.IsValid() == False:





More information about the lldb-commits mailing list