summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2012-04-14 01:06:06 +0000
committerSean Callanan <scallanan@apple.com>2012-04-14 01:06:06 +0000
commitf5c87882a01b733a98a0138688d2ff0c9e586848 (patch)
treeeaff6046b3c8f95905db59a808d8feef426df295 /lldb/examples/python
parent2a7d20405de6a9c9d487359a4f8777a723cf2855 (diff)
downloadbcm5719-llvm-f5c87882a01b733a98a0138688d2ff0c9e586848.tar.gz
bcm5719-llvm-f5c87882a01b733a98a0138688d2ff0c9e586848.zip
Added a --lldb option to override the location
of LLDB.framework. llvm-svn: 154728
Diffstat (limited to 'lldb/examples/python')
-rwxr-xr-xlldb/examples/python/disasm-stress-test.py34
1 files changed, 19 insertions, 15 deletions
diff --git a/lldb/examples/python/disasm-stress-test.py b/lldb/examples/python/disasm-stress-test.py
index ff199973d41..5aa354dc24c 100755
--- a/lldb/examples/python/disasm-stress-test.py
+++ b/lldb/examples/python/disasm-stress-test.py
@@ -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 @@ def AddLLDBToSysPathOnMacOSX():
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:
OpenPOWER on IntegriCloud