import os, sys
import unittest2
import lldb
-import pexpect
from lldbbench import *
def is_exe(fpath):
print "lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg)
def run_lldb_disassembly(self, exe, function, count):
+ import pexpect
# Set self.child_prompt, which is "(lldb) ".
self.child_prompt = '(lldb) '
prompt = self.child_prompt
self.child = None
def run_gdb_disassembly(self, exe, function, count):
+ import pexpect
# Set self.child_prompt, which is "(gdb) ".
self.child_prompt = '(gdb) '
prompt = self.child_prompt
import os, sys
import unittest2
import lldb
-import pexpect
from lldbbench import *
class AttachThenDisassemblyBench(BenchBase):
import os, sys
import unittest2
import lldb
-import pexpect
from lldbbench import *
class XCode41Vs42GDBDisassembly(BenchBase):
print "gdb_42_avg/gdb_41_avg: %f" % (self.gdb_42_avg/self.gdb_41_avg)
def run_gdb_disassembly(self, gdb_exe_path, exe, function, count):
+ import pexpect
# Set self.child_prompt, which is "(gdb) ".
self.child_prompt = '(gdb) '
prompt = self.child_prompt
import os, sys
import unittest2
import lldb
-import pexpect
from lldbbench import *
class ExpressionEvaluationCase(BenchBase):
print "lldb expr cmd benchmark:", self.stopwatch
def run_lldb_repeated_exprs(self, exe_name, count):
+ import pexpect
exe = os.path.join(os.getcwd(), exe_name)
# Set self.child_prompt, which is "(lldb) ".
import os, sys
import unittest2
import lldb
-import pexpect
from lldbbench import *
class RepeatedExprsCase(BenchBase):
print "lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg)
def run_lldb_repeated_exprs(self, exe_name, count):
+ import pexpect
exe = os.path.join(os.getcwd(), exe_name)
# Set self.child_prompt, which is "(lldb) ".
self.child = None
def run_gdb_repeated_exprs(self, exe_name, count):
+ import pexpect
exe = os.path.join(os.getcwd(), exe_name)
# Set self.child_prompt, which is "(gdb) ".
import os, sys
import unittest2
import lldb
-import pexpect
from lldbbench import *
class FrameVariableResponseBench(BenchBase):
print "lldb frame variable benchmark:", self.stopwatch
def run_frame_variable_bench(self, exe, break_spec, count):
+ import pexpect
# Set self.child_prompt, which is "(lldb) ".
self.child_prompt = '(lldb) '
prompt = self.child_prompt
import os, sys
import unittest2
import lldb
-import pexpect
from lldbbench import *
class StartupDelaysBench(BenchBase):
print "lldb startup delay (run to breakpoint) benchmark:", self.stopwatch3
def run_startup_delays_bench(self, exe, break_spec, count):
+ import pexpect
# Set self.child_prompt, which is "(lldb) ".
self.child_prompt = '(lldb) '
prompt = self.child_prompt
import os, sys
import unittest2
import lldb
-import pexpect
from lldbbench import *
class RunHooksThenSteppingsBench(BenchBase):
print "lldb stepping benchmark:", self.stopwatch
def run_lldb_runhooks_then_steppings(self, count):
+ import pexpect
# Set self.child_prompt, which is "(lldb) ".
self.child_prompt = '(lldb) '
prompt = self.child_prompt
import os, sys
import unittest2
import lldb
-import pexpect
from lldbbench import *
class SteppingSpeedBench(BenchBase):
print "lldb stepping benchmark:", self.stopwatch
def run_lldb_steppings(self, exe, break_spec, count):
+ import pexpect
# Set self.child_prompt, which is "(lldb) ".
self.child_prompt = '(lldb) '
prompt = self.child_prompt
import os, sys
import unittest2
import lldb
-import pexpect
from lldbbench import *
class CompileRunToBreakpointBench(BenchBase):
print "lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg)
def run_lldb_turnaround(self, exe, function, count):
+ import pexpect
def run_one_round():
prompt = self.child_prompt
self.child = None
def run_gdb_turnaround(self, exe, function, count):
+ import pexpect
def run_one_round():
prompt = self.child_prompt
raise Exception('log enable failed (check GDB_REMOTE_LOG env variable)')
def getMyCommandLine():
- ps = subprocess.Popen([which('ps'), '-o', "command=CMD", str(os.getpid())], stdout=subprocess.PIPE).communicate()[0]
- lines = ps.split('\n')
- cmd_line = lines[1]
- return cmd_line
+ return ' '.join(sys.argv)
# ======================================== #
# #
import os
import unittest2
import lldb
-import pexpect
from lldbtest import *
class CommandHistoryTestCase(TestBase):
import os
import unittest2
import lldb
-import pexpect
from lldbtest import *
class CommandRegexTestCase(TestBase):
def test_command_regex(self):
"""Test a simple scenario of 'command regex' invocation and subsequent use."""
+ import pexpect
prompt = "(lldb) "
regex_prompt = "Enter one of more sed substitution commands in the form: 's/<regex>/<subst>/'.\r\nTerminate the substitution list with an empty line.\r\n"
regex_prompt1 = "\r\n"
import os
import unittest2
import lldb
-import pexpect
from lldbtest import *
class CommandLineCompletionTestCase(TestBase):
def complete_from_to(self, str_input, patterns, turn_off_re_match=False):
"""Test that the completion mechanism completes str_input to patterns,
where patterns could be a pattern-string or a list of pattern-strings"""
+ import pexpect
# Patterns should not be None in order to proceed.
self.assertFalse(patterns is None)
# And should be either a string or list of strings. Check for list type
import os
import unittest2
import lldb
-import pexpect
from lldbtest import *
class ConnectRemoteTestCase(TestBase):
def test_connect_remote(self):
"""Test "process connect connect:://localhost:12345"."""
+ import pexpect
# First, we'll start a fake debugserver (a simple echo server).
fakeserver = pexpect.spawn('./EchoServer.py')
import os
import unittest2
import lldb
-import pexpect
from lldbtest import *
class ConvenienceVariablesCase(TestBase):
def convenience_variables(self):
"""Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame."""
+ import pexpect
exe = os.path.join(os.getcwd(), "a.out")
prompt = "(lldb) "
python_prompt = ">>> "
import os
import unittest2
import lldb
-import pexpect
from lldbtest import *
class SingleQuoteInCommandLineTestCase(TestBase):
def test_lldb_invocation_with_single_quote_in_filename(self):
"""Test that 'lldb my_file_name' works where my_file_name is a string with a single quote char in it."""
+ import pexpect
self.buildDefault()
system(["/bin/sh", "-c", "cp a.out \"%s\"" % self.myexe])
import os
import unittest2
import lldb
-import pexpect
from lldbtest import *
class StopHookMechanismTestCase(TestBase):
def stop_hook_firing(self):
"""Test the stop-hook mechanism."""
+ import pexpect
exe = os.path.join(os.getcwd(), "a.out")
prompt = "(lldb) "
add_prompt = "Enter your stop hook command(s). Type 'DONE' to end.\r\n> "
import os, time
import unittest2
import lldb
-import pexpect
from lldbtest import *
class StopHookForMultipleThreadsTestCase(TestBase):
def stop_hook_multiple_threads(self):
"""Test that lldb stop-hook works for multiple threads."""
+ import pexpect
exe = os.path.join(os.getcwd(), self.exe_name)
prompt = "(lldb) "
import os, time
import unittest2
import lldb
-import pexpect
import sys
from lldbtest import *
--- /dev/null
+from builder_base import *
+
+def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True):
+ return False
import os
import unittest2
import lldb
-import pexpect
from lldbtest import *
class CommandInterpreterAPICase(TestBase):
import os
import unittest2
import lldb
-import pexpect
from lldbtest import *
from math import fabs
import lldbutil
self.expect("settings show auto-confirm", SETTING_MSG("auto-confirm"),
startstr = "auto-confirm (boolean) = false")
- @unittest2.skipUnless(os.uname()[4] in ['amd64', 'i386', 'x86_64'], "requires x86 or x86_64")
+ @unittest2.skipUnless(os.name != "nt" and os.uname()[4] in ['amd64', 'i386', 'x86_64'], "requires x86 or x86_64")
def test_disassembler_settings(self):
"""Test that user options for the disassembler take effect."""
self.buildDefault()
import os
import unittest2
import lldb
-import pexpect
from lldbtest import *
class CommandLineCompletionTestCase(TestBase):
def test_stty_dash_a_before_and_afetr_invoking_lldb_command(self):
"""Test that 'stty -a' displays the same output before and after running the lldb command."""
-
+ import pexpect
if not which('expect'):
self.skipTest("The 'expect' program cannot be located, skip the test")
import errno
import os
import os.path
-import pexpect
import platform
import random
import re
def launch_debug_monitor(self, attach_pid=None):
# Create the command line.
+ import pexpect
commandline = "{}{} localhost:{}".format(self.debug_monitor_exe, self.debug_monitor_extra_args, self.port)
if attach_pid:
commandline += " --attach=%d" % attach_pid
import os, time
import unittest2
import lldb
-import pexpect
from lldbtest import *
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")