diff options
author | Zachary Turner <zturner@google.com> | 2015-10-23 17:04:29 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-10-23 17:04:29 +0000 |
commit | 35d017f0fc38b53e31f1a44d07c3c142f5d3620b (patch) | |
tree | 9bb8d7e92d30ed6ea5387993d53a07e8f16a155c | |
parent | d43fe0bd39ab70b739123853ebd0c2991512b9d7 (diff) | |
download | bcm5719-llvm-35d017f0fc38b53e31f1a44d07c3c142f5d3620b.tar.gz bcm5719-llvm-35d017f0fc38b53e31f1a44d07c3c142f5d3620b.zip |
Add from __future__ import print_function everywhere.
Apparently there were tons of instances I missed last time, I
guess I accidentally ran 2to3 non-recursively. This should be
every occurrence of a print statement fixed to use a print function
as well as from __future__ import print_function being added to
every file.
After this patch print statements will stop working everywhere in
the test suite, and the print function should be used instead.
llvm-svn: 251121
404 files changed, 1269 insertions, 470 deletions
diff --git a/lldb/test/android/platform/TestDefaultCacheLineSize.py b/lldb/test/android/platform/TestDefaultCacheLineSize.py index 2cc209bacf4..d559dab06d6 100644 --- a/lldb/test/android/platform/TestDefaultCacheLineSize.py +++ b/lldb/test/android/platform/TestDefaultCacheLineSize.py @@ -2,6 +2,8 @@ Verify the default cache line size for android targets """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/api/check_public_api_headers/TestPublicAPIHeaders.py b/lldb/test/api/check_public_api_headers/TestPublicAPIHeaders.py index 95f4bc9936c..3ba97e8ffd3 100644 --- a/lldb/test/api/check_public_api_headers/TestPublicAPIHeaders.py +++ b/lldb/test/api/check_public_api_headers/TestPublicAPIHeaders.py @@ -3,6 +3,8 @@ There should be nothing unwanted there and a simpe main.cpp which includes SB*.h should compile and link with the LLDB framework.""" +from __future__ import print_function + import lldb_shared import os, re @@ -72,7 +74,7 @@ class SBDirCheckerCase(TestBase): env_cmd = "settings set target.env-vars %s=%s" %(self.dylibPath, self.getLLDBLibraryEnvVal()) if self.TraceOn(): - print "Set environment to: ", env_cmd + print("Set environment to: ", env_cmd) self.runCmd(env_cmd) self.addTearDownHook(lambda: self.dbg.HandleCommand("settings remove target.env-vars %s" % self.dylibPath)) diff --git a/lldb/test/api/multiple-debuggers/TestMultipleDebuggers.py b/lldb/test/api/multiple-debuggers/TestMultipleDebuggers.py index d25ee108383..143ea431ef0 100644 --- a/lldb/test/api/multiple-debuggers/TestMultipleDebuggers.py +++ b/lldb/test/api/multiple-debuggers/TestMultipleDebuggers.py @@ -1,5 +1,7 @@ """Test the lldb public C++ api when doing multiple debug sessions simultaneously.""" +from __future__ import print_function + import lldb_shared import os, re @@ -40,7 +42,7 @@ class TestMultipleSimultaneousDebuggers(TestBase): # will recognize it as a test failure. if self.TraceOn(): - print "Running test %s" % self.driver_exe + print("Running test %s" % self.driver_exe) check_call([self.driver_exe, self.inferior_exe], env=env) else: with open(os.devnull, 'w') as fnull: diff --git a/lldb/test/api/multithreaded/TestMultithreaded.py b/lldb/test/api/multithreaded/TestMultithreaded.py index 2731a49d7b0..9ac25df6927 100644 --- a/lldb/test/api/multithreaded/TestMultithreaded.py +++ b/lldb/test/api/multithreaded/TestMultithreaded.py @@ -1,5 +1,7 @@ """Test the lldb public C++ api breakpoint callbacks.""" +from __future__ import print_function + import lldb_shared import os, re @@ -82,7 +84,7 @@ class SBBreakpointCallbackCase(TestBase): env = {self.dylibPath : self.getLLDBLibraryEnvVal()} if self.TraceOn(): - print "Running test %s" % " ".join(exe) + print("Running test %s" % " ".join(exe)) check_call(exe, env=env) else: with open(os.devnull, 'w') as fnull: diff --git a/lldb/test/arm_emulation/TestEmulations.py b/lldb/test/arm_emulation/TestEmulations.py index ec37760f5d4..f4427cf216e 100644 --- a/lldb/test/arm_emulation/TestEmulations.py +++ b/lldb/test/arm_emulation/TestEmulations.py @@ -2,6 +2,8 @@ Test some ARM instruction emulation. """ +from __future__ import print_function + import lldb_shared import os, time @@ -46,7 +48,7 @@ class ARMEmulationTestCase(TestBase): success = insn.TestEmulation (stream, filename); output = stream.GetData(); if self.TraceOn(): - print '\nRunning test ' + os.path.basename(filename) - print output + print('\nRunning test ' + os.path.basename(filename)) + print(output) self.assertTrue (success, 'Emulation test succeeded.') diff --git a/lldb/test/attic/tester.py b/lldb/test/attic/tester.py index 3f05fbed25d..34a6ed13c94 100755 --- a/lldb/test/attic/tester.py +++ b/lldb/test/attic/tester.py @@ -1,13 +1,15 @@ #!/usr/bin/env python # -*- coding: utf8 -*- +from __future__ import print_function + import math, os.path, re, sys, time, unittest def setupSysPath(): testPath = sys.path[0] rem = re.match("(^.*/)test$", testPath) if not rem: - print "This script expects to reside in .../test." + print("This script expects to reside in .../test.") sys.exit(-1) lldbBasePath = rem.group(1) lldbDebugPythonPath = "build/Debug/LLDB.framework/Resources/Python" @@ -18,8 +20,8 @@ def setupSysPath(): if os.path.isfile(lldbReleasePythonPath + "/lldb.py"): lldbPythonPath = lldbReleasePythonPath if not lldbPythonPath: - print "This script requires lldb.py to be in either " + lldbDebugPythonPath, - print "or" + lldbReleasePythonPath + print("This script requires lldb.py to be in either " + lldbDebugPythonPath, end='') + print("or" + lldbReleasePythonPath) sys.exit(-1) sys.path.append(lldbPythonPath) @@ -72,8 +74,8 @@ class ExecutionTimes: sampleVariance += (time - sampleMean) ** 2 sampleVariance /= sampleCount sampleStandardDeviation = math.sqrt(sampleVariance) - print key + ": [" + prettyTime(sampleMin) + ", " + prettyTime(sampleMax) + "] ", - print "µ " + prettyTime(sampleMean) + ", σ " + prettyTime(sampleStandardDeviation) + print(key + ": [" + prettyTime(sampleMin) + ", " + prettyTime(sampleMax) + "] ", end='') + print("µ " + prettyTime(sampleMean) + ", σ " + prettyTime(sampleStandardDeviation)) m_executionTimes = None setupSysPath() @@ -86,7 +88,7 @@ class LLDBTestCase(unittest.TestCase): debugger.SetAsync(True) self.m_commandInterpreter = debugger.GetCommandInterpreter() if not self.m_commandInterpreter: - print "Couldn't get the command interpreter" + print("Couldn't get the command interpreter") sys.exit(-1) def runCommand(self, command, component): res = lldb.SBCommandReturnObject() @@ -104,7 +106,7 @@ class LLDBTestCase(unittest.TestCase): class SanityCheckTestCase(LLDBTestCase): def runTest(self): ret = self.runCommand("show arch", "show-arch") - #print ret + #print(ret) def getCategories(self): return [] diff --git a/lldb/test/benchmarks/continue/TestBenchmarkContinue.py b/lldb/test/benchmarks/continue/TestBenchmarkContinue.py index 83674c6ff24..8599124eae0 100644 --- a/lldb/test/benchmarks/continue/TestBenchmarkContinue.py +++ b/lldb/test/benchmarks/continue/TestBenchmarkContinue.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time @@ -61,4 +63,4 @@ class TestBenchmarkContinue(BenchBase): lldbutil.continue_to_breakpoint(self.process(), bkpt) lldbutil_sw.stop() - print "runCmd: %s\nlldbutil: %s" % (runCmd_sw,lldbutil_sw) + print("runCmd: %s\nlldbutil: %s" % (runCmd_sw,lldbutil_sw)) diff --git a/lldb/test/benchmarks/disassembly/TestDisassembly.py b/lldb/test/benchmarks/disassembly/TestDisassembly.py index b5148192b62..522be3a3cd9 100644 --- a/lldb/test/benchmarks/disassembly/TestDisassembly.py +++ b/lldb/test/benchmarks/disassembly/TestDisassembly.py @@ -1,5 +1,7 @@ """Disassemble lldb's Driver::MainLoop() functions comparing lldb against gdb.""" +from __future__ import print_function + import lldb_shared import os, sys @@ -42,32 +44,32 @@ class DisassembleDriverMainLoop(BenchBase): @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") def test_run_lldb_then_gdb(self): """Test disassembly on a large function with lldb vs. gdb.""" - print - print "lldb path: %s" % lldbtest_config.lldbExec - print "gdb path: %s" % self.gdbExec + print() + print("lldb path: %s" % lldbtest_config.lldbExec) + print("gdb path: %s" % self.gdbExec) - print + print() self.run_lldb_disassembly(self.exe, self.function, self.count) - print "lldb benchmark:", self.stopwatch + print("lldb benchmark:", self.stopwatch) self.run_gdb_disassembly(self.exe, self.function, self.count) - print "gdb benchmark:", self.stopwatch - print "lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg) + print("gdb benchmark:", self.stopwatch) + print("lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg)) @benchmarks_test @no_debug_info_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") def test_run_gdb_then_lldb(self): """Test disassembly on a large function with lldb vs. gdb.""" - print - print "lldb path: %s" % lldbtest_config.lldbExec - print "gdb path: %s" % self.gdbExec + print() + print("lldb path: %s" % lldbtest_config.lldbExec) + print("gdb path: %s" % self.gdbExec) - print + print() self.run_gdb_disassembly(self.exe, self.function, self.count) - print "gdb benchmark:", self.stopwatch + print("gdb benchmark:", self.stopwatch) self.run_lldb_disassembly(self.exe, self.function, self.count) - print "lldb benchmark:", self.stopwatch - print "lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg) + print("lldb benchmark:", self.stopwatch) + print("lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg)) def run_lldb_disassembly(self, exe, function, count): import pexpect @@ -107,7 +109,7 @@ class DisassembleDriverMainLoop(BenchBase): self.lldb_avg = self.stopwatch.avg() if self.TraceOn(): - print "lldb disassembly benchmark:", str(self.stopwatch) + print("lldb disassembly benchmark:", str(self.stopwatch)) self.child = None def run_gdb_disassembly(self, exe, function, count): @@ -150,5 +152,5 @@ class DisassembleDriverMainLoop(BenchBase): self.gdb_avg = self.stopwatch.avg() if self.TraceOn(): - print "gdb disassembly benchmark:", str(self.stopwatch) + print("gdb disassembly benchmark:", str(self.stopwatch)) self.child = None diff --git a/lldb/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py b/lldb/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py index a93a406f90f..c8a28b86f79 100644 --- a/lldb/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py +++ b/lldb/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py @@ -2,6 +2,8 @@ inferior and traverses the stack for thread0 to arrive at frame with function 'MainLoop'. It is important to specify an lldb executable as the inferior.""" +from __future__ import print_function + import lldb_shared import os, sys @@ -26,9 +28,9 @@ class AttachThenDisassemblyBench(BenchBase): @no_debug_info_test def test_attach_then_disassembly(self): """Attach to a spawned lldb process then run disassembly benchmarks.""" - print + print() self.run_lldb_attach_then_disassembly(self.exe, self.count) - print "lldb disassembly benchmark:", self.stopwatch + print("lldb disassembly benchmark:", self.stopwatch) def run_lldb_attach_then_disassembly(self, exe, count): target = self.dbg.CreateTarget(exe) @@ -38,7 +40,7 @@ class AttachThenDisassemblyBench(BenchBase): popen = subprocess.Popen([exe, self.lldbOption], stdout = open(os.devnull, 'w') if not self.TraceOn() else None) if self.TraceOn(): - print "pid of spawned process: %d" % popen.pid + print("pid of spawned process: %d" % popen.pid) # Attach to the launched lldb process. listener = lldb.SBListener("my.attach.listener") @@ -52,12 +54,12 @@ class AttachThenDisassemblyBench(BenchBase): i = 0 found = False for f in thread0: - #print "frame#%d %s" % (i, f.GetFunctionName()) + #print("frame#%d %s" % (i, f.GetFunctionName())) if "MainLoop" in f.GetFunctionName(): found = True thread0.SetSelectedFrame(i) if self.TraceOn(): - print "Found frame#%d for function 'MainLoop'" % i + print("Found frame#%d for function 'MainLoop'" % i) break i += 1 diff --git a/lldb/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py b/lldb/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py index 393119e1d84..913f9c00019 100644 --- a/lldb/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py +++ b/lldb/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py @@ -1,5 +1,7 @@ """Disassemble lldb's Driver::MainLoop() functions comparing Xcode 4.1 vs. 4.2's gdb.""" +from __future__ import print_function + import lldb_shared import os, sys @@ -27,28 +29,28 @@ class XCode41Vs42GDBDisassembly(BenchBase): @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") def test_run_41_then_42(self): """Test disassembly on a large function with 4.1 vs. 4.2's gdb.""" - print + print() self.run_gdb_disassembly(self.gdb_41_exe, self.exe, self.function, self.count) - print "4.1 gdb benchmark:", self.stopwatch + print("4.1 gdb benchmark:", self.stopwatch) self.gdb_41_avg = self.stopwatch.avg() self.run_gdb_disassembly(self.gdb_42_exe, self.exe, self.function, self.count) - print "4.2 gdb benchmark:", self.stopwatch + print("4.2 gdb benchmark:", self.stopwatch) self.gdb_42_avg = self.stopwatch.avg() - print "gdb_42_avg/gdb_41_avg: %f" % (self.gdb_42_avg/self.gdb_41_avg) + print("gdb_42_avg/gdb_41_avg: %f" % (self.gdb_42_avg/self.gdb_41_avg)) @benchmarks_test @no_debug_info_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") def test_run_42_then_41(self): """Test disassembly on a large function with 4.1 vs. 4.2's gdb.""" - print + print() self.run_gdb_disassembly(self.gdb_42_exe, self.exe, self.function, self.count) - print "4.2 gdb benchmark:", self.stopwatch + print("4.2 gdb benchmark:", self.stopwatch) self.gdb_42_avg = self.stopwatch.avg() self.run_gdb_disassembly(self.gdb_41_exe, self.exe, self.function, self.count) - print "4.1 gdb benchmark:", self.stopwatch + print("4.1 gdb benchmark:", self.stopwatch) self.gdb_41_avg = self.stopwatch.avg() - print "gdb_42_avg/gdb_41_avg: %f" % (self.gdb_42_avg/self.gdb_41_avg) + 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 @@ -89,5 +91,5 @@ class XCode41Vs42GDBDisassembly(BenchBase): pass if self.TraceOn(): - print "gdb disassembly benchmark:", str(self.stopwatch) + print("gdb disassembly benchmark:", str(self.stopwatch)) self.child = None diff --git a/lldb/test/benchmarks/expression/TestExpressionCmd.py b/lldb/test/benchmarks/expression/TestExpressionCmd.py index aa7b03f2ffb..b6c9d912cf8 100644 --- a/lldb/test/benchmarks/expression/TestExpressionCmd.py +++ b/lldb/test/benchmarks/expression/TestExpressionCmd.py @@ -1,5 +1,7 @@ """Test lldb's expression evaluations and collect statistics.""" +from __future__ import print_function + import lldb_shared import os, sys @@ -25,9 +27,9 @@ class ExpressionEvaluationCase(BenchBase): self.build() self.exe_name = 'a.out' - print + print() self.run_lldb_repeated_exprs(self.exe_name, self.count) - print "lldb expr cmd benchmark:", self.stopwatch + print("lldb expr cmd benchmark:", self.stopwatch) def run_lldb_repeated_exprs(self, exe_name, count): import pexpect diff --git a/lldb/test/benchmarks/expression/TestRepeatedExprs.py b/lldb/test/benchmarks/expression/TestRepeatedExprs.py index 9efbec6c859..f2c26b1cfd6 100644 --- a/lldb/test/benchmarks/expression/TestRepeatedExprs.py +++ b/lldb/test/benchmarks/expression/TestRepeatedExprs.py @@ -1,5 +1,7 @@ """Test evaluating expressions repeatedly comparing lldb against gdb.""" +from __future__ import print_function + import lldb_shared import os, sys @@ -27,12 +29,12 @@ class RepeatedExprsCase(BenchBase): self.build() self.exe_name = 'a.out' - print + print() self.run_lldb_repeated_exprs(self.exe_name, self.count) - print "lldb benchmark:", self.stopwatch + print("lldb benchmark:", self.stopwatch) self.run_gdb_repeated_exprs(self.exe_name, self.count) - print "gdb benchmark:", self.stopwatch - print "lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg) + print("gdb benchmark:", self.stopwatch) + print("lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg)) def run_lldb_repeated_exprs(self, exe_name, count): import pexpect @@ -77,7 +79,7 @@ class RepeatedExprsCase(BenchBase): self.lldb_avg = self.stopwatch.avg() if self.TraceOn(): - print "lldb expression benchmark:", str(self.stopwatch) + print("lldb expression benchmark:", str(self.stopwatch)) self.child = None def run_gdb_repeated_exprs(self, exe_name, count): @@ -125,5 +127,5 @@ class RepeatedExprsCase(BenchBase): self.gdb_avg = self.stopwatch.avg() if self.TraceOn(): - print "gdb expression benchmark:", str(self.stopwatch) + print("gdb expression benchmark:", str(self.stopwatch)) self.child = None diff --git a/lldb/test/benchmarks/frame_variable/TestFrameVariableResponse.py b/lldb/test/benchmarks/frame_variable/TestFrameVariableResponse.py index ff55ecda989..67d48f014bf 100644 --- a/lldb/test/benchmarks/frame_variable/TestFrameVariableResponse.py +++ b/lldb/test/benchmarks/frame_variable/TestFrameVariableResponse.py @@ -1,5 +1,7 @@ """Test lldb's response time for 'frame variable' command.""" +from __future__ import print_function + import lldb_shared import os, sys @@ -30,9 +32,9 @@ class FrameVariableResponseBench(BenchBase): @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") def test_startup_delay(self): """Test response time for the 'frame variable' command.""" - print + print() self.run_frame_variable_bench(self.exe, self.break_spec, self.count) - print "lldb frame variable benchmark:", self.stopwatch + print("lldb frame variable benchmark:", self.stopwatch) def run_frame_variable_bench(self, exe, break_spec, count): import pexpect diff --git a/lldb/test/benchmarks/startup/TestStartupDelays.py b/lldb/test/benchmarks/startup/TestStartupDelays.py index b921906ce31..217e98db23e 100644 --- a/lldb/test/benchmarks/startup/TestStartupDelays.py +++ b/lldb/test/benchmarks/startup/TestStartupDelays.py @@ -1,5 +1,7 @@ """Test lldb's startup delays creating a target, setting a breakpoint, and run to breakpoint stop.""" +from __future__ import print_function + import lldb_shared import os, sys @@ -35,11 +37,11 @@ class StartupDelaysBench(BenchBase): @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") def test_startup_delay(self): """Test start up delays creating a target, setting a breakpoint, and run to breakpoint stop.""" - print + print() self.run_startup_delays_bench(self.exe, self.break_spec, self.count) - print "lldb startup delay (create fresh target) benchmark:", self.stopwatch - print "lldb startup delay (set first breakpoint) benchmark:", self.stopwatch2 - print "lldb startup delay (run to breakpoint) benchmark:", self.stopwatch3 + print("lldb startup delay (create fresh target) benchmark:", self.stopwatch) + print("lldb startup delay (set first breakpoint) benchmark:", self.stopwatch2) + print("lldb startup delay (run to breakpoint) benchmark:", self.stopwatch3) def run_startup_delays_bench(self, exe, break_spec, count): import pexpect diff --git a/lldb/test/benchmarks/stepping/TestRunHooksThenSteppings.py b/lldb/test/benchmarks/stepping/TestRunHooksThenSteppings.py index 71017eb3e34..3fbc787f462 100644 --- a/lldb/test/benchmarks/stepping/TestRunHooksThenSteppings.py +++ b/lldb/test/benchmarks/stepping/TestRunHooksThenSteppings.py @@ -1,5 +1,7 @@ """Test lldb's stepping speed.""" +from __future__ import print_function + import lldb_shared import os, sys @@ -21,9 +23,9 @@ class RunHooksThenSteppingsBench(BenchBase): @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") def test_lldb_runhooks_then_steppings(self): """Test lldb steppings on a large executable.""" - print + print() self.run_lldb_runhooks_then_steppings(self.count) - print "lldb stepping benchmark:", self.stopwatch + print("lldb stepping benchmark:", self.stopwatch) def run_lldb_runhooks_then_steppings(self, count): import pexpect diff --git a/lldb/test/benchmarks/stepping/TestSteppingSpeed.py b/lldb/test/benchmarks/stepping/TestSteppingSpeed.py index 553933f1ee6..3fa01aeaef4 100644 --- a/lldb/test/benchmarks/stepping/TestSteppingSpeed.py +++ b/lldb/test/benchmarks/stepping/TestSteppingSpeed.py @@ -1,5 +1,7 @@ """Test lldb's stepping speed.""" +from __future__ import print_function + import lldb_shared import os, sys @@ -25,17 +27,17 @@ class SteppingSpeedBench(BenchBase): if self.count <= 0: self.count = 50 - #print "self.exe=%s" % self.exe - #print "self.break_spec=%s" % self.break_spec + #print("self.exe=%s" % self.exe) + #print("self.break_spec=%s" % self.break_spec) @benchmarks_test @no_debug_info_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") def test_run_lldb_steppings(self): """Test lldb steppings on a large executable.""" - print + print() self.run_lldb_steppings(self.exe, self.break_spec, self.count) - print "lldb stepping benchmark:", self.stopwatch + print("lldb stepping benchmark:", self.stopwatch) def run_lldb_steppings(self, exe, break_spec, count): import pexpect diff --git a/lldb/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py b/lldb/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py index c359ab256e2..a1342bdbbc7 100644 --- a/lldb/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py +++ b/lldb/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py @@ -1,5 +1,7 @@ """Benchmark the turnaround time starting a debugger and run to the breakpont with lldb vs. gdb.""" +from __future__ import print_function + import lldb_shared import os, sys @@ -27,12 +29,12 @@ class CompileRunToBreakpointBench(BenchBase): @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") def test_run_lldb_then_gdb(self): """Benchmark turnaround time with lldb vs. gdb.""" - print + print() self.run_lldb_turnaround(self.exe, self.function, self.count) - print "lldb turnaround benchmark:", self.stopwatch + print("lldb turnaround benchmark:", self.stopwatch) self.run_gdb_turnaround(self.exe, self.function, self.count) - print "gdb turnaround benchmark:", self.stopwatch - print "lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg) + print("gdb turnaround benchmark:", self.stopwatch) + print("lldb_avg/gdb_avg: %f" % (self.lldb_avg/self.gdb_avg)) def run_lldb_turnaround(self, exe, function, count): import pexpect diff --git a/lldb/test/curses_results.py b/lldb/test/curses_results.py index 89d28ddfb8a..f2a60c65f30 100644 --- a/lldb/test/curses_results.py +++ b/lldb/test/curses_results.py @@ -130,7 +130,7 @@ class Curses(test_results.ResultsFormatter): worker_index = test_event['worker_index'] if 'event' in test_event: check_for_one_key = True - #print >>self.events_file, str(test_event) + #print(str(test_event), file=self.events_file) event = test_event['event'] if self.status_panel: self.status_panel.update_status('time', str(datetime.timedelta(seconds=math.floor(time.time() - self.start_time)))) diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py index d1ce34bb681..dcd4c7932a3 100755 --- a/lldb/test/dotest.py +++ b/lldb/test/dotest.py @@ -902,7 +902,7 @@ def parseOptionsAndInitTestdirs(): copytree(os.path.join(scriptdir, 'make'), os.path.join(rdir, 'make'), ignore=ignore_patterns('.svn')) - #print "testdirs:", testdirs + #print("testdirs:", testdirs) # Source the configFile if specified. # The side effect, if any, will be felt from this point on. An example @@ -919,7 +919,7 @@ def parseOptionsAndInitTestdirs(): if configFile: # Pass config (a dictionary) as the locals namespace for side-effect. execfile(configFile, globals(), config) - #print "config:", config + #print("config:", config) if "pre_flight" in config: pre_flight = config["pre_flight"] if not callable(pre_flight): @@ -934,8 +934,8 @@ def parseOptionsAndInitTestdirs(): lldbtest_remote_sandbox = config["lldbtest_remote_sandbox"] if "lldbtest_remote_shell_template" in config: lldbtest_remote_shell_template = config["lldbtest_remote_shell_template"] - #print "sys.stderr:", sys.stderr - #print "sys.stdout:", sys.stdout + #print("sys.stderr:", sys.stderr) + #print("sys.stdout:", sys.stdout) def getXcodeOutputPaths(lldbRootDirectory): result = [] @@ -1295,7 +1295,7 @@ def visit(prefix, dir, names): global all_tests if set(dir.split(os.sep)).intersection(excluded): - #print "Detected an excluded dir component: %s" % dir + #print("Detected an excluded dir component: %s" % dir) return for name in names: @@ -1312,10 +1312,10 @@ def visit(prefix, dir, names): if regexp: import re if re.search(regexp, name): - #print "Filename: '%s' matches pattern: '%s'" % (name, regexp) + #print("Filename: '%s' matches pattern: '%s'" % (name, regexp)) pass else: - #print "Filename: '%s' does not match pattern: '%s'" % (name, regexp) + #print("Filename: '%s' does not match pattern: '%s'" % (name, regexp)) continue # We found a match for our test. Add it to the suite. @@ -1344,7 +1344,7 @@ def visit(prefix, dir, names): # If filtered, we have a good filterspec. Add it. if filtered: - #print "adding filter spec %s to module %s" % (filterspec, module) + #print("adding filter spec %s to module %s" % (filterspec, module)) suite.addTests( unittest2.defaultTestLoader.loadTestsFromName(filterspec, module)) continue @@ -1761,8 +1761,8 @@ if __name__ == "__main__": if not parsable: sys.stderr.write("\nConfiguration: " + configString + "\n") - #print "sys.stderr name is", sys.stderr.name - #print "sys.stdout name is", sys.stdout.name + #print("sys.stderr name is", sys.stderr.name) + #print("sys.stdout name is", sys.stdout.name) # First, write out the number of collected test cases. if not parsable: diff --git a/lldb/test/dotest_channels.py b/lldb/test/dotest_channels.py index 6b6f0be207e..111e628e0ed 100644 --- a/lldb/test/dotest_channels.py +++ b/lldb/test/dotest_channels.py @@ -14,6 +14,8 @@ This module provides asyncore channels used within the LLDB test framework. """ +from __future__ import print_function + import lldb_shared import asyncore @@ -121,7 +123,7 @@ class UnpicklingForwardingReaderChannel(asyncore.dispatcher): def handle_read(self): data = self.recv(8192) - # print 'driver socket READ: %d bytes' % len(data) + # print('driver socket READ: %d bytes' % len(data)) while data and (len(data) > 0): # If we're reading the header, gather header bytes. @@ -131,7 +133,7 @@ class UnpicklingForwardingReaderChannel(asyncore.dispatcher): data = self.consume_payload_bytes(data) def handle_close(self): - # print "socket reader: closing port" + # print("socket reader: closing port") self.close() @@ -167,7 +169,7 @@ class UnpicklingForwardingListenerChannel(asyncore.dispatcher): def handle_accept(self): (sock, addr) = self.socket.accept() if sock and addr: - # print 'Incoming connection from %s' % repr(addr) + # print('Incoming connection from %s' % repr(addr)) self.handler = UnpicklingForwardingReaderChannel( sock, self.async_map, self.forwarding_func) diff --git a/lldb/test/driver/batch_mode/TestBatchMode.py b/lldb/test/driver/batch_mode/TestBatchMode.py index bd0f3fa4432..f88591aa4b3 100644 --- a/lldb/test/driver/batch_mode/TestBatchMode.py +++ b/lldb/test/driver/batch_mode/TestBatchMode.py @@ -2,6 +2,8 @@ Test that the lldb driver's batch mode works correctly. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/expression_command/call-function/TestCallStdStringFunction.py b/lldb/test/expression_command/call-function/TestCallStdStringFunction.py index 736af5b6334..ef04bdb59d6 100644 --- a/lldb/test/expression_command/call-function/TestCallStdStringFunction.py +++ b/lldb/test/expression_command/call-function/TestCallStdStringFunction.py @@ -2,6 +2,8 @@ Test calling std::String member functions. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/expression_command/call-function/TestCallStopAndContinue.py b/lldb/test/expression_command/call-function/TestCallStopAndContinue.py index 10a4c21d0a8..cc66dd0c6ea 100644 --- a/lldb/test/expression_command/call-function/TestCallStopAndContinue.py +++ b/lldb/test/expression_command/call-function/TestCallStopAndContinue.py @@ -2,6 +2,8 @@ Test calling a function, stopping in the call, continue and gather the result on stop. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py b/lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py index c9a1db2b427..f851779c58d 100644 --- a/lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py +++ b/lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py @@ -7,6 +7,8 @@ Note: """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py b/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py index f5480c27407..e3d368c97cd 100644 --- a/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py +++ b/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py @@ -2,6 +2,8 @@ Test calling a function that hits a signal set to auto-restart, make sure the call completes. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/expression_command/call-throws/TestCallThatThrows.py b/lldb/test/expression_command/call-throws/TestCallThatThrows.py index e5ac994d7b5..85774cdc65f 100644 --- a/lldb/test/expression_command/call-throws/TestCallThatThrows.py +++ b/lldb/test/expression_command/call-throws/TestCallThatThrows.py @@ -2,6 +2,8 @@ Test calling a function that throws an ObjC exception, make sure that it doesn't propagate the exception. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/expression_command/char/TestExprsChar.py b/lldb/test/expression_command/char/TestExprsChar.py index c5745189d56..0e6478ac238 100644 --- a/lldb/test/expression_command/char/TestExprsChar.py +++ b/lldb/test/expression_command/char/TestExprsChar.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py b/lldb/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py index 4d1ba4bec59..83c98affdd0 100644 --- a/lldb/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py +++ b/lldb/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py @@ -1,5 +1,7 @@ """Test that we are able to evaluate expressions when the inferior is blocked in a syscall""" +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/expression_command/formatters/TestFormatters.py b/lldb/test/expression_command/formatters/TestFormatters.py index a86961a32b8..c8bb2847a48 100644 --- a/lldb/test/expression_command/formatters/TestFormatters.py +++ b/lldb/test/expression_command/formatters/TestFormatters.py @@ -2,6 +2,8 @@ Test using LLDB data formatters with frozen objects coming from the expression parser. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/expression_command/issue_11588/Test11588.py b/lldb/test/expression_command/issue_11588/Test11588.py index d1793c3f96f..53b7fc94faf 100644 --- a/lldb/test/expression_command/issue_11588/Test11588.py +++ b/lldb/test/expression_command/issue_11588/Test11588.py @@ -4,6 +4,8 @@ valobj.AddressOf() returns None when an address is expected in a SyntheticChildrenProvider """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/expression_command/options/TestExprOptions.py b/lldb/test/expression_command/options/TestExprOptions.py index 18394efc010..846f676eb64 100644 --- a/lldb/test/expression_command/options/TestExprOptions.py +++ b/lldb/test/expression_command/options/TestExprOptions.py @@ -7,6 +7,8 @@ o test_expr_options: Test expression command options. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py b/lldb/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py index a179205a2d9..b11ea8a6ced 100644 --- a/lldb/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py +++ b/lldb/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py @@ -2,6 +2,8 @@ Test that we can p *objcObject """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py b/lldb/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py index 312d9de6d10..4c10e2a946b 100644 --- a/lldb/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py +++ b/lldb/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py @@ -2,6 +2,8 @@ Test that we can have persistent pointer variables """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py b/lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py index 4fd34830a75..7e474c889ef 100644 --- a/lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py +++ b/lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py @@ -2,6 +2,8 @@ Test that nested persistent types work. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/expression_command/persistent_types/TestPersistentTypes.py b/lldb/test/expression_command/persistent_types/TestPersistentTypes.py index 0ced7700727..3ed03843184 100644 --- a/lldb/test/expression_command/persistent_types/TestPersistentTypes.py +++ b/lldb/test/expression_command/persistent_types/TestPersistentTypes.py @@ -2,6 +2,8 @@ Test that lldb persistent types works correctly. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py b/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py index 3a10a98475c..c6f270f7b62 100644 --- a/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py +++ b/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py @@ -2,6 +2,8 @@ Test that lldb persistent variables works correctly. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/expression_command/po_verbosity/TestPoVerbosity.py b/lldb/test/expression_command/po_verbosity/TestPoVerbosity.py index 829b35dd091..9603bb536cb 100644 --- a/lldb/test/expression_command/po_verbosity/TestPoVerbosity.py +++ b/lldb/test/expression_command/po_verbosity/TestPoVerbosity.py @@ -2,6 +2,8 @@ Test that the po command acts correctly. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/expression_command/radar_8638051/Test8638051.py b/lldb/test/expression_command/radar_8638051/Test8638051.py index 2cff7fe13fc..a8ba0216bb6 100644 --- a/lldb/test/expression_command/radar_8638051/Test8638051.py +++ b/lldb/test/expression_command/radar_8638051/Test8638051.py @@ -2,6 +2,8 @@ Test the robustness of lldb expression parser. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py b/lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py index 31d120fccef..41e3cf8299f 100644 --- a/lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py +++ b/lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py @@ -2,6 +2,8 @@ The evaluating printf(...) after break stop and then up a stack frame. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/expression_command/radar_9673664/TestExprHelpExamples.py b/lldb/test/expression_command/radar_9673664/TestExprHelpExamples.py index c412bce7c49..8538bb3da5d 100644 --- a/lldb/test/expression_command/radar_9673664/TestExprHelpExamples.py +++ b/lldb/test/expression_command/radar_9673664/TestExprHelpExamples.py @@ -2,6 +2,8 @@ Test example snippets from the lldb 'help expression' output. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/expression_command/test/TestExprs.py b/lldb/test/expression_command/test/TestExprs.py index 12bdfa24d6c..88517333f1c 100644 --- a/lldb/test/expression_command/test/TestExprs.py +++ b/lldb/test/expression_command/test/TestExprs.py @@ -11,6 +11,8 @@ o test_expr_commands_can_handle_quotes: Throw some expression commands with quotes at lldb. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/expression_command/test/TestExprs2.py b/lldb/test/expression_command/test/TestExprs2.py index a2dd98cfbce..b835c086ab8 100644 --- a/lldb/test/expression_command/test/TestExprs2.py +++ b/lldb/test/expression_command/test/TestExprs2.py @@ -2,6 +2,8 @@ Test some more expression commands. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/expression_command/timeout/TestCallWithTimeout.py b/lldb/test/expression_command/timeout/TestCallWithTimeout.py index e63cebede52..59a1be6f7e7 100644 --- a/lldb/test/expression_command/timeout/TestCallWithTimeout.py +++ b/lldb/test/expression_command/timeout/TestCallWithTimeout.py @@ -2,6 +2,8 @@ Test calling a function that waits a while, and make sure the timeout option to expr works. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py b/lldb/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py index 93c8218c4b9..6edf8be453f 100644 --- a/lldb/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py +++ b/lldb/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py @@ -4,6 +4,8 @@ Regression test for <rdar://problem/8981098>: The expression parser's type search only looks in the current compilation unit for types. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/abbreviation/TestAbbreviations.py b/lldb/test/functionalities/abbreviation/TestAbbreviations.py index 86268bba1a2..3a089a23c2e 100644 --- a/lldb/test/functionalities/abbreviation/TestAbbreviations.py +++ b/lldb/test/functionalities/abbreviation/TestAbbreviations.py @@ -2,6 +2,8 @@ Test some lldb command abbreviations and aliases for proper resolution. """ +from __future__ import print_function + import lldb_shared import os, time @@ -79,9 +81,9 @@ class AbbreviationsTestCase(TestBase): self.assertFalse(result.Succeeded()) # Check a command that wants the raw input. - command_interpreter.ResolveCommand(r'''sc print "\n\n\tHello!\n"''', result) + command_interpreter.ResolveCommand(r'''sc print("\n\n\tHello!\n")''', result) self.assertTrue(result.Succeeded()) - self.assertEqual(r'''script print "\n\n\tHello!\n"''', result.GetOutput()) + self.assertEqual(r'''script print("\n\n\tHello!\n")''', result.GetOutput()) # Prompt changing stuff should be tested, but this doesn't seem like the # right test to do it in. It has nothing to do with aliases or abbreviations. diff --git a/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py b/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py index d184edc6572..3772e63d085 100644 --- a/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py +++ b/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py @@ -3,6 +3,8 @@ Test some lldb command abbreviations to make sure the common short spellings of many commands remain available even after we add/delete commands in the future. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/archives/TestBSDArchives.py b/lldb/test/functionalities/archives/TestBSDArchives.py index 9246c5eaf58..a2071d3bad4 100644 --- a/lldb/test/functionalities/archives/TestBSDArchives.py +++ b/lldb/test/functionalities/archives/TestBSDArchives.py @@ -1,5 +1,7 @@ """Test breaking inside functions defined within a BSD archive file libfoo.a.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/asan/TestMemoryHistory.py b/lldb/test/functionalities/asan/TestMemoryHistory.py index d9334d5f2a2..a0d853345cc 100644 --- a/lldb/test/functionalities/asan/TestMemoryHistory.py +++ b/lldb/test/functionalities/asan/TestMemoryHistory.py @@ -2,6 +2,8 @@ Test that ASan memory history provider returns correct stack traces """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/asan/TestReportData.py b/lldb/test/functionalities/asan/TestReportData.py index 19e0b61498a..462fc015179 100644 --- a/lldb/test/functionalities/asan/TestReportData.py +++ b/lldb/test/functionalities/asan/TestReportData.py @@ -2,6 +2,8 @@ Test the AddressSanitizer runtime support for report breakpoint and data extraction. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/attach_resume/TestAttachResume.py b/lldb/test/functionalities/attach_resume/TestAttachResume.py index 0a5e7f20eab..5565ad60bd3 100644 --- a/lldb/test/functionalities/attach_resume/TestAttachResume.py +++ b/lldb/test/functionalities/attach_resume/TestAttachResume.py @@ -2,6 +2,8 @@ Test process attach/resume. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py b/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py index abceb6a3ca4..27ec6829aaf 100644 --- a/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py +++ b/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py @@ -2,6 +2,8 @@ Test whether a process started by lldb has no extra file descriptors open. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py b/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py index d2a6e5ce87e..18c03f9725c 100644 --- a/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py +++ b/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py @@ -2,6 +2,8 @@ Test that backticks without a target should work (not infinite looping). """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py index 660f463ee90..051063bf4ec 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py @@ -2,6 +2,8 @@ Test lldb breakpoint command add/list/delete. """ +from __future__ import print_function + import lldb_shared import os, time @@ -50,7 +52,7 @@ class BreakpointCommandTestCase(TestBase): # Now add callbacks for the breakpoints just created. self.runCmd("breakpoint command add -s command -o 'frame variable --show-types --scope' 1 4") - self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print >> here, \"lldb\"; here.close()' 2") + self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print(\"lldb\", file=here); here.close()' 2") self.runCmd("breakpoint command add --python-function bktptcmd.function 3") # Check that the breakpoint commands are correctly set. @@ -72,7 +74,7 @@ class BreakpointCommandTestCase(TestBase): self.expect("breakpoint command list 2", "Breakpoint 2 command ok", substrs = ["Breakpoint commands:", "here = open", - "print >> here", + "print(file=here)", "here.close()"]) self.expect("breakpoint command list 3", "Breakpoint 3 command ok", substrs = ["Breakpoint commands:", @@ -176,7 +178,7 @@ class BreakpointCommandTestCase(TestBase): lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True) # Now add callbacks for the breakpoints just created. - self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print >> here, frame; print >> here, bp_loc; here.close()' 1") + self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print(frame, file=here); print(bp_loc, file=here); here.close()' 1") # Remove 'output-2.txt' if it already exists. diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py index 0058bff9d80..f9eb809ec80 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py @@ -2,6 +2,8 @@ Test that you can set breakpoint commands successfully with the Python API's: """ +from __future__ import print_function + import lldb_shared import os @@ -49,7 +51,7 @@ class PythonBreakpointCommandSettingTestCase(TestBase): got_one_in_B = False for idx in range(0, num_locations): comp_unit = no_files_bkpt.GetLocationAtIndex(idx).GetAddress().GetSymbolContext(lldb.eSymbolContextCompUnit).GetCompileUnit().GetFileSpec() - print "Got comp unit: ", comp_unit.GetFilename() + print("Got comp unit: ", comp_unit.GetFilename()) if comp_unit.GetFilename() == "a.c": got_one_in_A = True elif comp_unit.GetFilename() == "b.c": @@ -64,7 +66,7 @@ class PythonBreakpointCommandSettingTestCase(TestBase): error = body_bkpt.SetScriptCallbackBody("\ import TestBreakpointCommandsFromPython\n\ TestBreakpointCommandsFromPython.PythonBreakpointCommandSettingTestCase.my_var = 20\n\ -print 'Hit breakpoint'") +print('Hit breakpoint')") self.assertTrue (error.Success(), "Failed to set the script callback body: %s."%(error.GetCString())) self.dbg.HandleCommand("command script import --allow-reload ./bktptcmd.py") diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py b/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py index 2e2eac98aa4..afc9f91eb30 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py @@ -2,6 +2,8 @@ Test _regexp-break command which uses regular expression matching to dispatch to other built in breakpoint commands. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py b/lldb/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py index 30186641c64..4bbb0327eac 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py @@ -1,4 +1,6 @@ +from __future__ import print_function + def function(frame, bp_loc, dict): there = open("output2.txt", "w"); - print >> there, "lldb"; + print("lldb", file=there) there.close() diff --git a/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py index 2c3090436e3..d69637e90e3 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py @@ -2,6 +2,8 @@ Test breakpoint conditions with 'breakpoint modify -c <expr> id'. """ +from __future__ import print_function + import lldb_shared import os, time @@ -126,7 +128,7 @@ class BreakpointConditionsTestCase(TestBase): # Now create a breakpoint on main.c by name 'c'. breakpoint = target.BreakpointCreateByName('c', 'a.out') - #print "breakpoint:", breakpoint + #print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) diff --git a/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py b/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py index effd1ef2231..3fe89f32813 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py @@ -2,6 +2,8 @@ Test lldb breakpoint ids. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py b/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py index 690d35da424..c012bb2234d 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py @@ -2,6 +2,8 @@ Test breakpoint ignore count features. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py b/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py index e992df3dcd5..3f9a630945e 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py @@ -2,6 +2,8 @@ Test breakpoint commands for a breakpoint ID with multiple locations. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py b/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py index a2545adebb5..3e03a40e46b 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py @@ -2,6 +2,8 @@ Test breakpoint command for different options. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py b/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py index 809a7944503..c290bcb785b 100644 --- a/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py +++ b/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py @@ -1,6 +1,8 @@ """ Test breakpoint command with AT_comp_dir set to symbolic link. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py b/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py index 103b38c7624..e4ef5154a48 100644 --- a/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py +++ b/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py @@ -2,6 +2,8 @@ Test continue from a breakpoint when there is a breakpoint on the next instruction also. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py b/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py index fb27df1a11a..febd6190d86 100644 --- a/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py +++ b/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py @@ -2,6 +2,8 @@ Test lldb breakpoint ids. """ +from __future__ import print_function + import lldb_shared import os, time @@ -32,7 +34,7 @@ class TestCPPBreakpointLocations(TestBase): for name in names: found = name in bp_loc_names if not found: - print "Didn't find '%s' in: %s" % (name, bp_loc_names) + print("Didn't find '%s' in: %s" % (name, bp_loc_names)) self.assertTrue (found, "Make sure we find all required locations") def breakpoint_id_tests (self): diff --git a/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py b/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py index e01bdb4828d..7db738969c2 100644 --- a/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py +++ b/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py @@ -2,6 +2,8 @@ Test that you can set breakpoint and hit the C++ language exception breakpoint """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py b/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py index da62c9dc754..65e7f1d50e4 100644 --- a/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py +++ b/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py @@ -2,6 +2,8 @@ Test breakpoint commands set before we have a target """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py b/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py index d12b39d1cb7..73014c026ac 100644 --- a/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py +++ b/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py @@ -3,6 +3,8 @@ Test that inlined breakpoints (breakpoint set on a file/line included from another source file) works correctly. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py b/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py index b61132d5e32..5cb91239925 100644 --- a/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py +++ b/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py @@ -3,6 +3,8 @@ Test that objective-c constant strings are generated correctly by the expression parser. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/command_history/TestCommandHistory.py b/lldb/test/functionalities/command_history/TestCommandHistory.py index 3022433a594..bb7d78fb4ac 100644 --- a/lldb/test/functionalities/command_history/TestCommandHistory.py +++ b/lldb/test/functionalities/command_history/TestCommandHistory.py @@ -2,6 +2,8 @@ Test the command history mechanism """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/command_regex/TestCommandRegex.py b/lldb/test/functionalities/command_regex/TestCommandRegex.py index 5400b547fce..128473a36bd 100644 --- a/lldb/test/functionalities/command_regex/TestCommandRegex.py +++ b/lldb/test/functionalities/command_regex/TestCommandRegex.py @@ -2,6 +2,8 @@ Test lldb 'commands regex' command which allows the user to create a regular expression command. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/command_script/TestCommandScript.py b/lldb/test/functionalities/command_script/TestCommandScript.py index b8a891630c3..ba47ed8d959 100644 --- a/lldb/test/functionalities/command_script/TestCommandScript.py +++ b/lldb/test/functionalities/command_script/TestCommandScript.py @@ -2,6 +2,8 @@ Test lldb Python commands. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/command_script/import/TestImport.py b/lldb/test/functionalities/command_script/import/TestImport.py index f413bdc4baa..9a6937b99c3 100644 --- a/lldb/test/functionalities/command_script/import/TestImport.py +++ b/lldb/test/functionalities/command_script/import/TestImport.py @@ -1,5 +1,7 @@ """Test custom import command to import files by path.""" +from __future__ import print_function + import lldb_shared import os, sys, time diff --git a/lldb/test/functionalities/command_script/import/bar/bar.py b/lldb/test/functionalities/command_script/import/bar/bar.py index 28a4488fa70..bbc41f3b217 100644 --- a/lldb/test/functionalities/command_script/import/bar/bar.py +++ b/lldb/test/functionalities/command_script/import/bar/bar.py @@ -1,6 +1,8 @@ +from __future__ import print_function + def bar_function(debugger, args, result, dict): global UtilityModule - print >>result, (UtilityModule.barutil_function("bar told me " + args)) + print(UtilityModule.barutil_function("bar told me " + args), file=result) return None def __lldb_init_module(debugger, session_dict): diff --git a/lldb/test/functionalities/command_script/import/foo/bar/foobar.py b/lldb/test/functionalities/command_script/import/foo/bar/foobar.py index 212fea3251b..659ded22c90 100644 --- a/lldb/test/functionalities/command_script/import/foo/bar/foobar.py +++ b/lldb/test/functionalities/command_script/import/foo/bar/foobar.py @@ -1,3 +1,5 @@ +from __future__ import print_function + def foo_function(debugger, args, result, dict): - print >>result, ("foobar says " + args) + print("foobar says " + args, file=result) return None diff --git a/lldb/test/functionalities/command_script/import/foo/foo.py b/lldb/test/functionalities/command_script/import/foo/foo.py index f528e9846ad..51cc0c3bab1 100644 --- a/lldb/test/functionalities/command_script/import/foo/foo.py +++ b/lldb/test/functionalities/command_script/import/foo/foo.py @@ -1,3 +1,5 @@ +from __future__ import print_function + def foo_function(debugger, args, result, dict): - print >>result, ("foo says " + args) + print("foo says " + args, file=result) return None diff --git a/lldb/test/functionalities/command_script/import/foo/foo2.py b/lldb/test/functionalities/command_script/import/foo/foo2.py index 44e39cbac52..6863454ca6e 100644 --- a/lldb/test/functionalities/command_script/import/foo/foo2.py +++ b/lldb/test/functionalities/command_script/import/foo/foo2.py @@ -1,5 +1,7 @@ +from __future__ import print_function + def foo2_function(debugger, args, result, dict): - print >>result, ("foo2 says " + args) + print("foo2 says " + args, file=result) return None def __lldb_init_module(debugger, session_dict): diff --git a/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py b/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py index 4b19386379b..b5209d4a3a4 100644 --- a/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py +++ b/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py @@ -1,5 +1,7 @@ """Check that we handle an ImportError in a special way when command script importing files.""" +from __future__ import print_function + import lldb_shared import os, sys, time diff --git a/lldb/test/functionalities/command_script/mysto.py b/lldb/test/functionalities/command_script/mysto.py index 7191914731c..656cd150293 100644 --- a/lldb/test/functionalities/command_script/mysto.py +++ b/lldb/test/functionalities/command_script/mysto.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb import sys import os @@ -8,11 +10,11 @@ def StepOver(debugger, args, result, dict): Step over a given number of times instead of only just once """ arg_split = args.split(" ") - print type(arg_split) + print(type(arg_split)) count = int(arg_split[0]) for i in range(0,count): debugger.GetSelectedTarget().GetProcess().GetSelectedThread().StepOver(lldb.eOnlyThisThread) - print "step<%d>"%i + print("step<%d>"%i) def __lldb_init_module(debugger, session_dict): # by default, --synchronicity is set to synchronous diff --git a/lldb/test/functionalities/command_script/welcome.py b/lldb/test/functionalities/command_script/welcome.py index c6d4ddcfd40..5dbf09fbbec 100644 --- a/lldb/test/functionalities/command_script/welcome.py +++ b/lldb/test/functionalities/command_script/welcome.py @@ -1,3 +1,4 @@ +from __future__ import print_function import lldb, sys class WelcomeCommand(object): @@ -8,7 +9,7 @@ class WelcomeCommand(object): return "Just a docstring for welcome_impl\nA command that says hello to LLDB users" def __call__(self, debugger, args, exe_ctx, result): - print >>result, ('Hello ' + args + ', welcome to LLDB'); + print('Hello ' + args + ', welcome to LLDB', file=result); return None; class TargetnameCommand(object): @@ -18,7 +19,7 @@ class TargetnameCommand(object): def __call__(self, debugger, args, exe_ctx, result): target = debugger.GetSelectedTarget() file = target.GetExecutable() - print >>result, ('Current target ' + file.GetFilename()) + print('Current target ' + file.GetFilename(), file=result) if args == 'fail': result.SetError('a test for error in command') @@ -27,19 +28,19 @@ class TargetnameCommand(object): def print_wait_impl(debugger, args, result, dict): result.SetImmediateOutputFile(sys.stdout) - print >>result, ('Trying to do long task..') + print('Trying to do long task..', file=result) import time time.sleep(1) - print >>result, ('Still doing long task..') + print('Still doing long task..', file=result) time.sleep(1) - print >>result, ('Done; if you saw the delays I am doing OK') + print('Done; if you saw the delays I am doing OK', file=result) def check_for_synchro(debugger, args, result, dict): if debugger.GetAsync() == True: - print >>result, ('I am running async') + print('I am running async', file=result) if debugger.GetAsync() == False: - print >>result, ('I am running sync') + print('I am running sync', file=result) def takes_exe_ctx(debugger, args, exe_ctx, result, dict): - print >>result, str(exe_ctx.GetTarget()) + print(str(exe_ctx.GetTarget()), file=result) diff --git a/lldb/test/functionalities/command_source/TestCommandSource.py b/lldb/test/functionalities/command_source/TestCommandSource.py index 22f8ff74798..31862ac9bf5 100644 --- a/lldb/test/functionalities/command_source/TestCommandSource.py +++ b/lldb/test/functionalities/command_source/TestCommandSource.py @@ -4,6 +4,8 @@ Test that lldb command "command source" works correctly. See also http://llvm.org/viewvc/llvm-project?view=rev&revision=109673. """ +from __future__ import print_function + import lldb_shared import os, sys diff --git a/lldb/test/functionalities/command_source/my.py b/lldb/test/functionalities/command_source/my.py index 86ce5026163..cb2fd012e4b 100644 --- a/lldb/test/functionalities/command_source/my.py +++ b/lldb/test/functionalities/command_source/my.py @@ -1,4 +1,6 @@ +from __future__ import print_function + def date(): import datetime today = datetime.date.today() - print today + print(today) diff --git a/lldb/test/functionalities/completion/TestCompletion.py b/lldb/test/functionalities/completion/TestCompletion.py index f2c5302a7d4..097c9f572f7 100644 --- a/lldb/test/functionalities/completion/TestCompletion.py +++ b/lldb/test/functionalities/completion/TestCompletion.py @@ -2,6 +2,8 @@ Test the lldb command line completion mechanism. """ +from __future__ import print_function + import lldb_shared import os @@ -301,13 +303,13 @@ class CommandLineCompletionTestCase(TestBase): with open('child_send.txt', 'r') as fs: if self.TraceOn(): - print "\n\nContents of child_send.txt:" - print fs.read() + print("\n\nContents of child_send.txt:") + print(fs.read()) with open('child_read.txt', 'r') as fr: from_child = fr.read() if self.TraceOn(): - print "\n\nContents of child_read.txt:" - print from_child + print("\n\nContents of child_read.txt:") + print(from_child) # The matching could be verbatim or using generic re pattern. for p in patterns: diff --git a/lldb/test/functionalities/conditional_break/TestConditionalBreak.py b/lldb/test/functionalities/conditional_break/TestConditionalBreak.py index f077bcdc919..b51393f5dd1 100644 --- a/lldb/test/functionalities/conditional_break/TestConditionalBreak.py +++ b/lldb/test/functionalities/conditional_break/TestConditionalBreak.py @@ -2,6 +2,8 @@ Test conditionally break on a function and inspect its variables. """ +from __future__ import print_function + import lldb_shared import os, time @@ -61,7 +63,7 @@ class ConditionalBreakTestCase(TestBase): # like to try for at most 10 times. for j in range(10): if self.TraceOn(): - print "j is: ", j + print("j is: ", j) thread = process.GetThreadAtIndex(0) if thread.GetNumFrames() >= 2: @@ -94,7 +96,7 @@ class ConditionalBreakTestCase(TestBase): # breakpoint such that lldb only stops when the caller of c() is a(). # the "my" package that defines the date() function. if self.TraceOn(): - print "About to source .lldb" + print("About to source .lldb") if not self.TraceOn(): self.HideStdout() @@ -107,13 +109,13 @@ class ConditionalBreakTestCase(TestBase): self.runCmd ("break list") if self.TraceOn(): - print "About to run." + print("About to run.") self.runCmd("run", RUN_SUCCEEDED) self.runCmd ("break list") if self.TraceOn(): - print "Done running" + print("Done running") # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, diff --git a/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py b/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py index ed73ccc0537..0d97a407213 100644 --- a/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py +++ b/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py b/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py index 9fd66a0148d..64c09e1fdbc 100644 --- a/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py +++ b/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py index f645febe751..0cf33efffb8 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py b/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py index a367e391a6e..791cc267a46 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py index f2911eccd34..441463636a1 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py b/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py index 7be7276a918..cb1163a405c 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py b/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py index e004e59ca1b..0e6a58a25a6 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py b/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py index d81891c4ff2..7310f8599d0 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py b/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py index 516c54e593f..3ef22dad37d 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py b/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py index c7ee9f6bf2e..1a4a7f39671 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py @@ -3,6 +3,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py b/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py index 2778035d149..0600861334c 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py @@ -3,6 +3,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py b/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py index 30d13231883..957c8dbe057 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py b/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py index 84cb74bcee1..1347c43de68 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py b/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py index 39e363a986d..771e87c2f2b 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time @@ -225,7 +227,7 @@ class PythonSynthDataFormatterTestCase(TestBase): str_cast = str(test_cast) if self.TraceOn(): - print str_cast + print(str_cast) self.assertTrue(str_cast.find('A') != -1, 'could not find A in output') self.assertTrue(str_cast.find('B') != -1, 'could not find B in output') @@ -238,7 +240,7 @@ class PythonSynthDataFormatterTestCase(TestBase): str_cast = str(test_cast) if self.TraceOn(): - print str_cast + print(str_cast) # we detect that all the values of the child objects have changed - but the counter-generated item # is still fixed at 0 because it is cached - this would fail if update(self): in ftsp returned False diff --git a/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py b/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py index b025ba0dbd8..41d080d6b80 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py b/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py index 03e713e5569..327a121a4ae 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time @@ -131,13 +133,13 @@ class SkipSummaryDataFormatterTestCase(TestBase): if self.getCompiler().endswith('gcc') and not self.getCompiler().endswith('llvm-gcc'): import re gcc_version_output = system([[lldbutil.which(self.getCompiler()), "-v"]])[1] - #print "my output:", gcc_version_output + #print("my output:", gcc_version_output) for line in gcc_version_output.split(os.linesep): m = re.search('\(Apple Inc\. build ([0-9]+)\)', line) - #print "line:", line + #print("line:", line) if m: gcc_build = int(m.group(1)) - #print "gcc build:", gcc_build + #print("gcc build:", gcc_build) if gcc_build >= 5666: # rdar://problem/9804600" self.skipTest("rdar://problem/9804600 wrong namespace for std::string in debug info") diff --git a/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py b/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py index bb0e4e571ae..2ced549edb5 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py index af7430807ec..6626539504f 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py index 03bbf3c3c05..6ef51493543 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py index af705998d31..226cfb94edb 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time, re diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py index 1681e32a4ff..1ff25a1bc9e 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py @@ -3,6 +3,8 @@ Test that the debugger handles loops in std::list (which can appear as a result corruption). """ +from __future__ import print_function + import lldb_shared import os, time, re diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py index b5ce17d6434..5ea67b273e3 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py index 30a3a3f13bc..231ff85ab1c 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py index 9c82d023169..c341ce027b3 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py index 27d72ab457f..2c1b90b69a2 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py index 4e59e052d7b..0cb33b92f67 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py @@ -3,6 +3,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py index b24c911266a..e307af7f63f 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py index e4e65ed50d4..057a8f606d9 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py index 086972da7ba..ac5518a6a01 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py index 08a89d89333..ec31cd789c8 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py index 5f8468b1f5d..65d09e01103 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py index 89be9575beb..0f1fde45148 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py index 7f071875cb6..3a6145b11ba 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py @@ -3,6 +3,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py index 71434eff620..0aba73faa8e 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py index 30ded55f901..22128e16907 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py b/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py index f6bdacc98f1..694ebbe17f0 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py b/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py index 418083dc939..71296ecf459 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time @@ -58,7 +60,7 @@ class DataFormatterSynthValueTestCase(TestBase): z_val = z.GetValueAsUnsigned if self.TraceOn(): - print "x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val()) + print("x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val())) self.assertFalse(x_val() == 3, "x == 3 before synthetics") self.assertFalse(y_val() == 4, "y == 4 before synthetics") @@ -70,7 +72,7 @@ class DataFormatterSynthValueTestCase(TestBase): self.runCmd("type synth add -l myArraySynthProvider myArray") if self.TraceOn(): - print "x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val()) + print("x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val())) self.assertTrue(x_val() == 3, "x != 3 after synthetics") self.assertTrue(y_val() == 4, "y != 4 after synthetics") diff --git a/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py b/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py index 471086b9a2f..063fe382d9e 100644 --- a/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py +++ b/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py @@ -2,6 +2,8 @@ Check if changing Format on an SBValue correctly propagates that new format to children as it should """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py b/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py index ad5ee5ade7c..5726b3fd0ee 100644 --- a/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py +++ b/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py @@ -2,6 +2,8 @@ Test that the user can input a format but it will not prevail over summary format's choices. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py b/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py index 909c00f2b9f..77836ee1113 100644 --- a/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py +++ b/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py b/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py index 30846038285..a0154a45251 100644 --- a/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py +++ b/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py b/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py index 54442f2b32a..b9afb60a90a 100644 --- a/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py +++ b/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py b/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py index 41f7049882f..c5700a43985 100644 --- a/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py +++ b/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py b/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py index b044fc7f172..1fe3a600f93 100644 --- a/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py +++ b/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py b/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py index 88e345c6fce..ef9417282ab 100644 --- a/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py +++ b/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py b/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py index 0869ea9e74b..ebb34744ae1 100644 --- a/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py +++ b/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py @@ -2,6 +2,8 @@ Test that ValueObjectPrinter does not cause an infinite loop when a reference to a struct that contains a pointer to itself is printed. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py b/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py index 4b0ed7384ed..08aaea41725 100644 --- a/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py +++ b/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py index a4f50cbbbf9..f60fd4bd1d4 100644 --- a/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py +++ b/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py @@ -2,6 +2,8 @@ Check for an issue where capping does not work because the Target pointer appears to be changing behind our backs """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py b/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py index 80224ccf6aa..794fd76bb9c 100644 --- a/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py +++ b/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py b/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py index 8842896684a..c79cec39233 100644 --- a/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py +++ b/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py @@ -2,6 +2,8 @@ Test that the user can input a format but it will not prevail over summary format's choices. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py b/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py index 55c6c308f00..cb3927b6b51 100644 --- a/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py +++ b/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py b/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py index 4de0325ea4e..c4ce58d6f35 100644 --- a/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py +++ b/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py b/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py index 6235e61c712..b69fe2e450c 100644 --- a/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py +++ b/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py @@ -2,6 +2,8 @@ Check that vector types format properly """ +from __future__ import print_function + import lldb_shared import os, time @@ -49,7 +51,7 @@ class VectorTypesFormattingTestCase(TestBase): v.SetPreferSyntheticValue(True) v.SetFormat(lldb.eFormatVectorOfFloat32) - if self.TraceOn(): print v + if self.TraceOn(): print(v) self.assertTrue(v.GetNumChildren() == 4, "v as float32[] has 4 children") self.assertTrue(v.GetChildAtIndex(0).GetData().float[0] == 1.25, "child 0 == 1.25") diff --git a/lldb/test/functionalities/dead-strip/TestDeadStrip.py b/lldb/test/functionalities/dead-strip/TestDeadStrip.py index e61476139de..61e181c4ea4 100644 --- a/lldb/test/functionalities/dead-strip/TestDeadStrip.py +++ b/lldb/test/functionalities/dead-strip/TestDeadStrip.py @@ -2,6 +2,8 @@ Test that breakpoint works correctly in the presence of dead-code stripping. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py b/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py index e9ddf122f02..006832d8e87 100644 --- a/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py +++ b/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py @@ -2,6 +2,8 @@ Test some lldb command abbreviations. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py b/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py index 67c4d971233..6b31ebc26dc 100644 --- a/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py +++ b/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py @@ -2,6 +2,8 @@ Test that dynamic values update their child count correctly """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py b/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py index c07628b7abe..542748e1b5c 100644 --- a/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py +++ b/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py @@ -1,5 +1,7 @@ """Test convenience variables when you drop in from lldb prompt into an embedded interpreter.""" +from __future__ import print_function + import lldb_shared import os @@ -50,28 +52,28 @@ class ConvenienceVariablesCase(TestBase): # Python interpreter, then the lldb interpreter. self.child_in_script_interpreter = True - child.sendline('print lldb.debugger') + child.sendline('print(lldb.debugger)') child.expect_exact(python_prompt) self.expect(child.before, exe=False, patterns = ['Debugger \(instance: .*, id: \d\)']) - child.sendline('print lldb.target') + child.sendline('print(lldb.target)') child.expect_exact(python_prompt) self.expect(child.before, exe=False, substrs = ['a.out']) - child.sendline('print lldb.process') + child.sendline('print(lldb.process)') child.expect_exact(python_prompt) self.expect(child.before, exe=False, patterns = ['SBProcess: pid = \d+, state = stopped, threads = \d, executable = a.out']) - child.sendline('print lldb.thread') + child.sendline('print(lldb.thread)') child.expect_exact(python_prompt) # Linux outputs decimal tid and 'name' instead of 'queue' self.expect(child.before, exe=False, patterns = ['thread #1: tid = (0x[0-9a-f]+|[0-9]+), 0x[0-9a-f]+ a\.out`main\(argc=1, argv=0x[0-9a-f]+\) \+ \d+ at main\.c:%d, (name|queue) = \'.+\', stop reason = breakpoint 1\.1' % self.line]) - child.sendline('print lldb.frame') + child.sendline('print(lldb.frame)') child.expect_exact(python_prompt) self.expect(child.before, exe=False, patterns = ['frame #0: 0x[0-9a-f]+ a\.out`main\(argc=1, argv=0x[0-9a-f]+\) \+ \d+ at main\.c:%d' % self.line]) diff --git a/lldb/test/functionalities/exec/TestExec.py b/lldb/test/functionalities/exec/TestExec.py index 7b6ce977669..f7a519124a9 100644 --- a/lldb/test/functionalities/exec/TestExec.py +++ b/lldb/test/functionalities/exec/TestExec.py @@ -1,6 +1,8 @@ """ Test some lldb command abbreviations. """ +from __future__ import print_function + import lldb_shared import commands @@ -11,11 +13,11 @@ from lldbtest import * import lldbutil def execute_command (command): - #print '%% %s' % (command) + #print('%% %s' % (command)) (exit_status, output) = commands.getstatusoutput (command) #if output: - # print output - #print 'status = %u' % (exit_status) + # print(output) + #print('status = %u' % (exit_status)) return exit_status class ExecTestCase(TestBase): diff --git a/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py b/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py index 89d7f721905..377c7e753f3 100644 --- a/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py +++ b/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py @@ -2,6 +2,8 @@ Test that expr will time out and allow other threads to run if it blocks. """ +from __future__ import print_function + import lldb_shared import os, time @@ -33,7 +35,7 @@ class ExprDoesntDeadlockTestCase(TestBase): main_file_spec = lldb.SBFileSpec ("locking.c") breakpoint = target.BreakpointCreateBySourceRegex('Break here', main_file_spec) if self.TraceOn(): - print "breakpoint:", breakpoint + print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) diff --git a/lldb/test/functionalities/fat_archives/TestFatArchives.py b/lldb/test/functionalities/fat_archives/TestFatArchives.py index f6d06949b91..40b8f257709 100644 --- a/lldb/test/functionalities/fat_archives/TestFatArchives.py +++ b/lldb/test/functionalities/fat_archives/TestFatArchives.py @@ -1,6 +1,8 @@ """ Test some lldb command abbreviations. """ +from __future__ import print_function + import lldb_shared import commands @@ -11,11 +13,11 @@ from lldbtest import * import lldbutil def execute_command (command): - # print '%% %s' % (command) + # print('%% %s' % (command)) (exit_status, output) = commands.getstatusoutput (command) # if output: - # print output - # print 'status = %u' % (exit_status) + # print(output) + # print('status = %u' % (exit_status)) return exit_status class FatArchiveTestCase(TestBase): diff --git a/lldb/test/functionalities/format/TestFormats.py b/lldb/test/functionalities/format/TestFormats.py index 84566ea2fc9..d4123efb36e 100644 --- a/lldb/test/functionalities/format/TestFormats.py +++ b/lldb/test/functionalities/format/TestFormats.py @@ -2,6 +2,8 @@ Test the command history mechanism """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py index 37e88c7bc45..b307abaaf69 100644 --- a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py +++ b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py @@ -1,5 +1,7 @@ """Test that lldb functions correctly after the inferior has asserted.""" +from __future__ import print_function + import lldb_shared import os, time @@ -167,7 +169,7 @@ class AssertingInferiorTestCase(TestBase): frame = thread.GetFrameAtIndex(i) self.assertTrue(frame.IsValid(), "current frame is valid") if self.TraceOn(): - print "Checking if function %s is main" % frame.GetFunctionName() + print("Checking if function %s is main" % frame.GetFunctionName()) if 'main' == frame.GetFunctionName(): frame_id = frame.GetFrameID() diff --git a/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py b/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py index 9fce54c3c67..7caa6cc6676 100644 --- a/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py +++ b/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py @@ -1,5 +1,7 @@ """Test lldb reloads the inferior after it was changed during the session.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py index cd4ba304019..ee41cd5f9c2 100644 --- a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py +++ b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py @@ -1,5 +1,7 @@ """Test that lldb functions correctly after the inferior has crashed.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py b/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py index 61eea6e4b82..53ca4ffbcfb 100644 --- a/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py +++ b/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py @@ -1,5 +1,7 @@ """Test that lldb functions correctly after the inferior has crashed while in a recursive routine.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/inline-stepping/TestInlineStepping.py b/lldb/test/functionalities/inline-stepping/TestInlineStepping.py index b0d620e7443..aa9fcaed703 100644 --- a/lldb/test/functionalities/inline-stepping/TestInlineStepping.py +++ b/lldb/test/functionalities/inline-stepping/TestInlineStepping.py @@ -1,5 +1,7 @@ """Test stepping over and into inlined functions.""" +from __future__ import print_function + import lldb_shared import os, time, sys diff --git a/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py b/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py index 5b8b11d578e..8ed08fc4c86 100644 --- a/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py +++ b/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py @@ -1,5 +1,7 @@ """Test for the JITLoaderGDB interface""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py b/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py index 609a1b937a7..90e40ce8a63 100644 --- a/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py +++ b/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py @@ -1,6 +1,8 @@ """ Test that argdumper is a viable launching strategy. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/load_unload/TestLoadUnload.py b/lldb/test/functionalities/load_unload/TestLoadUnload.py index 7122cdc3c60..7f67fb539fc 100644 --- a/lldb/test/functionalities/load_unload/TestLoadUnload.py +++ b/lldb/test/functionalities/load_unload/TestLoadUnload.py @@ -2,6 +2,8 @@ Test that breakpoint by symbol name works correctly with dynamic libs. """ +from __future__ import print_function + import lldb_shared import os, time @@ -110,7 +112,7 @@ class LoadUnloadTestCase(TestBase): # Inform (DY)LD_LIBRARY_PATH of the new path, too. env_cmd_string = "settings set target.env-vars " + self.dylibPath + "=" + new_dir if self.TraceOn(): - print "Set environment to: ", env_cmd_string + print("Set environment to: ", env_cmd_string) self.runCmd(env_cmd_string) self.runCmd("settings show target.env-vars") @@ -224,7 +226,7 @@ class LoadUnloadTestCase(TestBase): output = self.res.GetOutput() pattern = re.compile("Image ([0-9]+) loaded") for l in output.split(os.linesep): - #print "l:", l + #print("l:", l) match = pattern.search(l) if match: break diff --git a/lldb/test/functionalities/longjmp/TestLongjmp.py b/lldb/test/functionalities/longjmp/TestLongjmp.py index 8cb51e68db8..b7294ed042c 100644 --- a/lldb/test/functionalities/longjmp/TestLongjmp.py +++ b/lldb/test/functionalities/longjmp/TestLongjmp.py @@ -2,6 +2,8 @@ Test the use of setjmp/longjmp for non-local goto operations in a single-threaded inferior. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/memory/read/TestMemoryRead.py b/lldb/test/functionalities/memory/read/TestMemoryRead.py index c6430aae91d..9fbb56fc6e2 100644 --- a/lldb/test/functionalities/memory/read/TestMemoryRead.py +++ b/lldb/test/functionalities/memory/read/TestMemoryRead.py @@ -2,6 +2,8 @@ Test the 'memory read' command. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py b/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py index 7835a3733be..3e1f21cdd34 100644 --- a/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py +++ b/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py @@ -1,6 +1,8 @@ """Test evaluating expressions which ref. index variable 'i' which just goes from out of scope to in scope when stopped at the breakpoint.""" +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/nosucharch/TestNoSuchArch.py b/lldb/test/functionalities/nosucharch/TestNoSuchArch.py index bf29645062c..9e5bd719acf 100644 --- a/lldb/test/functionalities/nosucharch/TestNoSuchArch.py +++ b/lldb/test/functionalities/nosucharch/TestNoSuchArch.py @@ -1,6 +1,8 @@ """ Test that using a non-existent architecture name does not crash LLDB. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py b/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py index 54c1d21c766..ea851c7c8cd 100644 --- a/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py +++ b/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py @@ -4,6 +4,8 @@ This exercises classes like ObjectFileELF and their support for opening foreign-architecture object files. """ +from __future__ import print_function + import lldb_shared import os.path diff --git a/lldb/test/functionalities/paths/TestPaths.py b/lldb/test/functionalities/paths/TestPaths.py index 35769206565..3376fabe0fd 100644 --- a/lldb/test/functionalities/paths/TestPaths.py +++ b/lldb/test/functionalities/paths/TestPaths.py @@ -1,6 +1,8 @@ """ Test some lldb command abbreviations. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/platform/TestPlatformCommand.py b/lldb/test/functionalities/platform/TestPlatformCommand.py index 97908269da8..c049356d630 100644 --- a/lldb/test/functionalities/platform/TestPlatformCommand.py +++ b/lldb/test/functionalities/platform/TestPlatformCommand.py @@ -2,6 +2,8 @@ Test some lldb platform commands. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/plugins/commands/TestPluginCommands.py b/lldb/test/functionalities/plugins/commands/TestPluginCommands.py index 4053fe336c1..50146c9d006 100644 --- a/lldb/test/functionalities/plugins/commands/TestPluginCommands.py +++ b/lldb/test/functionalities/plugins/commands/TestPluginCommands.py @@ -2,6 +2,8 @@ Test that plugins that load commands work correctly. """ +from __future__ import print_function + import lldb_shared import os, time @@ -47,7 +49,7 @@ class PluginCommandTestCase(TestBase): retval = debugger.GetCommandInterpreter().HandleCommand("plugin_loaded_command child abc def ghi",retobj) if self.TraceOn(): - print retobj.GetOutput() + print(retobj.GetOutput()) self.expect(retobj,substrs = ['abc def ghi'], exe=False) @@ -57,6 +59,6 @@ class PluginCommandTestCase(TestBase): retval = debugger.GetCommandInterpreter().HandleCommand("plugin_loaded_ ch abc def ghi",retobj) if self.TraceOn(): - print retobj.GetOutput() + print(retobj.GetOutput()) self.expect(retobj,substrs = ['abc def ghi'], exe=False) diff --git a/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py b/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py index 749916fefd7..a1d61766ee5 100644 --- a/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py +++ b/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py @@ -2,6 +2,8 @@ Test that the Python operating system plugin works correctly """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py b/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py index bbacc19846c..379b27b4ce0 100644 --- a/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py +++ b/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py @@ -2,6 +2,8 @@ Test basics of mini dump debugging. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/process_attach/TestProcessAttach.py b/lldb/test/functionalities/process_attach/TestProcessAttach.py index ed11a486181..023da1373ba 100644 --- a/lldb/test/functionalities/process_attach/TestProcessAttach.py +++ b/lldb/test/functionalities/process_attach/TestProcessAttach.py @@ -2,6 +2,8 @@ Test process attach. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py b/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py index 74013faacfb..bc0b850ea36 100644 --- a/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py +++ b/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py @@ -2,6 +2,8 @@ Test denied process attach. """ +from __future__ import print_function + import lldb_shared import os @@ -42,7 +44,7 @@ class AttachDeniedTestCase(TestBase): if err.Success() and retcode == 0: break else: - print msg + print(msg) if i < max_attempts: # Exponential backoff! time.sleep(pow(2, i) * 0.25) diff --git a/lldb/test/functionalities/process_group/TestChangeProcessGroup.py b/lldb/test/functionalities/process_group/TestChangeProcessGroup.py index 6864c475953..c31d8173fe4 100644 --- a/lldb/test/functionalities/process_group/TestChangeProcessGroup.py +++ b/lldb/test/functionalities/process_group/TestChangeProcessGroup.py @@ -1,5 +1,7 @@ """Test that we handle inferiors which change their process group""" +from __future__ import print_function + import lldb_shared import os @@ -39,7 +41,7 @@ class ChangeProcessGroupTestCase(TestBase): if err.Success() and retcode == 0: break else: - print msg + print(msg) if i < max_attempts: # Exponential backoff! time.sleep(pow(2, i) * 0.25) diff --git a/lldb/test/functionalities/process_launch/TestProcessLaunch.py b/lldb/test/functionalities/process_launch/TestProcessLaunch.py index 50e219f4dcb..75b3a2584a3 100644 --- a/lldb/test/functionalities/process_launch/TestProcessLaunch.py +++ b/lldb/test/functionalities/process_launch/TestProcessLaunch.py @@ -2,6 +2,8 @@ Test lldb process launch flags. """ +from __future__ import print_function + import lldb_shared import os, time @@ -160,7 +162,7 @@ class ProcessLaunchTestCase(TestBase): # Check to see if the 'stdout' file contains the right output line = out_f.readline(); if self.TraceOn(): - print "line:", line + print("line:", line) if not re.search(mywd, line): success = False err_msg = err_msg + "The current working directory was not set correctly.\n" diff --git a/lldb/test/functionalities/recursion/TestValueObjectRecursion.py b/lldb/test/functionalities/recursion/TestValueObjectRecursion.py index fa9000410e0..778d880a093 100644 --- a/lldb/test/functionalities/recursion/TestValueObjectRecursion.py +++ b/lldb/test/functionalities/recursion/TestValueObjectRecursion.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time @@ -45,12 +47,12 @@ class ValueObjectRecursionTestCase(TestBase): root = self.frame().FindVariable("root") child = root.GetChildAtIndex(1) if self.TraceOn(): - print root - print child + print(root) + print(child) for i in range(0,24500): child = child.GetChildAtIndex(1) if self.TraceOn(): - print child + print(child) self.assertTrue(child.IsValid(),"could not retrieve the deep ValueObject") self.assertTrue(child.GetChildAtIndex(0).IsValid(),"the deep ValueObject has no value") self.assertTrue(child.GetChildAtIndex(0).GetValueAsUnsigned() != 0,"the deep ValueObject has a zero value") diff --git a/lldb/test/functionalities/register/TestRegisters.py b/lldb/test/functionalities/register/TestRegisters.py index efdbaaf8e47..b77ade7b08c 100755 --- a/lldb/test/functionalities/register/TestRegisters.py +++ b/lldb/test/functionalities/register/TestRegisters.py @@ -2,6 +2,8 @@ Test the 'register' command. """ +from __future__ import print_function + import lldb_shared import os, sys, time @@ -176,8 +178,8 @@ class RegisterCommandsTestCase(TestBase): for str1 in substrs: matched = output.find(str1) != -1 with recording(self, False) as sbuf: - print >> sbuf, "%s sub string: %s" % ('Expecting', str1) - print >> sbuf, "Matched" if matched else "Not Matched" + print("%s sub string: %s" % ('Expecting', str1), file=sbuf) + print("Matched" if matched else "Not Matched", file=sbuf) if matched: break self.assertTrue(matched, STOPPED_DUE_TO_SIGNAL) @@ -339,7 +341,7 @@ class RegisterCommandsTestCase(TestBase): self.addTearDownHook(self.cleanupSubprocesses) if self.TraceOn(): - print "pid of spawned process: %d" % pid + print("pid of spawned process: %d" % pid) self.runCmd("process attach -p %d" % pid) diff --git a/lldb/test/functionalities/rerun/TestRerun.py b/lldb/test/functionalities/rerun/TestRerun.py index 7d5972bb9b5..63b92c9752e 100644 --- a/lldb/test/functionalities/rerun/TestRerun.py +++ b/lldb/test/functionalities/rerun/TestRerun.py @@ -1,6 +1,8 @@ """ Test that argdumper is a viable launching strategy. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/return-value/TestReturnValue.py b/lldb/test/functionalities/return-value/TestReturnValue.py index 9f7c07a3653..9ced2682118 100644 --- a/lldb/test/functionalities/return-value/TestReturnValue.py +++ b/lldb/test/functionalities/return-value/TestReturnValue.py @@ -2,6 +2,8 @@ Test getting return-values correctly when stepping out """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/set-data/TestSetData.py b/lldb/test/functionalities/set-data/TestSetData.py index f260bbdd9ef..c8b388f5b72 100644 --- a/lldb/test/functionalities/set-data/TestSetData.py +++ b/lldb/test/functionalities/set-data/TestSetData.py @@ -2,6 +2,8 @@ Set the contents of variables and registers using raw data """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/signal/TestSendSignal.py b/lldb/test/functionalities/signal/TestSendSignal.py index 71b96b76c11..0e3c10b21a5 100644 --- a/lldb/test/functionalities/signal/TestSendSignal.py +++ b/lldb/test/functionalities/signal/TestSendSignal.py @@ -1,5 +1,7 @@ """Test that lldb command 'process signal SIGUSR1' to send a signal to the inferior works.""" +from __future__ import print_function + import lldb_shared import os, time, signal diff --git a/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py b/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py index 70b8cf2498e..b9380034d18 100644 --- a/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py +++ b/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py @@ -1,5 +1,7 @@ """Test that we can debug inferiors that handle SIGSEGV by themselves""" +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/signal/raise/TestRaise.py b/lldb/test/functionalities/signal/raise/TestRaise.py index 6705bfd5ff3..8a976b6c4b0 100644 --- a/lldb/test/functionalities/signal/raise/TestRaise.py +++ b/lldb/test/functionalities/signal/raise/TestRaise.py @@ -1,5 +1,7 @@ """Test that we handle inferiors that send signals to themselves""" +from __future__ import print_function + import lldb_shared import os @@ -184,7 +186,7 @@ class RaiseTestCase(TestBase): # The last WaitForEvent call will time out after 2 seconds. while listener.WaitForEvent(2, event): if self.TraceOn(): - print "Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event)) + print("Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event))) # now the process should be stopped self.assertEqual(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) @@ -204,7 +206,7 @@ class RaiseTestCase(TestBase): # Clear the events again while listener.WaitForEvent(2, event): if self.TraceOn(): - print "Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event)) + print("Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event))) # The process should be stopped due to a signal self.assertEqual(process.GetState(), lldb.eStateStopped) diff --git a/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py b/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py index 17af6cb8c5e..111940ea857 100644 --- a/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py +++ b/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py @@ -2,6 +2,8 @@ Test the lldb command line takes a filename with single quote chars. """ +from __future__ import print_function + import lldb_shared import os @@ -57,13 +59,13 @@ class SingleQuoteInCommandLineTestCase(TestBase): with open('child_send.txt', 'r') as fs: if self.TraceOn(): - print "\n\nContents of child_send.txt:" - print fs.read() + print("\n\nContents of child_send.txt:") + print(fs.read()) with open('child_read.txt', 'r') as fr: from_child = fr.read() if self.TraceOn(): - print "\n\nContents of child_read.txt:" - print from_child + print("\n\nContents of child_read.txt:") + print(from_child) self.expect(from_child, exe=False, substrs = ["Current executable set to"]) diff --git a/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py b/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py index 3585b2f531a..3427ec16d52 100644 --- a/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py +++ b/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py @@ -2,6 +2,8 @@ Test thread step-in, step-over and step-out work with the "Avoid no debug" option. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/stop-hook/TestStopHookCmd.py b/lldb/test/functionalities/stop-hook/TestStopHookCmd.py index 9158412fc5a..916faee7253 100644 --- a/lldb/test/functionalities/stop-hook/TestStopHookCmd.py +++ b/lldb/test/functionalities/stop-hook/TestStopHookCmd.py @@ -2,6 +2,8 @@ Test lldb target stop-hook command. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py b/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py index 211c3f97cb2..cba672e0811 100644 --- a/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py +++ b/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py @@ -2,6 +2,8 @@ Test lldb target stop-hook mechanism to see whether it fires off correctly . """ +from __future__ import print_function + import lldb_shared import os @@ -83,7 +85,7 @@ class StopHookMechanismTestCase(TestBase): # make up a whole nother test case for it. child.sendline('frame info') at_line = 'at main.cpp:%d' % (self.correct_step_line) - print 'expecting "%s"' % at_line + print('expecting "%s"' % at_line) child.expect_exact(at_line) # Now continue the inferior, we'll stop at another breakpoint which is outside the stop-hook range. diff --git a/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py b/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py index 49da3fae154..a929ac6d110 100644 --- a/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py +++ b/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py @@ -2,6 +2,8 @@ Test that lldb stop-hook works for multiple threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/target_command/TestTargetCommand.py b/lldb/test/functionalities/target_command/TestTargetCommand.py index 28dcd1c8a45..bf1d1855c69 100644 --- a/lldb/test/functionalities/target_command/TestTargetCommand.py +++ b/lldb/test/functionalities/target_command/TestTargetCommand.py @@ -2,6 +2,8 @@ Test some target commands: create, list, select, variable. """ +from __future__ import print_function + import lldb_shared import lldb @@ -76,7 +78,7 @@ class targetCommandTestCase(TestBase): if match: # We will start from (index + 1) .... base = int(match.group(1), 10) + 1 - #print "base is:", base + #print("base is:", base) break; self.runCmd("target create " + exe_a, CURRENT_EXECUTABLE_SET) diff --git a/lldb/test/functionalities/thread/TestNumThreads.py b/lldb/test/functionalities/thread/TestNumThreads.py index 8a2ad59e258..4ba3ed50d82 100644 --- a/lldb/test/functionalities/thread/TestNumThreads.py +++ b/lldb/test/functionalities/thread/TestNumThreads.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py b/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py index 462314b735d..3ea2b5c6907 100644 --- a/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py +++ b/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py b/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py index 3fa1b4968bc..af86dbf3378 100644 --- a/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py +++ b/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py @@ -10,6 +10,8 @@ until exit or a crash takes place, and the number of events seen by LLDB is verified to match the expected number of events. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py b/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py index 89eccfdccf7..81b3beb4783 100644 --- a/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py +++ b/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py @@ -2,6 +2,8 @@ Test that step-inst over a crash behaves correctly. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py b/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py index d91f8d5d4eb..344483ba603 100644 --- a/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py +++ b/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py @@ -2,6 +2,8 @@ Test thread creation after process attach. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py b/lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py index a5ceae3dacd..cee27354e10 100644 --- a/lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py +++ b/lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py b/lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py index dc1d4dca9b0..760b950651f 100644 --- a/lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py +++ b/lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py b/lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py index 30ca8fe9025..1f764af68e7 100644 --- a/lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py +++ b/lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/jump/TestThreadJump.py b/lldb/test/functionalities/thread/jump/TestThreadJump.py index a9b06863a72..4a55aff1714 100644 --- a/lldb/test/functionalities/thread/jump/TestThreadJump.py +++ b/lldb/test/functionalities/thread/jump/TestThreadJump.py @@ -2,6 +2,8 @@ Test jumping to different places. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py b/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py index 3afd6a22475..59fa0817368 100644 --- a/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py +++ b/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/state/TestThreadStates.py b/lldb/test/functionalities/thread/state/TestThreadStates.py index 06225f1eefc..0a434bf26c3 100644 --- a/lldb/test/functionalities/thread/state/TestThreadStates.py +++ b/lldb/test/functionalities/thread/state/TestThreadStates.py @@ -2,6 +2,8 @@ Test thread states. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/thread/step_out/TestThreadStepOut.py b/lldb/test/functionalities/thread/step_out/TestThreadStepOut.py index 3100b361d16..aa5d09e44c1 100644 --- a/lldb/test/functionalities/thread/step_out/TestThreadStepOut.py +++ b/lldb/test/functionalities/thread/step_out/TestThreadStepOut.py @@ -2,6 +2,8 @@ Test stepping out from a function in a multi-threaded program. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/thread_exit/TestThreadExit.py b/lldb/test/functionalities/thread/thread_exit/TestThreadExit.py index 39797651e79..facf1aa0d3d 100644 --- a/lldb/test/functionalities/thread/thread_exit/TestThreadExit.py +++ b/lldb/test/functionalities/thread/thread_exit/TestThreadExit.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py b/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py index 0c2c884cf6c..ab68309af93 100644 --- a/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py +++ b/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py @@ -2,6 +2,8 @@ Test that we obey thread conditioned breakpoints. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/tty/TestTerminal.py b/lldb/test/functionalities/tty/TestTerminal.py index 79cc264ab15..8706a46736c 100644 --- a/lldb/test/functionalities/tty/TestTerminal.py +++ b/lldb/test/functionalities/tty/TestTerminal.py @@ -2,6 +2,8 @@ Test lldb command aliases. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/type_completion/TestTypeCompletion.py b/lldb/test/functionalities/type_completion/TestTypeCompletion.py index 57952182a26..f5e6e941b56 100644 --- a/lldb/test/functionalities/type_completion/TestTypeCompletion.py +++ b/lldb/test/functionalities/type_completion/TestTypeCompletion.py @@ -2,6 +2,8 @@ Check that types only get completed when necessary. """ +from __future__ import print_function + import lldb_shared import os, time @@ -72,11 +74,11 @@ class TypeCompletionTestCase(TestBase): self.assertTrue(name_address_type.IsTypeComplete(), 'NameAndAddress should now be complete') field0 = name_address_type.GetFieldAtIndex(0) if self.TraceOn(): - print 'field0: ' + str(field0) + print('field0: ' + str(field0)) self.assertTrue(field0.IsValid(), 'NameAndAddress::m_name should be valid') string = field0.GetType().GetPointeeType() if self.TraceOn(): - print 'string: ' + str(string) + print('string: ' + str(string)) self.assertTrue(string.IsValid(), 'std::string should be valid') self.assertFalse(string.IsTypeComplete(), 'std::string complete but it should not be') @@ -90,11 +92,11 @@ class TypeCompletionTestCase(TestBase): self.assertTrue(name_address_type.IsTypeComplete(), 'NameAndAddress should now be complete') field0 = name_address_type.GetFieldAtIndex(0) if self.TraceOn(): - print 'field0: ' + str(field0) + print('field0: ' + str(field0)) self.assertTrue(field0.IsValid(), 'NameAndAddress::m_name should be valid') string = field0.GetType().GetPointeeType() if self.TraceOn(): - print 'string: ' + str(string) + print('string: ' + str(string)) self.assertTrue(string.IsValid(), 'std::string should be valid') self.assertFalse(string.IsTypeComplete(), 'std::string complete but it should not be') diff --git a/lldb/test/functionalities/type_lookup/TestTypeLookup.py b/lldb/test/functionalities/type_lookup/TestTypeLookup.py index 4e27a02d4e5..26e56c9b901 100644 --- a/lldb/test/functionalities/type_lookup/TestTypeLookup.py +++ b/lldb/test/functionalities/type_lookup/TestTypeLookup.py @@ -2,6 +2,8 @@ Test type lookup command. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py b/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py index 2d557f1b9d0..7b0fa135012 100644 --- a/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py +++ b/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py @@ -2,6 +2,8 @@ Test that we can backtrace correctly with 'noreturn' functions on the stack """ +from __future__ import print_function + import lldb_shared import os, time @@ -42,9 +44,9 @@ class NoreturnUnwind(TestBase): abort_frame_number = abort_frame_number + 1 if self.TraceOn(): - print "Backtrace once we're stopped:" + print("Backtrace once we're stopped:") for f in thread.frames: - print " %d %s" % (f.GetFrameID(), f.GetFunctionName()) + print(" %d %s" % (f.GetFrameID(), f.GetFunctionName())) # I'm going to assume that abort() ends up calling/invoking another # function before halting the process. In which case if abort_frame_number diff --git a/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py b/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py index fe375b422ec..a4d25fa1223 100644 --- a/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py +++ b/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py @@ -2,6 +2,8 @@ Test that we can backtrace correctly with 'sigtramp' functions on the stack """ +from __future__ import print_function + import lldb_shared import os, time @@ -62,9 +64,9 @@ class SigtrampUnwind(TestBase): found_main = True if self.TraceOn(): - print "Backtrace once we're stopped:" + print("Backtrace once we're stopped:") for f in thread.frames: - print " %d %s" % (f.GetFrameID(), f.GetFunctionName()) + print(" %d %s" % (f.GetFrameID(), f.GetFunctionName())) if found_handler == False: self.fail("Unable to find handler() in backtrace.") diff --git a/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py b/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py index 58f7db04be1..bba6a71a3e9 100644 --- a/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py +++ b/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py @@ -10,6 +10,8 @@ file up and generate a test case from it in run time (with name test_standard_un after escaping some special characters). """ +from __future__ import print_function + import lldb_shared import unittest2 @@ -84,9 +86,9 @@ class StandardUnwindTest(TestBase): thread = process.GetThreadAtIndex(0) if self.TraceOn(): - print "INDEX: %u" % index + print("INDEX: %u" % index) for f in thread.frames: - print f + print(f) if thread.GetFrameAtIndex(0).GetFunctionName() is not None: found_main = False @@ -131,7 +133,7 @@ for f in test_source_files: self.setTearDownCleanup(d) except: if self.TraceOn(): - print sys.exc_info()[0] + print(sys.exc_info()[0]) self.skipTest("Inferior not supported") self.standard_unwind_tests() diff --git a/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py b/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py index 9a51c5875a6..01914a35161 100644 --- a/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py +++ b/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py @@ -2,6 +2,8 @@ Verify that the hash computing logic for ValueObject's values can't crash us. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py b/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py index d784faa24c7..da487572754 100644 --- a/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py +++ b/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py @@ -2,6 +2,8 @@ Test lldb watchpoint that uses '-s size' to watch a pointed location with size. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py b/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py index ee92815f77a..cfdcd727d2c 100644 --- a/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py +++ b/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py @@ -2,6 +2,8 @@ Test my first lldb watchpoint. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py b/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py index 024791ae76d..48e5e98aca7 100644 --- a/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py +++ b/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py @@ -2,6 +2,8 @@ Test that lldb watchpoint works for multiple threads. """ +from __future__ import print_function + import lldb_shared import os, time @@ -126,7 +128,7 @@ class WatchpointForMultipleThreadsTestCase(TestBase): self.fail("Watchpoint hits not supposed to exceed 1 by design!") # Good, we verified that the watchpoint works! Now delete the watchpoint. if self.TraceOn(): - print "watchpoint_stops=%d at the moment we delete the watchpoint" % watchpoint_stops + print("watchpoint_stops=%d at the moment we delete the watchpoint" % watchpoint_stops) self.runCmd("watchpoint delete 1") self.expect("watchpoint list -v", substrs = ['No watchpoints currently set.']) diff --git a/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py b/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py index 3401976d797..d64924e1981 100644 --- a/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py +++ b/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py @@ -1,5 +1,7 @@ """Test stepping over watchpoints.""" +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py b/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py index b2161369ded..681d420fec8 100644 --- a/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py +++ b/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py @@ -2,6 +2,8 @@ Test that a variable watchpoint should only hit when in scope. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py index cfa6a10bc25..24808f3214c 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py @@ -2,6 +2,8 @@ Test watchpoint list, enable, disable, and delete commands. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py index a7b9d4c0ea8..f89f76b0c0b 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py @@ -2,6 +2,8 @@ Test 'watchpoint command'. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py index 6bd8b93343e..1960c76df9b 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py @@ -2,6 +2,8 @@ Test 'watchpoint command'. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py index 5b66e653bcb..919a8a44687 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py @@ -2,6 +2,8 @@ Test watchpoint modify command to set condition on a watchpoint. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py b/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py index 821062d939a..6483f879c73 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py @@ -1,5 +1,7 @@ """Test that adding, deleting and modifying watchpoints sends the appropriate events.""" +from __future__ import print_function + import lldb_shared import os, time @@ -82,6 +84,6 @@ class TestWatchpointEvents (TestBase): # There shouldn't be another event waiting around: found_event = self.listener.PeekAtNextEventForBroadcasterWithType (self.target_bcast, lldb.SBTarget.eBroadcastBitBreakpointChanged, event) if found_event: - print "Found an event I didn't expect: ", event + print("Found an event I didn't expect: ", event) self.assertTrue (not found_event, "Only one event per change.") diff --git a/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py b/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py index 2a340dad255..a594bbda8c8 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py @@ -2,6 +2,8 @@ Test displayed value of a vector variable while doing watchpoint operations """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py index cdfd435b2ad..7763e78f39a 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py @@ -2,6 +2,8 @@ Test lldb watchpoint that uses 'watchpoint set -w write -s size' to watch a pointed location with size. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py index f7e7bcff702..b6f80910287 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py @@ -2,6 +2,8 @@ Test error cases for the 'watchpoint set' command to make sure it errors out when necessary. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/help/TestHelp.py b/lldb/test/help/TestHelp.py index 2c665e104fe..b25666c0030 100644 --- a/lldb/test/help/TestHelp.py +++ b/lldb/test/help/TestHelp.py @@ -4,6 +4,8 @@ Test some lldb help commands. See also CommandInterpreter::OutputFormattedHelpText(). """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/anonymous/TestAnonymous.py b/lldb/test/lang/c/anonymous/TestAnonymous.py index 1899384c1cd..3f79233248b 100644 --- a/lldb/test/lang/c/anonymous/TestAnonymous.py +++ b/lldb/test/lang/c/anonymous/TestAnonymous.py @@ -1,5 +1,7 @@ """Test that anonymous structs/unions are transparent to member access""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/array_types/TestArrayTypes.py b/lldb/test/lang/c/array_types/TestArrayTypes.py index 98e839ca104..85b4ede7cea 100644 --- a/lldb/test/lang/c/array_types/TestArrayTypes.py +++ b/lldb/test/lang/c/array_types/TestArrayTypes.py @@ -1,5 +1,7 @@ """Test breakpoint by file/line number; and list variables with array types.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/bitfields/TestBitfields.py b/lldb/test/lang/c/bitfields/TestBitfields.py index 024af2d1c5c..5f53437678c 100644 --- a/lldb/test/lang/c/bitfields/TestBitfields.py +++ b/lldb/test/lang/c/bitfields/TestBitfields.py @@ -1,5 +1,7 @@ """Show bitfields and check that they display correctly.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/blocks/TestBlocks.py b/lldb/test/lang/c/blocks/TestBlocks.py index 783401e2e0f..5ad48ec09d4 100644 --- a/lldb/test/lang/c/blocks/TestBlocks.py +++ b/lldb/test/lang/c/blocks/TestBlocks.py @@ -1,5 +1,7 @@ """Test that lldb can invoke blocks and access variables inside them""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/c/const_variables/TestConstVariables.py b/lldb/test/lang/c/const_variables/TestConstVariables.py index 30fc91adab4..2f3a7638ab4 100644 --- a/lldb/test/lang/c/const_variables/TestConstVariables.py +++ b/lldb/test/lang/c/const_variables/TestConstVariables.py @@ -1,5 +1,7 @@ """Check that compiler-generated constant values work correctly""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/enum_types/TestEnumTypes.py b/lldb/test/lang/c/enum_types/TestEnumTypes.py index 6f1c52d2844..a8af9603800 100644 --- a/lldb/test/lang/c/enum_types/TestEnumTypes.py +++ b/lldb/test/lang/c/enum_types/TestEnumTypes.py @@ -1,5 +1,7 @@ """Look up enum type information and check for correct display.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/forward/TestForwardDeclaration.py b/lldb/test/lang/c/forward/TestForwardDeclaration.py index 6db0b30b567..430f20b0512 100644 --- a/lldb/test/lang/c/forward/TestForwardDeclaration.py +++ b/lldb/test/lang/c/forward/TestForwardDeclaration.py @@ -1,5 +1,7 @@ """Test that forward declaration of a data structure gets resolved correctly.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/function_types/TestFunctionTypes.py b/lldb/test/lang/c/function_types/TestFunctionTypes.py index fb46ea8be5e..ab5d1bc5166 100644 --- a/lldb/test/lang/c/function_types/TestFunctionTypes.py +++ b/lldb/test/lang/c/function_types/TestFunctionTypes.py @@ -1,5 +1,7 @@ """Test variable with function ptr type and that break on the function works.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/global_variables/TestGlobalVariables.py b/lldb/test/lang/c/global_variables/TestGlobalVariables.py index 7d9c0ddaecd..92f2526e9f0 100644 --- a/lldb/test/lang/c/global_variables/TestGlobalVariables.py +++ b/lldb/test/lang/c/global_variables/TestGlobalVariables.py @@ -1,5 +1,7 @@ """Show global variables and check that they do indeed have global scopes.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/modules/TestCModules.py b/lldb/test/lang/c/modules/TestCModules.py index 5875c777329..c35a687a2bc 100644 --- a/lldb/test/lang/c/modules/TestCModules.py +++ b/lldb/test/lang/c/modules/TestCModules.py @@ -1,5 +1,7 @@ """Test that importing modules in C works as expected.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/register_variables/TestRegisterVariables.py b/lldb/test/lang/c/register_variables/TestRegisterVariables.py index a73bc26e7eb..343dcc8704a 100644 --- a/lldb/test/lang/c/register_variables/TestRegisterVariables.py +++ b/lldb/test/lang/c/register_variables/TestRegisterVariables.py @@ -1,5 +1,7 @@ """Check that compiler-generated register values work correctly""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/set_values/TestSetValues.py b/lldb/test/lang/c/set_values/TestSetValues.py index ae70f77868e..c5685174af5 100644 --- a/lldb/test/lang/c/set_values/TestSetValues.py +++ b/lldb/test/lang/c/set_values/TestSetValues.py @@ -1,5 +1,7 @@ """Test settings and readings of program variables.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/shared_lib/TestSharedLib.py b/lldb/test/lang/c/shared_lib/TestSharedLib.py index dd095272d80..0d478064ea7 100644 --- a/lldb/test/lang/c/shared_lib/TestSharedLib.py +++ b/lldb/test/lang/c/shared_lib/TestSharedLib.py @@ -1,5 +1,7 @@ """Test that types defined in shared libraries work correctly.""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py b/lldb/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py index 611a3618a98..e4dac28cfd9 100644 --- a/lldb/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py +++ b/lldb/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py @@ -1,5 +1,7 @@ """Test that types defined in shared libraries with stripped symbols work correctly.""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py b/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py index ed50926fa47..170a02b8e65 100644 --- a/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py +++ b/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py @@ -1,5 +1,7 @@ """Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/stepping/TestThreadStepping.py b/lldb/test/lang/c/stepping/TestThreadStepping.py index e02551b3ac6..db8a726ff57 100644 --- a/lldb/test/lang/c/stepping/TestThreadStepping.py +++ b/lldb/test/lang/c/stepping/TestThreadStepping.py @@ -2,6 +2,8 @@ Test thread stepping features in combination with frame select. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/c/tls_globals/TestTlsGlobals.py b/lldb/test/lang/c/tls_globals/TestTlsGlobals.py index 305ff3984de..0959154f21a 100644 --- a/lldb/test/lang/c/tls_globals/TestTlsGlobals.py +++ b/lldb/test/lang/c/tls_globals/TestTlsGlobals.py @@ -1,5 +1,7 @@ """Test that thread-local storage can be read correctly.""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/c/typedef/Testtypedef.py b/lldb/test/lang/c/typedef/Testtypedef.py index 5c2882b715d..fc8a5a60239 100644 --- a/lldb/test/lang/c/typedef/Testtypedef.py +++ b/lldb/test/lang/c/typedef/Testtypedef.py @@ -1,5 +1,7 @@ """Look up type information for typedefs of same name at different lexical scope and check for correct display.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py b/lldb/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py index 867bfed4d7f..72c01ad344d 100644 --- a/lldb/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py +++ b/lldb/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py @@ -2,6 +2,8 @@ Test lldb breakpoint command for CPP methods & functions in a namespace. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/cpp/char1632_t/TestChar1632T.py b/lldb/test/lang/cpp/char1632_t/TestChar1632T.py index 7392f79bce7..0e55babc91a 100644 --- a/lldb/test/lang/cpp/char1632_t/TestChar1632T.py +++ b/lldb/test/lang/cpp/char1632_t/TestChar1632T.py @@ -3,6 +3,8 @@ Test that the C++11 support for char16_t and char32_t works correctly. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/cpp/class_static/TestStaticVariables.py b/lldb/test/lang/cpp/class_static/TestStaticVariables.py index c9182fe69d7..ba770af9826 100644 --- a/lldb/test/lang/cpp/class_static/TestStaticVariables.py +++ b/lldb/test/lang/cpp/class_static/TestStaticVariables.py @@ -2,6 +2,8 @@ Test display and Python APIs on file and class static variables. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/cpp/class_types/TestClassTypes.py b/lldb/test/lang/cpp/class_types/TestClassTypes.py index 6d737e04c99..9a46f5df36f 100644 --- a/lldb/test/lang/cpp/class_types/TestClassTypes.py +++ b/lldb/test/lang/cpp/class_types/TestClassTypes.py @@ -1,5 +1,7 @@ """Test breakpoint on a class constructor; and variable list the this object.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py b/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py index 031c2b352e9..f9e0f5fcd9c 100644 --- a/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py +++ b/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py @@ -2,6 +2,8 @@ Test the lldb disassemble command on each call frame when stopped on C's ctor. """ +from __future__ import print_function + import lldb_shared import os, time @@ -30,8 +32,8 @@ class IterateFrameAndDisassembleTestCase(TestBase): match = frameRE.search(line) if match: function = match.group(1) - #print "line:", line - #print "function:", function + #print("line:", line) + #print("function:", function) self.runCmd("disassemble -n '%s'" % function) @python_api_test @@ -51,8 +53,8 @@ class IterateFrameAndDisassembleTestCase(TestBase): function = frame.GetFunction() # Print the function header. if self.TraceOn(): - print - print function + print() + print(function) if function: # Get all instructions for this function and print them out. insts = function.GetInstructions(target) @@ -61,7 +63,7 @@ class IterateFrameAndDisassembleTestCase(TestBase): # But we want to print to stdout only if self.TraceOn() is True. disasm = str(inst) if self.TraceOn(): - print disasm + print(disasm) def setUp(self): # Call super's setUp(). diff --git a/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py b/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py index f46bad7dd9c..4d620a90725 100644 --- a/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py +++ b/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py @@ -2,6 +2,8 @@ Test lldb Python API SBValue::Cast(SBType) for C++ types. """ +from __future__ import print_function + import lldb_shared import unittest2 @@ -81,8 +83,8 @@ class CppValueCastTestCase(TestBase): if self.TraceOn(): for child in tellerA: - print "child name:", child.GetName() - print child + print("child name:", child.GetName()) + print(child) # Call SBValue.Cast() to obtain instanceA. instanceA = tellerA.Cast(typeA.GetPointerType()) @@ -91,8 +93,8 @@ class CppValueCastTestCase(TestBase): # Iterate through all the children and print their values. if self.TraceOn(): for child in instanceA: - print "child name:", child.GetName() - print child + print("child name:", child.GetName()) + print(child) a_member_val = instanceA.GetChildMemberWithName('m_a_val') self.DebugSBValue(a_member_val) self.assertTrue(a_member_val.GetValueAsUnsigned(error, 0) == 10) @@ -109,8 +111,8 @@ class CppValueCastTestCase(TestBase): if self.TraceOn(): for child in tellerB: - print "child name:", child.GetName() - print child + print("child name:", child.GetName()) + print(child) # Call SBValue.Cast() to obtain instanceB. instanceB = tellerB.Cast(typeB.GetPointerType()) @@ -119,8 +121,8 @@ class CppValueCastTestCase(TestBase): # Iterate through all the children and print their values. if self.TraceOn(): for child in instanceB: - print "child name:", child.GetName() - print child + print("child name:", child.GetName()) + print(child) b_member_val = instanceB.GetChildMemberWithName('m_b_val') self.DebugSBValue(b_member_val) self.assertTrue(b_member_val.GetValueAsUnsigned(error, 0) == 36) diff --git a/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py b/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py index 3ef4193a917..7095e42721c 100644 --- a/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py +++ b/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py @@ -2,6 +2,8 @@ Use lldb Python API to test dynamic values in C++ """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py b/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py index c0fb3103892..a31519ffc19 100644 --- a/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py +++ b/lldb/test/lang/cpp/enum_types/TestCPP11EnumTypes.py @@ -1,5 +1,7 @@ """Look up enum type information and check for correct display.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py b/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py index 51135c7a0a1..babe4f2f98a 100644 --- a/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py +++ b/lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py @@ -2,6 +2,8 @@ Test lldb exception breakpoint command for CPP. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/cpp/namespace/TestNamespace.py b/lldb/test/lang/cpp/namespace/TestNamespace.py index 08825c41af5..40f12988cb5 100644 --- a/lldb/test/lang/cpp/namespace/TestNamespace.py +++ b/lldb/test/lang/cpp/namespace/TestNamespace.py @@ -2,6 +2,8 @@ Test the printing of anonymous and named namespace variables. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py b/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py index 4ac48e1866b..df1b5acb737 100644 --- a/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py +++ b/lldb/test/lang/cpp/rdar12991846/TestRdar12991846.py @@ -3,6 +3,8 @@ Test that the expression parser returns proper Unicode strings. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/cpp/signed_types/TestSignedTypes.py b/lldb/test/lang/cpp/signed_types/TestSignedTypes.py index 8ae2e22c52b..5bac76e7020 100644 --- a/lldb/test/lang/cpp/signed_types/TestSignedTypes.py +++ b/lldb/test/lang/cpp/signed_types/TestSignedTypes.py @@ -2,6 +2,8 @@ Test that variables with signed types display correctly. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py b/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py index f221a1a5bb1..aaf16d3a049 100644 --- a/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py +++ b/lldb/test/lang/cpp/static_members/TestCPPStaticMembers.py @@ -2,6 +2,8 @@ Tests that C++ member and static variables have correct layout and scope. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/cpp/stl/TestSTL.py b/lldb/test/lang/cpp/stl/TestSTL.py index e32652602f8..66a8dce143f 100644 --- a/lldb/test/lang/cpp/stl/TestSTL.py +++ b/lldb/test/lang/cpp/stl/TestSTL.py @@ -2,6 +2,8 @@ Test some expressions involving STL data types. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py b/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py index dad5bf21eca..1ffb7652849 100644 --- a/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py +++ b/lldb/test/lang/cpp/stl/TestStdCXXDisassembly.py @@ -2,6 +2,8 @@ Test the lldb disassemble command on lib stdc++. """ +from __future__ import print_function + import lldb_shared import unittest2 @@ -96,9 +98,9 @@ class StdCXXDisassembleTestCase(TestBase): if match: LA = match.group(1) if self.TraceOn(): - print "line:", line - print "load address:", LA - print "SA:", SA + print("line:", line) + print("load address:", LA) + print("SA:", SA) if SA and LA: if int(LA, 16) > int(SA, 16): self.runCmd("disassemble -s %s -e %s" % (SA, LA)) diff --git a/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py b/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py index a1c9f25d31b..9ac570e67b0 100644 --- a/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py +++ b/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py @@ -2,6 +2,8 @@ Test that template instaniations of std::vector<long> and <short> in the same module have the correct types. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py b/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py index a2c8ff75f04..9154cc696c6 100644 --- a/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py +++ b/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py @@ -2,6 +2,8 @@ Test that variables with unsigned types display correctly. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/cpp/virtual/TestVirtual.py b/lldb/test/lang/cpp/virtual/TestVirtual.py index 0904cfc0c83..6863c071056 100644 --- a/lldb/test/lang/cpp/virtual/TestVirtual.py +++ b/lldb/test/lang/cpp/virtual/TestVirtual.py @@ -2,6 +2,8 @@ Test C++ virtual function and virtual inheritance. """ +from __future__ import print_function + import os, time import re import lldb @@ -71,7 +73,7 @@ class CppVirtualMadness(TestBase): if match: my_expr, val = match.group(1), match.group(2) gl.append((my_expr, val)) - #print "golden list:", gl + #print("golden list:", gl) # Now iterate through the golden list, comparing against the output from # 'expression var'. diff --git a/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py b/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py index d2b3ab91ba3..70cc028bf2d 100644 --- a/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py +++ b/lldb/test/lang/cpp/wchar_t/TestCxxWCharT.py @@ -3,6 +3,8 @@ Test that C++ supports wchar_t correctly. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/go/goroutines/TestGoroutines.py b/lldb/test/lang/go/goroutines/TestGoroutines.py index 6c26a3a1075..a5726c40b9d 100644 --- a/lldb/test/lang/go/goroutines/TestGoroutines.py +++ b/lldb/test/lang/go/goroutines/TestGoroutines.py @@ -1,5 +1,7 @@ """Test the Go OS Plugin.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/go/types/TestGoASTContext.py b/lldb/test/lang/go/types/TestGoASTContext.py index 457b6d30639..2f52563e395 100644 --- a/lldb/test/lang/go/types/TestGoASTContext.py +++ b/lldb/test/lang/go/types/TestGoASTContext.py @@ -1,5 +1,7 @@ """Test the go DWARF type parsing.""" +from __future__ import print_function + import lldb_shared import os, time @@ -103,8 +105,8 @@ class TestGoASTContext(TestBase): self.assertEqual(1, v.GetNumChildren()) self.assertEqual('-10', v.GetChildAtIndex(0).value) - # print - # print os.getpid() + # print() + # print(os.getpid()) # time.sleep(60) v = self.var('theStruct') if v.TypeIsPointerType(): diff --git a/lldb/test/lang/mixed/TestMixedLanguages.py b/lldb/test/lang/mixed/TestMixedLanguages.py index 1fbf118838a..e7916863a45 100644 --- a/lldb/test/lang/mixed/TestMixedLanguages.py +++ b/lldb/test/lang/mixed/TestMixedLanguages.py @@ -1,5 +1,7 @@ """Test that lldb works correctly on compile units form different languages.""" +from __future__ import print_function + import lldb_shared import os, time, re diff --git a/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py b/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py index a629dcf38ea..5e9d55af5d5 100644 --- a/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py +++ b/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py @@ -1,5 +1,7 @@ """Test printing ivars and ObjC objects captured in blocks that are made in methods of an ObjC class.""" +from __future__ import print_function + import lldb_shared import os, time @@ -97,5 +99,5 @@ class TestObjCIvarsInBlocks(TestBase): self.assertTrue (expr, "Successfully got a local variable in a block in a class method.") ret_value_signed = expr.GetValueAsSigned (error) - # print 'ret_value_signed = %i' % (ret_value_signed) + # print('ret_value_signed = %i' % (ret_value_signed)) self.assertTrue (ret_value_signed == 5, "The local variable in the block was what we expected.") diff --git a/lldb/test/lang/objc/forward-decl/TestForwardDecl.py b/lldb/test/lang/objc/forward-decl/TestForwardDecl.py index 6c2f109cb8e..49c29951cf1 100644 --- a/lldb/test/lang/objc/forward-decl/TestForwardDecl.py +++ b/lldb/test/lang/objc/forward-decl/TestForwardDecl.py @@ -1,5 +1,7 @@ """Test that a forward-declared class works when its complete definition is in a library""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/foundation/TestConstStrings.py b/lldb/test/lang/objc/foundation/TestConstStrings.py index 772f5d7ce01..11726c90b84 100644 --- a/lldb/test/lang/objc/foundation/TestConstStrings.py +++ b/lldb/test/lang/objc/foundation/TestConstStrings.py @@ -3,6 +3,8 @@ Test that objective-c constant strings are generated correctly by the expression parser. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/foundation/TestFoundationDisassembly.py b/lldb/test/lang/objc/foundation/TestFoundationDisassembly.py index cd03e76ad11..6488b98df14 100644 --- a/lldb/test/lang/objc/foundation/TestFoundationDisassembly.py +++ b/lldb/test/lang/objc/foundation/TestFoundationDisassembly.py @@ -2,6 +2,8 @@ Test the lldb disassemble command on foundation framework. """ +from __future__ import print_function + import lldb_shared import unittest2 @@ -35,7 +37,7 @@ class FoundationDisassembleTestCase(TestBase): foundation_framework = None for module in target.modules: - print module + print(module) if module.file.basename == "Foundation": foundation_framework = module.file.fullpath break @@ -58,8 +60,8 @@ class FoundationDisassembleTestCase(TestBase): match = codeRE.search(line) if match: func = match.group(1) - #print "line:", line - #print "func:", func + #print("line:", line) + #print("func:", func) self.runCmd('disassemble -n "%s"' % func) @@ -71,9 +73,9 @@ class FoundationDisassembleTestCase(TestBase): target = self.dbg.CreateTarget("a.out") self.assertTrue(target, VALID_TARGET) - print target + print(target) for module in target.modules: - print module + print(module) # Stop at +[NSString stringWithFormat:]. symbol_name = "+[NSString stringWithFormat:]" diff --git a/lldb/test/lang/objc/foundation/TestObjCMethods.py b/lldb/test/lang/objc/foundation/TestObjCMethods.py index 1417d017a69..ee5fab5f37c 100644 --- a/lldb/test/lang/objc/foundation/TestObjCMethods.py +++ b/lldb/test/lang/objc/foundation/TestObjCMethods.py @@ -3,6 +3,8 @@ Set breakpoints on objective-c class and instance methods in foundation. Also lookup objective-c data types and evaluate expressions. """ +from __future__ import print_function + import lldb_shared import os, os.path, time @@ -253,8 +255,8 @@ class FoundationTestCase(TestBase): for line in lines: if string.find(line, "$__lldb") != -1: if num_errors == 0: - print "error: found spurious name lookups when evaluating an expression:" + print("error: found spurious name lookups when evaluating an expression:") num_errors += 1 - print line, + print(line, end='') self.assertTrue(num_errors == 0, "Spurious lookups detected") f.close() diff --git a/lldb/test/lang/objc/foundation/TestObjCMethods2.py b/lldb/test/lang/objc/foundation/TestObjCMethods2.py index 9c6ce04d05a..ccc93caa014 100644 --- a/lldb/test/lang/objc/foundation/TestObjCMethods2.py +++ b/lldb/test/lang/objc/foundation/TestObjCMethods2.py @@ -2,6 +2,8 @@ Test more expression command sequences with objective-c. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py b/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py index 6dd9b90e201..f0b1d0d083e 100644 --- a/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py +++ b/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py @@ -2,6 +2,8 @@ Test SBValue.GetObjectDescription() with the value from SBTarget.FindGlobalVariables(). """ +from __future__ import print_function + import lldb_shared import os, time @@ -52,8 +54,8 @@ class ObjectDescriptionAPITestCase(TestBase): for v in value_list1: self.DebugSBValue(v) if self.TraceOn(): - print "val:", v - print "object description:", v.GetObjectDescription() + print("val:", v) + print("object description:", v.GetObjectDescription()) if v.GetName() == 'my_global_str': self.assertTrue(v.GetObjectDescription() == 'This is a global string') @@ -62,7 +64,7 @@ class ObjectDescriptionAPITestCase(TestBase): for v in value_list2: self.DebugSBValue(v) if self.TraceOn(): - print "val:", v - print "object description:", v.GetObjectDescription() + print("val:", v) + print("object description:", v.GetObjectDescription()) if v.GetName() == 'my_global_str': self.assertTrue(v.GetObjectDescription() == 'This is a global string') diff --git a/lldb/test/lang/objc/foundation/TestRuntimeTypes.py b/lldb/test/lang/objc/foundation/TestRuntimeTypes.py index a302fcc16e0..357346b2ae1 100644 --- a/lldb/test/lang/objc/foundation/TestRuntimeTypes.py +++ b/lldb/test/lang/objc/foundation/TestRuntimeTypes.py @@ -2,6 +2,8 @@ Test that Objective-C methods from the runtime work correctly. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/foundation/TestSymbolTable.py b/lldb/test/lang/objc/foundation/TestSymbolTable.py index 3b1d820012d..378147e40e1 100644 --- a/lldb/test/lang/objc/foundation/TestSymbolTable.py +++ b/lldb/test/lang/objc/foundation/TestSymbolTable.py @@ -2,6 +2,8 @@ Test symbol table access for main.m. """ +from __future__ import print_function + import lldb_shared import os, time @@ -53,14 +55,14 @@ class FoundationSymtabTestCase(TestBase): expected_symbols = set(self.symbols_list) for symbol in module: self.assertTrue(symbol, VALID_SYMBOL) - #print "symbol:", symbol + #print("symbol:", symbol) name = symbol.GetName() if name in expected_symbols: - #print "Removing %s from known_symbols %s" % (name, expected_symbols) + #print("Removing %s from known_symbols %s" % (name, expected_symbols)) expected_symbols.remove(name) # At this point, the known_symbols set should have become an empty set. # If not, raise an error. - #print "symbols unaccounted for:", expected_symbols + #print("symbols unaccounted for:", expected_symbols) self.assertTrue(len(expected_symbols) == 0, "All the known symbols are accounted for") diff --git a/lldb/test/lang/objc/hidden-ivars/TestHiddenIvars.py b/lldb/test/lang/objc/hidden-ivars/TestHiddenIvars.py index a36ba61c402..5b06ea208b4 100644 --- a/lldb/test/lang/objc/hidden-ivars/TestHiddenIvars.py +++ b/lldb/test/lang/objc/hidden-ivars/TestHiddenIvars.py @@ -1,5 +1,7 @@ """Test that hidden ivars in a shared library are visible from the main executable.""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py b/lldb/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py index 2ccd8bc1574..a0c208b56de 100644 --- a/lldb/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py +++ b/lldb/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py @@ -2,6 +2,8 @@ Test that dynamically discovered ivars of type IMP do not crash LLDB """ +from __future__ import print_function + import lldb_shared import os, time @@ -11,11 +13,11 @@ from lldbtest import * import commands def execute_command (command): - # print '%% %s' % (command) + # print('%% %s' % (command)) (exit_status, output) = commands.getstatusoutput (command) # if output: - # print output - # print 'status = %u' % (exit_status) + # print(output) + # print('status = %u' % (exit_status)) return exit_status class ObjCiVarIMPTestCase(TestBase): diff --git a/lldb/test/lang/objc/modules-auto-import/TestModulesAutoImport.py b/lldb/test/lang/objc/modules-auto-import/TestModulesAutoImport.py index a836cdaf82c..c00d0d1eaee 100644 --- a/lldb/test/lang/objc/modules-auto-import/TestModulesAutoImport.py +++ b/lldb/test/lang/objc/modules-auto-import/TestModulesAutoImport.py @@ -1,5 +1,7 @@ """Test that importing modules in Objective-C works as expected.""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/objc/modules-incomplete/TestIncompleteModules.py b/lldb/test/lang/objc/modules-incomplete/TestIncompleteModules.py index 0db2a114c6e..12d4e3792af 100644 --- a/lldb/test/lang/objc/modules-incomplete/TestIncompleteModules.py +++ b/lldb/test/lang/objc/modules-incomplete/TestIncompleteModules.py @@ -1,5 +1,7 @@ """Test that DWARF types are trusted over module types""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py b/lldb/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py index b322cf045ab..22d0909a267 100644 --- a/lldb/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py +++ b/lldb/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py @@ -1,5 +1,7 @@ """Test that inline functions from modules are imported correctly""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/objc/modules/TestObjCModules.py b/lldb/test/lang/objc/modules/TestObjCModules.py index aa3351af3f3..f8ed11a539b 100644 --- a/lldb/test/lang/objc/modules/TestObjCModules.py +++ b/lldb/test/lang/objc/modules/TestObjCModules.py @@ -1,5 +1,7 @@ """Test that importing modules in Objective-C works as expected.""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/objc/objc++/TestObjCXX.py b/lldb/test/lang/objc/objc++/TestObjCXX.py index 2c5b32010f8..b553035b3c9 100644 --- a/lldb/test/lang/objc/objc++/TestObjCXX.py +++ b/lldb/test/lang/objc/objc++/TestObjCXX.py @@ -2,6 +2,8 @@ Make sure that ivars of Objective-C++ classes are visible in LLDB. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py b/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py index da4b146e381..d7cdda1500d 100644 --- a/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py +++ b/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py @@ -2,6 +2,8 @@ Use lldb Python API to test base class resolution for ObjC classes """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py b/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py index eeedc9b8117..95a5414460d 100644 --- a/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py +++ b/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py @@ -1,5 +1,7 @@ """Test that the expression parser doesn't get confused by 'id' and 'Class'""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py b/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py index 15820b68739..b3c44435b3d 100644 --- a/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py +++ b/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py @@ -2,6 +2,8 @@ Use lldb Python API to make sure the dynamic checkers are doing their jobs. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py b/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py index 70cb513f9b7..a22a2c012fc 100644 --- a/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py +++ b/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py @@ -1,5 +1,7 @@ """Test calling functions in class methods.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py b/lldb/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py index 9e4a7e2a7df..f6a7b74f116 100644 --- a/lldb/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py +++ b/lldb/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py @@ -2,6 +2,8 @@ Test that we are able to properly report a usable dynamic type """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py b/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py index bd0bbeab4f6..7c2b7dce6ff 100644 --- a/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py +++ b/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py @@ -2,6 +2,8 @@ Use lldb Python API to test dynamic values in ObjC """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py b/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py index 26e09da2ae3..c53d84c82e4 100644 --- a/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py +++ b/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py @@ -1,5 +1,7 @@ """Test printing ObjC objects that use unbacked properties - so that the static ivar offsets are incorrect.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py b/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py index dd4620f4752..de529e8fa86 100644 --- a/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py +++ b/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py @@ -1,5 +1,7 @@ """Test printing ObjC objects that use unbacked properties - so that the static ivar offsets are incorrect.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py b/lldb/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py index 66dc4d5bdb8..afdbc61a474 100644 --- a/lldb/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py +++ b/lldb/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py @@ -1,5 +1,7 @@ """Test that the Objective-C syntax for dictionary/array literals and indexing works""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/lang/objc/objc-optimized/TestObjcOptimized.py b/lldb/test/lang/objc/objc-optimized/TestObjcOptimized.py index a2769e244b5..28712b9634f 100644 --- a/lldb/test/lang/objc/objc-optimized/TestObjcOptimized.py +++ b/lldb/test/lang/objc/objc-optimized/TestObjcOptimized.py @@ -7,6 +7,8 @@ or 'self' variable was not properly read if the compiler optimized it into a register. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-property/TestObjCProperty.py b/lldb/test/lang/objc/objc-property/TestObjCProperty.py index f21ab349862..0806776a690 100644 --- a/lldb/test/lang/objc/objc-property/TestObjCProperty.py +++ b/lldb/test/lang/objc/objc-property/TestObjCProperty.py @@ -2,6 +2,8 @@ Use lldb Python API to verify that expression evaluation for property references uses the correct getters and setters """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py b/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py index a0719871a13..6d230f22f43 100644 --- a/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py +++ b/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py @@ -1,5 +1,7 @@ """Test calling functions in static methods with a stripped binary.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py b/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py index 443c4c5af41..290d29e0df5 100644 --- a/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py +++ b/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py @@ -1,5 +1,7 @@ """Test calling functions in static methods.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py b/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py index 015992ccbf3..2f51a9ade84 100644 --- a/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py +++ b/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py @@ -1,5 +1,7 @@ """Test stepping through ObjC method dispatch in various forms.""" +from __future__ import print_function + import lldb_shared import os, time @@ -85,7 +87,7 @@ class TestObjCStepping(TestBase): className = mySource_isa.GetSummary () if self.TraceOn(): - print mySource_isa + print(mySource_isa) # Lets delete mySource so we can check that after stepping a child variable # with no parent persists and is useful. @@ -127,7 +129,7 @@ class TestObjCStepping(TestBase): newClassName = mySource_isa.GetSummary () if self.TraceOn(): - print mySource_isa + print(mySource_isa) self.assertTrue (newClassName != className, "The isa did indeed change, swizzled!") diff --git a/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py b/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py index be6e87b939e..1b4388febeb 100644 --- a/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py +++ b/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py @@ -1,5 +1,7 @@ """Test passing structs to Objective-C methods.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py b/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py index d6fafd7e348..60455687a48 100644 --- a/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py +++ b/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py @@ -1,5 +1,7 @@ """Test calling functions in class methods.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/objc-super/TestObjCSuper.py b/lldb/test/lang/objc/objc-super/TestObjCSuper.py index 4aba9e9740b..051cb253eb9 100644 --- a/lldb/test/lang/objc/objc-super/TestObjCSuper.py +++ b/lldb/test/lang/objc/objc-super/TestObjCSuper.py @@ -1,5 +1,7 @@ """Test calling methods on super.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/print-obj/TestPrintObj.py b/lldb/test/lang/objc/print-obj/TestPrintObj.py index b1205cfa8b3..440f0c4c94c 100644 --- a/lldb/test/lang/objc/print-obj/TestPrintObj.py +++ b/lldb/test/lang/objc/print-obj/TestPrintObj.py @@ -2,6 +2,8 @@ Test "print object" where another thread blocks the print object from making progress. """ +from __future__ import print_function + import lldb_shared import os, time @@ -65,7 +67,7 @@ class PrintObjTestCase(TestBase): self.assertTrue(other_thread) process.SetSelectedThread(other_thread) if self.TraceOn(): - print "selected thread:" + lldbutil.get_description(other_thread) + print("selected thread:" + lldbutil.get_description(other_thread)) self.runCmd("thread backtrace") # We want to traverse the frame to the one corresponding to blocked.m to @@ -78,7 +80,7 @@ class PrintObjTestCase(TestBase): if name == 'main': other_thread.SetSelectedFrame(i) if self.TraceOn(): - print "selected frame:" + lldbutil.get_description(frame) + print("selected frame:" + lldbutil.get_description(frame)) break self.expect("po lock_me", OBJECT_PRINTED_CORRECTLY, diff --git a/lldb/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py b/lldb/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py index 726ec820bb5..dd8e9677d48 100644 --- a/lldb/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py +++ b/lldb/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py @@ -2,6 +2,8 @@ Test that objective-c method returning BOOL works correctly. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/rdar-10967107/TestRdar10967107.py b/lldb/test/lang/objc/rdar-10967107/TestRdar10967107.py index be9b6cf043a..1b087c6073b 100644 --- a/lldb/test/lang/objc/rdar-10967107/TestRdar10967107.py +++ b/lldb/test/lang/objc/rdar-10967107/TestRdar10967107.py @@ -2,6 +2,8 @@ Test that CoreFoundation classes CFGregorianDate and CFRange are not improperly uniqued """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/rdar-11355592/TestRdar11355592.py b/lldb/test/lang/objc/rdar-11355592/TestRdar11355592.py index 3523695de2c..b36b82fd6d4 100644 --- a/lldb/test/lang/objc/rdar-11355592/TestRdar11355592.py +++ b/lldb/test/lang/objc/rdar-11355592/TestRdar11355592.py @@ -2,6 +2,8 @@ Test that we do not attempt to make a dynamic type for a 'const char*' """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/rdar-12408181/TestRdar12408181.py b/lldb/test/lang/objc/rdar-12408181/TestRdar12408181.py index 54fa80c5596..81ec1a8117f 100644 --- a/lldb/test/lang/objc/rdar-12408181/TestRdar12408181.py +++ b/lldb/test/lang/objc/rdar-12408181/TestRdar12408181.py @@ -2,6 +2,8 @@ Test that we are able to find out how many children NSWindow has """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/lang/objc/real-definition/TestRealDefinition.py b/lldb/test/lang/objc/real-definition/TestRealDefinition.py index 04e49868710..8a87e099c5c 100644 --- a/lldb/test/lang/objc/real-definition/TestRealDefinition.py +++ b/lldb/test/lang/objc/real-definition/TestRealDefinition.py @@ -1,5 +1,7 @@ """Test that types defined in shared libraries work correctly.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/linux/builtin_trap/TestBuiltinTrap.py b/lldb/test/linux/builtin_trap/TestBuiltinTrap.py index 3f7641bf6d2..635aa850dba 100644 --- a/lldb/test/linux/builtin_trap/TestBuiltinTrap.py +++ b/lldb/test/linux/builtin_trap/TestBuiltinTrap.py @@ -3,6 +3,8 @@ Test lldb ability to unwind a stack with a function containing a call to the '__builtin_trap' intrinsic, which GCC (4.6) encodes to an illegal opcode. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py b/lldb/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py index 8bcf39e4696..fdc9b1e9b36 100644 --- a/lldb/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py +++ b/lldb/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py @@ -3,6 +3,8 @@ This tests that we do not lose control of the inferior, while doing an instructi over a thread creation instruction. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/lldbcurses.py b/lldb/test/lldbcurses.py index 90485416882..0f0351c4610 100644 --- a/lldb/test/lldbcurses.py +++ b/lldb/test/lldbcurses.py @@ -115,22 +115,22 @@ class Window(object): child.resize(new_frame.size) if adjust_neighbors: - #print 'orig_frame = %s\r\n' % (str(orig_frame)), + #print('orig_frame = %s\r\n' % (str(orig_frame)), end='') for curr_child in self.children: if curr_child is child: continue curr_child_frame = curr_child.get_frame() if delta_size.w != 0: - #print 'curr_child_frame = %s\r\n' % (str(curr_child_frame)), + #print('curr_child_frame = %s\r\n' % (str(curr_child_frame)), end='') if curr_child_frame.get_min_x() == orig_frame.get_max_x(): curr_child_frame.origin.x += delta_size.w curr_child_frame.size.w -= delta_size.w - #print 'adjusted curr_child_frame = %s\r\n' % (str(curr_child_frame)), + #print('adjusted curr_child_frame = %s\r\n' % (str(curr_child_frame)), end='') curr_child.resize (curr_child_frame.size) curr_child.slide_position (Size(w=delta_size.w, h=0)) elif curr_child_frame.get_max_x() == orig_frame.get_min_x(): curr_child_frame.size.w -= delta_size.w - #print 'adjusted curr_child_frame = %s\r\n' % (str(curr_child_frame)), + #print('adjusted curr_child_frame = %s\r\n' % (str(curr_child_frame)), end='') curr_child.resize (curr_child_frame.size) def add_key_action(self, arg, callback, decription): diff --git a/lldb/test/lldbpexpect.py b/lldb/test/lldbpexpect.py index f25534efaf1..6110b320dd5 100644 --- a/lldb/test/lldbpexpect.py +++ b/lldb/test/lldbpexpect.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py index 29404a805fd..b8e29a7b5f4 100644 --- a/lldb/test/lldbtest.py +++ b/lldb/test/lldbtest.py @@ -1584,7 +1584,7 @@ class Base(unittest2.TestCase): During test execution, there might be cases where we don't want to show the standard output to the user. For example, - self.runCmd(r'''sc print "\n\n\tHello!\n"''') + self.runCmd(r'''sc print("\n\n\tHello!\n")''') tests whether command abbreviation for 'script' works or not. There is no need to show the 'Hello' output to the user as long as the 'script' command diff --git a/lldb/test/lldbutil.py b/lldb/test/lldbutil.py index 8c23637721a..c824990b5e7 100644 --- a/lldb/test/lldbutil.py +++ b/lldb/test/lldbutil.py @@ -796,7 +796,7 @@ def print_registers(frame, string_buffer = False): registerSet = frame.GetRegisters() # Return type of SBValueList. print("Frame registers (size of register set = %d):" % registerSet.GetSize(), file=output) for value in registerSet: - #print >> output, value + #print(value, file=output) print("%s (number of children = %d):" % (value.GetName(), value.GetNumChildren()), file=output) for child in value: print("Name: %s, Value: %s" % (child.GetName(), child.GetValue()), file=output) @@ -824,7 +824,7 @@ def get_GPRs(frame): from lldbutil import get_GPRs regs = get_GPRs(frame) for reg in regs: - print "%s => %s" % (reg.GetName(), reg.GetValue()) + print("%s => %s" % (reg.GetName(), reg.GetValue())) ... """ return get_registers(frame, "general purpose") @@ -837,7 +837,7 @@ def get_FPRs(frame): from lldbutil import get_FPRs regs = get_FPRs(frame) for reg in regs: - print "%s => %s" % (reg.GetName(), reg.GetValue()) + print("%s => %s" % (reg.GetName(), reg.GetValue())) ... """ return get_registers(frame, "floating point") @@ -850,7 +850,7 @@ def get_ESRs(frame): from lldbutil import get_ESRs regs = get_ESRs(frame) for reg in regs: - print "%s => %s" % (reg.GetName(), reg.GetValue()) + print("%s => %s" % (reg.GetName(), reg.GetValue())) ... """ return get_registers(frame, "exception state") diff --git a/lldb/test/logging/TestLogging.py b/lldb/test/logging/TestLogging.py index ae8398f250e..346b660294e 100644 --- a/lldb/test/logging/TestLogging.py +++ b/lldb/test/logging/TestLogging.py @@ -2,6 +2,8 @@ Test lldb logging. This test just makes sure logging doesn't crash, and produces some output. """ +from __future__ import print_function + import lldb_shared import os, time, string diff --git a/lldb/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py b/lldb/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py index 5dae2a06c83..e5d4202008a 100644 --- a/lldb/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py +++ b/lldb/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py @@ -1,5 +1,7 @@ """Test that the 'add-dsym', aka 'target symbols add', succeeds in the middle of debug session.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py b/lldb/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py index 6e739f599b1..bd25db6d64c 100644 --- a/lldb/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py +++ b/lldb/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py @@ -2,6 +2,8 @@ Test that clang produces the __apple accelerator tables, for example, __apple_types, correctly. """ +from __future__ import print_function + import lldb_shared import os, time @@ -35,29 +37,29 @@ class AppleTypesTestCase(TestBase): if not self.TraceOn(): self.HideStdout() - print "Number of modules for the target: %d" % target.GetNumModules() + print("Number of modules for the target: %d" % target.GetNumModules()) for module in target.module_iter(): - print module + print(module) # Get the executable module at index 0. exe_module = target.GetModuleAtIndex(0) dwarf_section = exe_module.FindSection("__DWARF") self.assertTrue(dwarf_section) - print "__DWARF section:", dwarf_section - print "Number of sub-sections: %d" % dwarf_section.GetNumSubSections() + print("__DWARF section:", dwarf_section) + print("Number of sub-sections: %d" % dwarf_section.GetNumSubSections()) INDENT = ' ' * 4 for subsec in dwarf_section: - print INDENT + str(subsec) + print(INDENT + str(subsec)) debug_str_sub_section = dwarf_section.FindSubSection("__debug_str") self.assertTrue(debug_str_sub_section) - print "__debug_str sub-section:", debug_str_sub_section + print("__debug_str sub-section:", debug_str_sub_section) # Find our __apple_types section by name. apple_types_sub_section = dwarf_section.FindSubSection("__apple_types") self.assertTrue(apple_types_sub_section) - print "__apple_types sub-section:", apple_types_sub_section + print("__apple_types sub-section:", apple_types_sub_section) # These other three all important subsections should also be present. self.assertTrue(dwarf_section.FindSubSection("__apple_names") and diff --git a/lldb/test/macosx/indirect_symbol/TestIndirectSymbols.py b/lldb/test/macosx/indirect_symbol/TestIndirectSymbols.py index 7f1fabc1428..3985358f602 100644 --- a/lldb/test/macosx/indirect_symbol/TestIndirectSymbols.py +++ b/lldb/test/macosx/indirect_symbol/TestIndirectSymbols.py @@ -1,5 +1,7 @@ """Test stepping and setting breakpoints in indirect and re-exported symbols.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/macosx/order/TestOrderFile.py b/lldb/test/macosx/order/TestOrderFile.py index b0d9fd93586..fee48e0f082 100644 --- a/lldb/test/macosx/order/TestOrderFile.py +++ b/lldb/test/macosx/order/TestOrderFile.py @@ -2,6 +2,8 @@ Test that debug symbols have the correct order as specified by the order file. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/macosx/queues/TestQueues.py b/lldb/test/macosx/queues/TestQueues.py index 82149e35443..77b1b6b2804 100644 --- a/lldb/test/macosx/queues/TestQueues.py +++ b/lldb/test/macosx/queues/TestQueues.py @@ -1,5 +1,7 @@ """Test queues inspection SB APIs.""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/macosx/safe-to-func-call/TestSafeFuncCalls.py b/lldb/test/macosx/safe-to-func-call/TestSafeFuncCalls.py index 6e777904df3..e0e7b74b304 100644 --- a/lldb/test/macosx/safe-to-func-call/TestSafeFuncCalls.py +++ b/lldb/test/macosx/safe-to-func-call/TestSafeFuncCalls.py @@ -1,5 +1,7 @@ """Test function call thread safety.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/macosx/universal/TestUniversal.py b/lldb/test/macosx/universal/TestUniversal.py index 9628c538587..efe49a13b7d 100644 --- a/lldb/test/macosx/universal/TestUniversal.py +++ b/lldb/test/macosx/universal/TestUniversal.py @@ -1,5 +1,7 @@ """Test aspects of lldb commands on universal binaries.""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/plugins/builder_darwin.py b/lldb/test/plugins/builder_darwin.py index ac5d8aaf699..3e69995c9a2 100644 --- a/lldb/test/plugins/builder_darwin.py +++ b/lldb/test/plugins/builder_darwin.py @@ -1,9 +1,11 @@ + +from __future__ import print_function import os import lldbtest from builder_base import * -#print "Hello, darwin plugin!" +#print("Hello, darwin plugin!") def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): """Build the binaries with dsym debug info.""" diff --git a/lldb/test/python_api/breakpoint/TestBreakpointAPI.py b/lldb/test/python_api/breakpoint/TestBreakpointAPI.py index 9c29e6cd992..245c14267dd 100644 --- a/lldb/test/python_api/breakpoint/TestBreakpointAPI.py +++ b/lldb/test/python_api/breakpoint/TestBreakpointAPI.py @@ -2,6 +2,8 @@ Test SBBreakpoint APIs. """ +from __future__ import print_function + import lldb_shared import os, time @@ -25,7 +27,7 @@ class BreakpointAPITestCase(TestBase): # Now create a breakpoint on main.c by name 'AFunction'. breakpoint = target.BreakpointCreateByName('AFunction', 'a.out') - #print "breakpoint:", breakpoint + #print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) diff --git a/lldb/test/python_api/class_members/TestSBTypeClassMembers.py b/lldb/test/python_api/class_members/TestSBTypeClassMembers.py index 90e79dc1a7a..6ead0af0643 100644 --- a/lldb/test/python_api/class_members/TestSBTypeClassMembers.py +++ b/lldb/test/python_api/class_members/TestSBTypeClassMembers.py @@ -2,6 +2,8 @@ Test SBType APIs to fetch member function types. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py index e7b141ebaf5..fb8961dd2f8 100644 --- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py +++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py @@ -11,6 +11,8 @@ SBCommadnReturnObject, SBStream, and SBSymbolContextList, are all valid objects after default construction. """ +from __future__ import print_function + import lldb_shared import os, time @@ -27,7 +29,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBAddress(self): obj = lldb.SBAddress() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_address @@ -38,7 +40,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBBlock(self): obj = lldb.SBBlock() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_block @@ -49,7 +51,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBBreakpoint(self): obj = lldb.SBBreakpoint() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_breakpoint @@ -60,7 +62,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBBreakpointLocation(self): obj = lldb.SBBreakpointLocation() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_breakpointlocation @@ -71,7 +73,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBBroadcaster(self): obj = lldb.SBBroadcaster() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_broadcaster @@ -83,7 +85,7 @@ class APIDefaultConstructorTestCase(TestBase): """SBCommandReturnObject object is valid after default construction.""" obj = lldb.SBCommandReturnObject() if self.TraceOn(): - print obj + print(obj) self.assertTrue(obj) @python_api_test @@ -91,7 +93,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBCommunication(self): obj = lldb.SBCommunication() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_communication @@ -102,7 +104,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBCompileUnit(self): obj = lldb.SBCompileUnit() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_compileunit @@ -113,7 +115,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBDebugger(self): obj = lldb.SBDebugger() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_debugger @@ -125,7 +127,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBError(self): obj = lldb.SBError() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_error @@ -138,7 +140,7 @@ class APIDefaultConstructorTestCase(TestBase): # This is just to test that typemap, as defined in lldb.swig, works. obj2 = lldb.SBEvent(0, "abc") if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_event @@ -150,7 +152,7 @@ class APIDefaultConstructorTestCase(TestBase): # This is just to test that FileSpec(None) does not crash. obj2 = lldb.SBFileSpec(None, True) if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_filespec @@ -161,7 +163,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBFrame(self): obj = lldb.SBFrame() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_frame @@ -172,7 +174,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBFunction(self): obj = lldb.SBFunction() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_function @@ -183,7 +185,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBInstruction(self): obj = lldb.SBInstruction() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_instruction @@ -194,7 +196,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBInstructionList(self): obj = lldb.SBInstructionList() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_instructionlist @@ -205,7 +207,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBLineEntry(self): obj = lldb.SBLineEntry() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_lineentry @@ -216,7 +218,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBListener(self): obj = lldb.SBListener() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_listener @@ -227,7 +229,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBModule(self): obj = lldb.SBModule() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_module @@ -238,7 +240,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBProcess(self): obj = lldb.SBProcess() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_process @@ -249,7 +251,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBSection(self): obj = lldb.SBSection() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_section @@ -261,7 +263,7 @@ class APIDefaultConstructorTestCase(TestBase): """SBStream object is valid after default construction.""" obj = lldb.SBStream() if self.TraceOn(): - print obj + print(obj) self.assertTrue(obj) @python_api_test @@ -269,7 +271,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBStringList(self): obj = lldb.SBStringList() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_stringlist @@ -280,7 +282,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBSymbol(self): obj = lldb.SBSymbol() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_symbol @@ -291,7 +293,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBSymbolContext(self): obj = lldb.SBSymbolContext() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_symbolcontext @@ -303,7 +305,7 @@ class APIDefaultConstructorTestCase(TestBase): """SBSymbolContextList object is valid after default construction.""" obj = lldb.SBSymbolContextList() if self.TraceOn(): - print obj + print(obj) self.assertTrue(obj) @python_api_test @@ -311,7 +313,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBTarget(self): obj = lldb.SBTarget() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_target @@ -322,7 +324,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBThread(self): obj = lldb.SBThread() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_thread @@ -334,7 +336,7 @@ class APIDefaultConstructorTestCase(TestBase): try: obj = lldb.SBType() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # If we reach here, the test fails. self.fail("lldb.SBType() should fail, not succeed!") @@ -353,7 +355,7 @@ class APIDefaultConstructorTestCase(TestBase): """SBTypeList object is valid after default construction.""" obj = lldb.SBTypeList() if self.TraceOn(): - print obj + print(obj) self.assertTrue(obj) @python_api_test @@ -361,7 +363,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBValue(self): obj = lldb.SBValue() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_value @@ -372,7 +374,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBValueList(self): obj = lldb.SBValueList() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_valuelist @@ -383,7 +385,7 @@ class APIDefaultConstructorTestCase(TestBase): def test_SBWatchpoint(self): obj = lldb.SBWatchpoint() if self.TraceOn(): - print obj + print(obj) self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_watchpoint diff --git a/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py b/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py index e16c6f09437..a6a165777ec 100644 --- a/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py +++ b/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py @@ -2,6 +2,8 @@ Use lldb Python API to disassemble raw machine code bytes """ +from __future__ import print_function + import lldb_shared import os, time @@ -28,9 +30,9 @@ class DisassembleRawDataTestCase(TestBase): inst = insts.GetInstructionAtIndex(0) if self.TraceOn(): - print - print "Raw bytes: ", [hex(x) for x in raw_bytes] - print "Disassembled%s" % str(inst) + print() + print("Raw bytes: ", [hex(x) for x in raw_bytes]) + print("Disassembled%s" % str(inst)) self.assertTrue (inst.GetMnemonic(target) == "movq") self.assertTrue (inst.GetOperands(target) == '%' + "rsp, " + '%' + "rbp") diff --git a/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py b/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py index d25dabc6e63..6e326b897b9 100644 --- a/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py +++ b/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py @@ -2,6 +2,8 @@ Use lldb Python API to disassemble raw machine code bytes """ +from __future__ import print_function + import lldb_shared import os, time @@ -31,9 +33,9 @@ class Disassemble_VST1_64(TestBase): insts = target.GetInstructions(lldb.SBAddress(), raw_bytes) if self.TraceOn(): - print + print() for i in insts: - print "Disassembled%s" % str(i) + print("Disassembled%s" % str(i)) # Remove the following return statement when the radar is fixed. return @@ -48,8 +50,8 @@ class Disassemble_VST1_64(TestBase): inst = insts.GetInstructionAtIndex(0) if self.TraceOn(): - print - print "Raw bytes: ", [hex(x) for x in raw_bytes] - print "Disassembled%s" % str(inst) + print() + print("Raw bytes: ", [hex(x) for x in raw_bytes]) + print("Disassembled%s" % str(inst)) self.assertTrue (inst.GetMnemonic(target) == "vst1.64") diff --git a/lldb/test/python_api/event/TestEvents.py b/lldb/test/python_api/event/TestEvents.py index f2d52570d25..6fcb67f5869 100644 --- a/lldb/test/python_api/event/TestEvents.py +++ b/lldb/test/python_api/event/TestEvents.py @@ -2,6 +2,8 @@ Test lldb Python event APIs. """ +from __future__ import print_function + import lldb_shared import os, time @@ -69,17 +71,17 @@ class EventAPITestCase(TestBase): # After that, the thread exits. while not count > 3: if traceOn: - print "Try wait for event..." + print("Try wait for event...") if listener.WaitForEvent(5, event): if traceOn: desc = lldbutil.get_description(event) - print "Event description:", desc - print "Event data flavor:", event.GetDataFlavor() - print "Process state:", lldbutil.state_type_to_str(process.GetState()) - print + print("Event description:", desc) + print("Event data flavor:", event.GetDataFlavor()) + print("Process state:", lldbutil.state_type_to_str(process.GetState())) + print() else: if traceOn: - print "timeout occurred waiting for event..." + print("timeout occurred waiting for event...") count = count + 1 return @@ -112,7 +114,7 @@ class EventAPITestCase(TestBase): # Now create a breakpoint on main.c by name 'c'. breakpoint = target.BreakpointCreateByName('c', 'a.out') - #print "breakpoint:", breakpoint + #print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) @@ -146,12 +148,12 @@ class EventAPITestCase(TestBase): # Let's only try at most 3 times to retrieve any kind of event. while not count > 3: if listener.WaitForEvent(5, event): - #print "Got a valid event:", event - #print "Event data flavor:", event.GetDataFlavor() - #print "Event type:", lldbutil.state_type_to_str(event.GetType()) + #print("Got a valid event:", event) + #print("Event data flavor:", event.GetDataFlavor()) + #print("Event type:", lldbutil.state_type_to_str(event.GetType())) return count = count + 1 - print "Timeout: listener.WaitForEvent" + print("Timeout: listener.WaitForEvent") return @@ -186,7 +188,7 @@ class EventAPITestCase(TestBase): # Now create a breakpoint on main.c by name 'c'. breakpoint = target.BreakpointCreateByName('c', 'a.out') - #print "breakpoint:", breakpoint + #print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) @@ -225,7 +227,7 @@ class EventAPITestCase(TestBase): import threading class MyListeningThread(threading.Thread): def run(self): - #print "Running MyListeningThread:", self + #print("Running MyListeningThread:", self) # Regular expression pattern for the event description. pattern = re.compile("data = {.*, state = (.*)}$") @@ -235,7 +237,7 @@ class EventAPITestCase(TestBase): while True: if listener.WaitForEvent(5, event): desc = lldbutil.get_description(event) - #print "Event description:", desc + #print("Event description:", desc) match = pattern.search(desc) if not match: break; @@ -256,7 +258,7 @@ class EventAPITestCase(TestBase): break else: break - print "Timeout: listener.WaitForEvent" + print("Timeout: listener.WaitForEvent") count = count + 1 if count > 6: break diff --git a/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py b/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py index c5bdcb89fec..6a3be36a592 100644 --- a/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py +++ b/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py @@ -1,5 +1,7 @@ """Test that SBFrame::FindValue finds things but does not duplicate the entire variables list""" +from __future__ import print_function + import lldb_shared import os, sys, time diff --git a/lldb/test/python_api/formatters/TestFormattersSBAPI.py b/lldb/test/python_api/formatters/TestFormattersSBAPI.py index b6d693ff1fd..7f3075f09c5 100644 --- a/lldb/test/python_api/formatters/TestFormattersSBAPI.py +++ b/lldb/test/python_api/formatters/TestFormattersSBAPI.py @@ -1,5 +1,7 @@ """Test Python APIs for working with formatters""" +from __future__ import print_function + import lldb_shared import os, sys, time @@ -324,19 +326,19 @@ class SBFormattersAPITestCase(TestBase): frame = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() int_vector = frame.FindVariable("int_vector") if self.TraceOn(): - print int_vector + print(int_vector) self.assertTrue(int_vector.GetNumChildren() == 0, 'synthetic vector is empty') self.runCmd('settings set target.enable-synthetic-value false') frame = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() int_vector = frame.FindVariable("int_vector") if self.TraceOn(): - print int_vector + print(int_vector) self.assertFalse(int_vector.GetNumChildren() == 0, '"physical" vector is not empty') self.runCmd('settings set target.enable-synthetic-value true') frame = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() int_vector = frame.FindVariable("int_vector") if self.TraceOn(): - print int_vector + print(int_vector) self.assertTrue(int_vector.GetNumChildren() == 0, 'synthetic vector is still empty') diff --git a/lldb/test/python_api/frame/TestFrames.py b/lldb/test/python_api/frame/TestFrames.py index b13edd09396..d8cccc6fea0 100644 --- a/lldb/test/python_api/frame/TestFrames.py +++ b/lldb/test/python_api/frame/TestFrames.py @@ -3,6 +3,8 @@ Use lldb Python SBFrame API to get the argument values of the call stacks. And other SBFrame API tests. """ +from __future__ import print_function + import lldb_shared import os, time @@ -27,7 +29,7 @@ class FrameAPITestCase(TestBase): # Now create a breakpoint on main.c by name 'c'. breakpoint = target.BreakpointCreateByName('c', 'a.out') - #print "breakpoint:", breakpoint + #print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) @@ -52,7 +54,7 @@ class FrameAPITestCase(TestBase): for i in range(numFrames): frame = thread.GetFrameAtIndex(i) if self.TraceOn(): - print "frame:", frame + print("frame:", frame) name = frame.GetFunction().GetName() if name == 'a': @@ -70,7 +72,7 @@ class FrameAPITestCase(TestBase): argList.append("(%s)%s=%s" % (val.GetTypeName(), val.GetName(), val.GetValue())) - print >> session, "%s(%s)" % (name, ", ".join(argList)) + print("%s(%s)" % (name, ", ".join(argList)), file=session) # Also check the generic pc & stack pointer. We can't test their absolute values, # but they should be valid. Uses get_GPRs() from the lldbutil module. @@ -84,7 +86,7 @@ class FrameAPITestCase(TestBase): self.assertTrue (sp_value, "We should have a valid Stack Pointer.") self.assertTrue (int(sp_value.GetValue(), 0) == frame.GetSP(), "SP gotten as a value should equal frame's GetSP") - print >> session, "---" + print("---", file=session) process.Continue() # At this point, the inferior process should have exited. @@ -97,8 +99,8 @@ class FrameAPITestCase(TestBase): # o a((int)val=1, (char)ch='A') # o a((int)val=3, (char)ch='A') if self.TraceOn(): - print "Full stack traces when stopped on the breakpoint 'c':" - print session.getvalue() + print("Full stack traces when stopped on the breakpoint 'c':") + print(session.getvalue()) self.expect(session.getvalue(), "Argugment values displayed correctly", exe=False, substrs = ["a((int)val=1, (char)ch='A')", @@ -116,7 +118,7 @@ class FrameAPITestCase(TestBase): # Now create a breakpoint on main.c by name 'c'. breakpoint = target.BreakpointCreateByName('c', 'a.out') - #print "breakpoint:", breakpoint + #print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) @@ -131,15 +133,15 @@ class FrameAPITestCase(TestBase): thread = process.GetThreadAtIndex(0) frame = thread.GetFrameAtIndex(0) if self.TraceOn(): - print "frame:", frame + print("frame:", frame) # Boundary condition testings. val1 = frame.FindVariable(None, True) val2 = frame.FindVariable(None, False) val3 = frame.FindValue(None, lldb.eValueTypeVariableGlobal) if self.TraceOn(): - print "val1:", val1 - print "val2:", val2 + print("val1:", val1) + print("val2:", val2) frame.EvaluateExpression(None) @@ -155,7 +157,7 @@ class FrameAPITestCase(TestBase): # Now create a breakpoint on main.c by name 'c'. breakpoint = target.BreakpointCreateByName('c', 'a.out') - #print "breakpoint:", breakpoint + #print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) @@ -172,7 +174,7 @@ class FrameAPITestCase(TestBase): frameEntered = thread.GetFrameAtIndex(0) if self.TraceOn(): - print frameEntered + print(frameEntered) lldbutil.print_stacktrace(thread) self.assertTrue(frameEntered) @@ -182,7 +184,7 @@ class FrameAPITestCase(TestBase): self.assertTrue(thread) frameNow = thread.GetFrameAtIndex(0) if self.TraceOn(): - print frameNow + print(frameNow) lldbutil.print_stacktrace(thread) self.assertTrue(frameNow) @@ -193,7 +195,7 @@ class FrameAPITestCase(TestBase): thread.StepOutOfFrame(frameNow) frameOutOfC = thread.GetFrameAtIndex(0) if self.TraceOn(): - print frameOutOfC + print(frameOutOfC) lldbutil.print_stacktrace(thread) self.assertTrue(frameOutOfC) diff --git a/lldb/test/python_api/frame/inlines/TestInlinedFrame.py b/lldb/test/python_api/frame/inlines/TestInlinedFrame.py index e5e53918190..1fc86064fb7 100644 --- a/lldb/test/python_api/frame/inlines/TestInlinedFrame.py +++ b/lldb/test/python_api/frame/inlines/TestInlinedFrame.py @@ -2,6 +2,8 @@ Testlldb Python SBFrame APIs IsInlined() and GetFunctionName(). """ +from __future__ import print_function + import lldb_shared import os, time @@ -33,7 +35,7 @@ class InlinedFrameAPITestCase(TestBase): # Now create a breakpoint on main.c by the name of 'inner_inline'. breakpoint = target.BreakpointCreateByName('inner_inline', 'a.out') - #print "breakpoint:", breakpoint + #print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() > 1, VALID_BREAKPOINT) @@ -48,8 +50,8 @@ class InlinedFrameAPITestCase(TestBase): import lldbutil stack_traces1 = lldbutil.print_stacktraces(process, string_buffer=True) if self.TraceOn(): - print "Full stack traces when first stopped on the breakpoint 'inner_inline':" - print stack_traces1 + print("Full stack traces when first stopped on the breakpoint 'inner_inline':") + print(stack_traces1) # The first breakpoint should correspond to an inlined call frame. # If it's an inlined call frame, expect to find, in the stack trace, @@ -70,7 +72,7 @@ class InlinedFrameAPITestCase(TestBase): PROCESS_STOPPED) stack_traces2 = lldbutil.print_stacktraces(process, string_buffer=True) if self.TraceOn(): - print "Full stack traces when stopped on the breakpoint 'inner_inline' for the second time:" - print stack_traces2 + print("Full stack traces when stopped on the breakpoint 'inner_inline' for the second time:") + print(stack_traces2) self.expect(stack_traces2, "Second stop at %s:%d" % (self.source, self.second_stop), exe=False, substrs = ['%s:%d' % (self.source, self.second_stop)]) diff --git a/lldb/test/python_api/function_symbol/TestDisasmAPI.py b/lldb/test/python_api/function_symbol/TestDisasmAPI.py index 4018b52ea73..7f0dce11fdb 100644 --- a/lldb/test/python_api/function_symbol/TestDisasmAPI.py +++ b/lldb/test/python_api/function_symbol/TestDisasmAPI.py @@ -2,6 +2,8 @@ Test retrieval of SBAddress from function/symbol, disassembly, and SBAddress APIs. """ +from __future__ import print_function + import lldb_shared import os, time @@ -33,8 +35,8 @@ class DisasmAPITestCase(TestBase): # Now create the two breakpoints inside function 'a'. breakpoint1 = target.BreakpointCreateByLocation('main.c', self.line1) breakpoint2 = target.BreakpointCreateByLocation('main.c', self.line2) - #print "breakpoint1:", breakpoint1 - #print "breakpoint2:", breakpoint2 + #print("breakpoint1:", breakpoint1) + #print("breakpoint2:", breakpoint2) self.assertTrue(breakpoint1 and breakpoint1.GetNumLocations() == 1, VALID_BREAKPOINT) @@ -55,14 +57,14 @@ class DisasmAPITestCase(TestBase): self.assertTrue(lineEntry.GetLine() == self.line1) address1 = lineEntry.GetStartAddress() - #print "address1:", address1 + #print("address1:", address1) # Now call SBTarget.ResolveSymbolContextForAddress() with address1. context1 = target.ResolveSymbolContextForAddress(address1, lldb.eSymbolContextEverything) self.assertTrue(context1) if self.TraceOn(): - print "context1:", context1 + print("context1:", context1) # Continue the inferior, the breakpoint 2 should be hit. process.Continue() @@ -80,24 +82,24 @@ class DisasmAPITestCase(TestBase): disasm_output = lldbutil.disassemble(target, symbol) if self.TraceOn(): - print "symbol:", symbol - print "disassembly=>\n", disasm_output + print("symbol:", symbol) + print("disassembly=>\n", disasm_output) disasm_output = lldbutil.disassemble(target, function) if self.TraceOn(): - print "function:", function - print "disassembly=>\n", disasm_output + print("function:", function) + print("disassembly=>\n", disasm_output) sa1 = symbol.GetStartAddress() - #print "sa1:", sa1 - #print "sa1.GetFileAddress():", hex(sa1.GetFileAddress()) + #print("sa1:", sa1) + #print("sa1.GetFileAddress():", hex(sa1.GetFileAddress())) #ea1 = symbol.GetEndAddress() - #print "ea1:", ea1 + #print("ea1:", ea1) sa2 = function.GetStartAddress() - #print "sa2:", sa2 - #print "sa2.GetFileAddress():", hex(sa2.GetFileAddress()) + #print("sa2:", sa2) + #print("sa2.GetFileAddress():", hex(sa2.GetFileAddress())) #ea2 = function.GetEndAddress() - #print "ea2:", ea2 + #print("ea2:", ea2) self.assertTrue(sa1 and sa2 and sa1 == sa2, "The two starting addresses should be the same") diff --git a/lldb/test/python_api/function_symbol/TestSymbolAPI.py b/lldb/test/python_api/function_symbol/TestSymbolAPI.py index 1d7a428ddf4..bb0a78a59f4 100644 --- a/lldb/test/python_api/function_symbol/TestSymbolAPI.py +++ b/lldb/test/python_api/function_symbol/TestSymbolAPI.py @@ -2,6 +2,8 @@ Test newly added SBSymbol and SBAddress APIs. """ +from __future__ import print_function + import lldb_shared import os, time @@ -34,8 +36,8 @@ class SymbolAPITestCase(TestBase): # Now create the two breakpoints inside function 'a'. breakpoint1 = target.BreakpointCreateByLocation('main.c', self.line1) breakpoint2 = target.BreakpointCreateByLocation('main.c', self.line2) - #print "breakpoint1:", breakpoint1 - #print "breakpoint2:", breakpoint2 + #print("breakpoint1:", breakpoint1) + #print("breakpoint2:", breakpoint2) self.assertTrue(breakpoint1 and breakpoint1.GetNumLocations() == 1, VALID_BREAKPOINT) @@ -74,5 +76,5 @@ class SymbolAPITestCase(TestBase): # Now verify that both addresses point to the same module. if self.TraceOn(): - print "UUID:", addr_line1.GetModule().GetUUIDString() + print("UUID:", addr_line1.GetModule().GetUUIDString()) self.assertTrue(addr_line1.GetModule().GetUUIDString() == addr_line2.GetModule().GetUUIDString()) diff --git a/lldb/test/python_api/hello_world/TestHelloWorld.py b/lldb/test/python_api/hello_world/TestHelloWorld.py index 1800dd0fb69..5e8343e2407 100644 --- a/lldb/test/python_api/hello_world/TestHelloWorld.py +++ b/lldb/test/python_api/hello_world/TestHelloWorld.py @@ -1,5 +1,7 @@ """Test Python APIs for target (launch and attach), breakpoint, and process.""" +from __future__ import print_function + import lldb_shared import os, sys, time diff --git a/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py b/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py index 1f5171d1018..74baf11029d 100644 --- a/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py +++ b/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py @@ -1,5 +1,7 @@ """Test the SBCommandInterpreter APIs.""" +from __future__ import print_function + import lldb_shared import os @@ -56,7 +58,7 @@ class CommandInterpreterAPICase(TestBase): res.AppendMessage("Just appended a message.") res.AppendMessage(None) if self.TraceOn(): - print res + print(res) process = ci.GetProcess() self.assertTrue(process) diff --git a/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py b/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py index 28121365b75..90ceed2a29e 100644 --- a/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py +++ b/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py @@ -2,6 +2,8 @@ Test utility functions for the frame object. """ +from __future__ import print_function + import lldb_shared import os @@ -53,5 +55,5 @@ class FrameUtilsTestCase(TestBase): self.assertTrue(frame0_args and parent_args and "(int)val=1" in frame0_args) if self.TraceOn(): lldbutil.print_stacktrace(thread) - print "Current frame: %s" % frame0_args - print "Parent frame: %s" % parent_args + print("Current frame: %s" % frame0_args) + print("Parent frame: %s" % parent_args) diff --git a/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py b/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py index c8ee37c1661..c8ab81317f4 100644 --- a/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py +++ b/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py @@ -2,6 +2,8 @@ Test the iteration protocol for some lldb container objects. """ +from __future__ import print_function + import lldb_shared import os, time @@ -49,8 +51,8 @@ class LLDBIteratorTestCase(TestBase): self.assertTrue(len(yours) == len(mine)) for i in range(len(yours)): if self.TraceOn(): - print "yours[%d]='%s'" % (i, get_description(yours[i])) - print "mine[%d]='%s'" % (i, get_description(mine[i])) + print("yours[%d]='%s'" % (i, get_description(yours[i]))) + print("mine[%d]='%s'" % (i, get_description(mine[i]))) self.assertTrue(yours[i] == mine[i], "UUID+FileSpec of yours[{0}] and mine[{0}] matches".format(i)) @@ -81,8 +83,8 @@ class LLDBIteratorTestCase(TestBase): self.assertTrue(len(yours) == len(mine)) for i in range(len(yours)): if self.TraceOn(): - print "yours[%d]='%s'" % (i, get_description(yours[i])) - print "mine[%d]='%s'" % (i, get_description(mine[i])) + print("yours[%d]='%s'" % (i, get_description(yours[i]))) + print("mine[%d]='%s'" % (i, get_description(mine[i]))) self.assertTrue(yours[i] == mine[i], "ID of yours[{0}] and mine[{0}] matches".format(i)) @@ -115,6 +117,6 @@ class LLDBIteratorTestCase(TestBase): for frame in thread: self.assertTrue(frame.GetThread().GetThreadID() == ID) if self.TraceOn(): - print frame + print(frame) self.assertTrue(stopped_due_to_breakpoint) diff --git a/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py b/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py index 0a49bc2fe4a..43b5d9d1074 100644 --- a/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py +++ b/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py @@ -2,6 +2,8 @@ Test the iteration protocol for frame registers. """ +from __future__ import print_function + import lldb_shared import os, time @@ -44,35 +46,35 @@ class RegistersIteratorTestCase(TestBase): for frame in thread: # Dump the registers of this frame using lldbutil.get_GPRs() and friends. if self.TraceOn(): - print frame + print(frame) REGs = lldbutil.get_GPRs(frame) num = len(REGs) if self.TraceOn(): - print "\nNumber of general purpose registers: %d" % num + print("\nNumber of general purpose registers: %d" % num) for reg in REGs: self.assertTrue(reg) if self.TraceOn(): - print "%s => %s" % (reg.GetName(), reg.GetValue()) + print("%s => %s" % (reg.GetName(), reg.GetValue())) REGs = lldbutil.get_FPRs(frame) num = len(REGs) if self.TraceOn(): - print "\nNumber of floating point registers: %d" % num + print("\nNumber of floating point registers: %d" % num) for reg in REGs: self.assertTrue(reg) if self.TraceOn(): - print "%s => %s" % (reg.GetName(), reg.GetValue()) + print("%s => %s" % (reg.GetName(), reg.GetValue())) REGs = lldbutil.get_ESRs(frame) if self.platformIsDarwin(): num = len(REGs) if self.TraceOn(): - print "\nNumber of exception state registers: %d" % num + print("\nNumber of exception state registers: %d" % num) for reg in REGs: self.assertTrue(reg) if self.TraceOn(): - print "%s => %s" % (reg.GetName(), reg.GetValue()) + print("%s => %s" % (reg.GetName(), reg.GetValue())) else: self.assertIsNone(REGs) diff --git a/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py b/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py index 7319ce39b48..859cbdc452c 100644 --- a/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py +++ b/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py @@ -2,6 +2,8 @@ Test SBprocess and SBThread APIs with printing of the stack traces using lldbutil. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/python_api/module_section/TestModuleAndSection.py b/lldb/test/python_api/module_section/TestModuleAndSection.py index d1a69f934d6..c89ff221d62 100644 --- a/lldb/test/python_api/module_section/TestModuleAndSection.py +++ b/lldb/test/python_api/module_section/TestModuleAndSection.py @@ -2,6 +2,8 @@ Test some SBModule and SBSection APIs. """ +from __future__ import print_function + import lldb_shared import os, time @@ -28,31 +30,31 @@ class ModuleAndSectionAPIsTestCase(TestBase): if not self.TraceOn(): self.HideStdout() - print "Number of modules for the target: %d" % target.GetNumModules() + print("Number of modules for the target: %d" % target.GetNumModules()) for module in target.module_iter(): - print module + print(module) # Get the executable module at index 0. exe_module = target.GetModuleAtIndex(0) - print "Exe module: %s" % str(exe_module) - print "Number of sections: %d" % exe_module.GetNumSections() + print("Exe module: %s" % str(exe_module)) + print("Number of sections: %d" % exe_module.GetNumSections()) INDENT = ' ' * 4 INDENT2 = INDENT * 2 for sec in exe_module.section_iter(): - print sec - print INDENT + "Number of subsections: %d" % sec.GetNumSubSections() + print(sec) + print(INDENT + "Number of subsections: %d" % sec.GetNumSubSections()) if sec.GetNumSubSections() == 0: for sym in exe_module.symbol_in_section_iter(sec): - print INDENT + str(sym) - print INDENT + "symbol type: %s" % symbol_type_to_str(sym.GetType()) + print(INDENT + str(sym)) + print(INDENT + "symbol type: %s" % symbol_type_to_str(sym.GetType())) else: for subsec in sec: - print INDENT + str(subsec) + print(INDENT + str(subsec)) # Now print the symbols belonging to the subsection.... for sym in exe_module.symbol_in_section_iter(subsec): - print INDENT2 + str(sym) - print INDENT2 + "symbol type: %s" % symbol_type_to_str(sym.GetType()) + print(INDENT2 + str(sym)) + print(INDENT2 + "symbol type: %s" % symbol_type_to_str(sym.GetType())) @python_api_test def test_module_and_section_boundary_condition(self): @@ -68,15 +70,15 @@ class ModuleAndSectionAPIsTestCase(TestBase): if not self.TraceOn(): self.HideStdout() - print "Number of modules for the target: %d" % target.GetNumModules() + print("Number of modules for the target: %d" % target.GetNumModules()) for module in target.module_iter(): - print module + print(module) # Get the executable module at index 0. exe_module = target.GetModuleAtIndex(0) - print "Exe module: %s" % str(exe_module) - print "Number of sections: %d" % exe_module.GetNumSections() + print("Exe module: %s" % str(exe_module)) + print("Number of sections: %d" % exe_module.GetNumSections()) # Boundary condition testings. Should not crash lldb! exe_module.FindFirstType(None) @@ -88,7 +90,7 @@ class ModuleAndSectionAPIsTestCase(TestBase): # Get the section at index 1. if exe_module.GetNumSections() > 1: sec1 = exe_module.GetSectionAtIndex(1) - print sec1 + print(sec1) else: sec1 = None @@ -109,16 +111,17 @@ class ModuleAndSectionAPIsTestCase(TestBase): if not self.TraceOn(): self.HideStdout() - print "Number of modules for the target: %d" % target.GetNumModules() + print("Number of modules for the target: %d" % target.GetNumModules()) for module in target.module_iter(): - print module + print(module) # Get the executable module at index 0. exe_module = target.GetModuleAtIndex(0) - print "Exe module: %s" % str(exe_module) - print "Number of compile units: %d" % exe_module.GetNumCompileUnits() + print("Exe module: %s" % str(exe_module)) + print("Number of compile units: %d" % exe_module.GetNumCompileUnits()) INDENT = ' ' * 4 INDENT2 = INDENT * 2 for cu in exe_module.compile_unit_iter(): - print cu + print(cu) + diff --git a/lldb/test/python_api/objc_type/TestObjCType.py b/lldb/test/python_api/objc_type/TestObjCType.py index ed34d43a295..d8564632c46 100644 --- a/lldb/test/python_api/objc_type/TestObjCType.py +++ b/lldb/test/python_api/objc_type/TestObjCType.py @@ -2,6 +2,8 @@ Test SBType for ObjC classes. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/python_api/process/TestProcessAPI.py b/lldb/test/python_api/process/TestProcessAPI.py index 15a70d12a08..e75b78c62f3 100644 --- a/lldb/test/python_api/process/TestProcessAPI.py +++ b/lldb/test/python_api/process/TestProcessAPI.py @@ -2,6 +2,8 @@ Test SBProcess APIs, including ReadMemory(), WriteMemory(), and others. """ +from __future__ import print_function + import lldb_shared import os, time @@ -50,7 +52,7 @@ class ProcessAPITestCase(TestBase): if not error.Success(): self.fail("SBProcess.ReadMemory() failed") if self.TraceOn(): - print "memory content:", content + print("memory content:", content) self.expect(content, "Result from SBProcess.ReadMemory() matches our expected output: 'x'", exe=False, @@ -63,7 +65,7 @@ class ProcessAPITestCase(TestBase): if not error.Success(): self.fail("SBProcess.ReadCStringFromMemory() failed") if self.TraceOn(): - print "cstring read is:", cstring + print("cstring read is:", cstring) self.expect(cstring, "Result from SBProcess.ReadCStringFromMemory() matches our expected output", exe=False, @@ -80,7 +82,7 @@ class ProcessAPITestCase(TestBase): if not error.Success(): self.fail("SBProcess.ReadCStringFromMemory() failed") if self.TraceOn(): - print "cstring read is:", cstring + print("cstring read is:", cstring) self.expect(cstring, "Result from SBProcess.ReadCStringFromMemory() matches our expected output", exe=False, @@ -97,7 +99,7 @@ class ProcessAPITestCase(TestBase): if not error.Success(): self.fail("SBProcess.ReadCStringFromMemory() failed") if self.TraceOn(): - print "uint32 read is:", my_uint32 + print("uint32 read is:", my_uint32) if my_uint32 != 12345: self.fail("Result from SBProcess.ReadUnsignedFromMemory() does not match our expected output") @@ -148,7 +150,7 @@ class ProcessAPITestCase(TestBase): if not error.Success(): self.fail("SBProcess.ReadMemory() failed") if self.TraceOn(): - print "memory content:", content + print("memory content:", content) self.expect(content, "Result from SBProcess.ReadMemory() matches our expected output: 'a'", exe=False, @@ -242,7 +244,7 @@ class ProcessAPITestCase(TestBase): # Dump the memory content.... if self.TraceOn(): for i in new_bytes: - print "byte:", i + print("byte:", i) @python_api_test def test_remote_launch(self): @@ -257,7 +259,7 @@ class ProcessAPITestCase(TestBase): process = target.LaunchSimple (None, None, self.get_process_working_directory()) if self.TraceOn(): - print "process state:", state_type_to_str(process.GetState()) + print("process state:", state_type_to_str(process.GetState())) self.assertTrue(process.GetState() != lldb.eStateConnected) error = lldb.SBError() @@ -283,4 +285,5 @@ class ProcessAPITestCase(TestBase): error = lldb.SBError(); num = process.GetNumSupportedHardwareWatchpoints(error) if self.TraceOn() and error.Success(): - print "Number of supported hardware watchpoints: %d" % num + print("Number of supported hardware watchpoints: %d" % num) + diff --git a/lldb/test/python_api/process/io/TestProcessIO.py b/lldb/test/python_api/process/io/TestProcessIO.py index 1fce478b4f2..162003f6bcf 100644 --- a/lldb/test/python_api/process/io/TestProcessIO.py +++ b/lldb/test/python_api/process/io/TestProcessIO.py @@ -1,5 +1,7 @@ """Test Python APIs for process IO.""" +from __future__ import print_function + import lldb_shared import os, sys, time @@ -164,7 +166,7 @@ class ProcessIOTestCase(TestBase): self.assertTrue(self.process, PROCESS_IS_VALID) if self.TraceOn(): - print "process launched." + print("process launched.") # Frame #0 should be at our breakpoint. threads = lldbutil.get_threads_stopped_at_breakpoint (self.process, self.breakpoint) @@ -175,7 +177,7 @@ class ProcessIOTestCase(TestBase): self.assertTrue(self.frame, "Frame 0 is valid.") if self.TraceOn(): - print "process stopped at breakpoint, sending STDIN via LLDB API." + print("process stopped at breakpoint, sending STDIN via LLDB API.") # Write data to stdin via the public API if we were asked to if put_stdin: @@ -193,8 +195,8 @@ class ProcessIOTestCase(TestBase): # once "input line=>1" appears in stdout. # See also main.c. if self.TraceOn(): - print "output = '%s'" % output - print "error = '%s'" % error + print("output = '%s'" % output) + print("error = '%s'" % error) for line in self.lines: check_line = 'input line to stdout: %s' % (line) diff --git a/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py b/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py index 1880dc25f99..5122a148dc5 100644 --- a/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py +++ b/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py @@ -2,6 +2,8 @@ Check that SBValue.GetValueAsSigned() does the right thing for a 32-bit -1. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/python_api/sbdata/TestSBData.py b/lldb/test/python_api/sbdata/TestSBData.py index beb9fd57c5c..1e8f0e3cb0d 100644 --- a/lldb/test/python_api/sbdata/TestSBData.py +++ b/lldb/test/python_api/sbdata/TestSBData.py @@ -1,5 +1,7 @@ """Test the SBData APIs.""" +from __future__ import print_function + import lldb_shared import os @@ -41,16 +43,16 @@ class SBDataAPICase(TestBase): frame = thread.GetSelectedFrame() if self.TraceOn(): - print frame + print(frame) foobar = frame.FindVariable('foobar') self.assertTrue(foobar.IsValid()) if self.TraceOn(): - print foobar + print(foobar) data = foobar.GetPointeeData(0, 2) if self.TraceOn(): - print data + print(data) offset = 0 error = lldb.SBError() @@ -96,7 +98,7 @@ class SBDataAPICase(TestBase): data = star_foobar.GetData() if self.TraceOn(): - print data + print(data) offset = 0 self.assert_data(data.GetUnsignedInt32, offset, 1) @@ -114,12 +116,12 @@ class SBDataAPICase(TestBase): new_foobar = foobar.CreateValueFromAddress("f00", foobar_addr, star_foobar.GetType()) self.assertTrue(new_foobar.IsValid()) if self.TraceOn(): - print new_foobar + print(new_foobar) data = new_foobar.GetData() if self.TraceOn(): - print data + print(data) self.assertTrue(data.uint32[0] == 8, 'then foo[1].a == 8') self.assertTrue(data.uint32[1] == 7, 'then foo[1].b == 7') @@ -138,7 +140,7 @@ class SBDataAPICase(TestBase): data = new_foobar.GetData() if self.TraceOn(): - print data + print(data) offset = 0 self.assert_data(data.GetUnsignedInt32, offset, 8) @@ -155,10 +157,10 @@ class SBDataAPICase(TestBase): data = barfoo.GetData() if self.TraceOn(): - print barfoo + print(barfoo) if self.TraceOn(): - print data + print(data) offset = 0 self.assert_data(data.GetUnsignedInt32, offset, 1) @@ -178,7 +180,7 @@ class SBDataAPICase(TestBase): new_object = barfoo.CreateValueFromData("new_object",data,barfoo.GetType().GetBasicType(lldb.eBasicTypeInt)) if self.TraceOn(): - print new_object + print(new_object) self.assertTrue(new_object.GetValue() == "1", 'new_object == 1') @@ -192,7 +194,7 @@ class SBDataAPICase(TestBase): data.Append(data2) if self.TraceOn(): - print data + print(data) # this breaks on EBCDIC offset = 0 diff --git a/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py b/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py index eca6f41a13c..903eb8b57e2 100644 --- a/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py +++ b/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py @@ -1,5 +1,7 @@ """Test SBValue::Persist""" +from __future__ import print_function + import lldb_shared import os, sys, time diff --git a/lldb/test/python_api/section/TestSectionAPI.py b/lldb/test/python_api/section/TestSectionAPI.py index 7a6bc3ac812..8d7aef4945d 100755 --- a/lldb/test/python_api/section/TestSectionAPI.py +++ b/lldb/test/python_api/section/TestSectionAPI.py @@ -2,6 +2,8 @@ Test SBSection APIs. """ +from __future__ import print_function + import lldb_shared from lldbtest import * diff --git a/lldb/test/python_api/signals/TestSignalsAPI.py b/lldb/test/python_api/signals/TestSignalsAPI.py index 7bea793c511..8ddbdf3a946 100644 --- a/lldb/test/python_api/signals/TestSignalsAPI.py +++ b/lldb/test/python_api/signals/TestSignalsAPI.py @@ -2,6 +2,8 @@ Test SBProcess APIs, including ReadMemory(), WriteMemory(), and others. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/python_api/symbol-context/TestSymbolContext.py b/lldb/test/python_api/symbol-context/TestSymbolContext.py index 5bca394d3b1..01509a9dd4a 100644 --- a/lldb/test/python_api/symbol-context/TestSymbolContext.py +++ b/lldb/test/python_api/symbol-context/TestSymbolContext.py @@ -2,6 +2,8 @@ Test SBSymbolContext APIs. """ +from __future__ import print_function + import lldb_shared import os, time @@ -32,7 +34,7 @@ class SymbolContextAPITestCase(TestBase): # Now create a breakpoint on main.c by name 'c'. breakpoint = target.BreakpointCreateByName('c', 'a.out') - #print "breakpoint:", breakpoint + #print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) @@ -64,14 +66,14 @@ class SymbolContextAPITestCase(TestBase): function = context.GetFunction() self.assertTrue(function) - #print "function:", function + #print("function:", function) block = context.GetBlock() self.assertTrue(block) - #print "block:", block + #print("block:", block) lineEntry = context.GetLineEntry() - #print "line entry:", lineEntry + #print("line entry:", lineEntry) self.expect(lineEntry.GetFileSpec().GetDirectory(), "The line entry should have the correct directory", exe=False, substrs = [self.mydir]) diff --git a/lldb/test/python_api/target/TestTargetAPI.py b/lldb/test/python_api/target/TestTargetAPI.py index e61d82d0e04..eadae1dc045 100644 --- a/lldb/test/python_api/target/TestTargetAPI.py +++ b/lldb/test/python_api/target/TestTargetAPI.py @@ -2,6 +2,8 @@ Test SBTarget APIs. """ +from __future__ import print_function + import lldb_shared import unittest2 @@ -308,8 +310,8 @@ class TargetAPITestCase(TestBase): # Now create the two breakpoints inside function 'a'. breakpoint1 = target.BreakpointCreateByLocation('main.c', self.line1) breakpoint2 = target.BreakpointCreateByLocation('main.c', self.line2) - #print "breakpoint1:", breakpoint1 - #print "breakpoint2:", breakpoint2 + #print("breakpoint1:", breakpoint1) + #print("breakpoint2:", breakpoint2) self.assertTrue(breakpoint1 and breakpoint1.GetNumLocations() == 1, VALID_BREAKPOINT) @@ -344,23 +346,23 @@ class TargetAPITestCase(TestBase): address2 = lineEntry.GetStartAddress() - #print "address1:", address1 - #print "address2:", address2 + #print("address1:", address1) + #print("address2:", address2) # Now call SBTarget.ResolveSymbolContextForAddress() with the addresses from our line entry. context1 = target.ResolveSymbolContextForAddress(address1, lldb.eSymbolContextEverything) context2 = target.ResolveSymbolContextForAddress(address2, lldb.eSymbolContextEverything) self.assertTrue(context1 and context2) - #print "context1:", context1 - #print "context2:", context2 + #print("context1:", context1) + #print("context2:", context2) # Verify that the context point to the same function 'a'. symbol1 = context1.GetSymbol() symbol2 = context2.GetSymbol() self.assertTrue(symbol1 and symbol2) - #print "symbol1:", symbol1 - #print "symbol2:", symbol2 + #print("symbol1:", symbol1) + #print("symbol2:", symbol2) from lldbutil import get_description desc1 = get_description(symbol1) diff --git a/lldb/test/python_api/thread/TestThreadAPI.py b/lldb/test/python_api/thread/TestThreadAPI.py index 2fea893a1eb..4d8e9b4872d 100644 --- a/lldb/test/python_api/thread/TestThreadAPI.py +++ b/lldb/test/python_api/thread/TestThreadAPI.py @@ -2,6 +2,8 @@ Test SBThread APIs. """ +from __future__ import print_function + import lldb_shared import os, time @@ -85,7 +87,7 @@ class ThreadAPITestCase(TestBase): self.runCmd("process status") proc_of_thread = thread.GetProcess() - #print "proc_of_thread:", proc_of_thread + #print("proc_of_thread:", proc_of_thread) self.assertTrue(proc_of_thread.GetProcessID() == process.GetProcessID()) def get_stop_description(self): @@ -224,8 +226,8 @@ class ThreadAPITestCase(TestBase): start_addr = lineEntry.GetStartAddress().GetLoadAddress(target) end_addr = lineEntry.GetEndAddress().GetLoadAddress(target) if self.TraceOn(): - print "start addr:", hex(start_addr) - print "end addr:", hex(end_addr) + print("start addr:", hex(start_addr)) + print("end addr:", hex(end_addr)) # Disable the breakpoint. self.assertTrue(target.DisableAllBreakpoints()) diff --git a/lldb/test/python_api/type/TestTypeList.py b/lldb/test/python_api/type/TestTypeList.py index 4be01a210bf..27683c1dc1b 100644 --- a/lldb/test/python_api/type/TestTypeList.py +++ b/lldb/test/python_api/type/TestTypeList.py @@ -2,6 +2,8 @@ Test SBType and SBTypeList API. """ +from __future__ import print_function + import lldb_shared import os, time @@ -51,7 +53,7 @@ class TypeAndTypeListTestCase(TestBase): # Get the type 'Task'. type_list = target.FindTypes('Task') if self.TraceOn(): - print "Size of type_list from target.FindTypes('Task') query: %d" % type_list.GetSize() + print("Size of type_list from target.FindTypes('Task') query: %d" % type_list.GetSize()) self.assertTrue(len(type_list) >= 1) # a second Task make be scared up by the Objective-C runtime for type in type_list: self.assertTrue(type) diff --git a/lldb/test/python_api/value/TestValueAPI.py b/lldb/test/python_api/value/TestValueAPI.py index e6d8825c530..26813506cb3 100644 --- a/lldb/test/python_api/value/TestValueAPI.py +++ b/lldb/test/python_api/value/TestValueAPI.py @@ -2,6 +2,8 @@ Test some SBValue APIs. """ +from __future__ import print_function + import lldb_shared import os, time @@ -73,10 +75,10 @@ class ValueAPITestCase(TestBase): cvf = lldbutil.ChildVisitingFormatter(indent_child=2) rdf = lldbutil.RecursiveDecentFormatter(indent_child=2) if self.TraceOn(): - print fmt.format(days_of_week) - print cvf.format(days_of_week) - print cvf.format(weekdays) - print rdf.format(g_table) + print(fmt.format(days_of_week)) + print(cvf.format(days_of_week)) + print(cvf.format(weekdays)) + print(rdf.format(g_table)) # Get variable 'my_int_ptr'. value = frame0.FindVariable('my_int_ptr') diff --git a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py index 0b326b945e1..452cc63e704 100644 --- a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py +++ b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py @@ -2,6 +2,8 @@ Test some SBValue APIs. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py index 8270ed8fffe..4c3a9b0da46 100644 --- a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py +++ b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py @@ -3,6 +3,8 @@ Test SBValue API linked_list_iter which treats the SBValue as a linked list and supports iteration till the end of list is reached. """ +from __future__ import print_function + import lldb_shared import os, time @@ -63,12 +65,12 @@ class ValueAsLinkedListTestCase(TestBase): # Make sure that 'next' corresponds to an SBValue with pointer type. self.assertTrue(t.TypeIsPointerType()) if self.TraceOn(): - print cvf.format(t) + print(cvf.format(t)) list.append(int(t.GetChildMemberWithName("id").GetValue())) # Sanity checks that the we visited all the items (no more, no less). if self.TraceOn(): - print "visited IDs:", list + print("visited IDs:", list) self.assertTrue(visitedIDs == list) # Let's exercise the linked_list_iter() API again, this time supplying @@ -93,12 +95,12 @@ class ValueAsLinkedListTestCase(TestBase): # Make sure that 'next' corresponds to an SBValue with pointer type. self.assertTrue(t.TypeIsPointerType()) if self.TraceOn(): - print cvf.format(t) + print(cvf.format(t)) list.append(int(t.GetChildMemberWithName("id").GetValue())) # Sanity checks that the we visited all the items (no more, no less). if self.TraceOn(): - print "visited IDs:", list + print("visited IDs:", list) self.assertTrue(visitedIDs == list) # Get variable 'empty_task_head'. @@ -110,7 +112,7 @@ class ValueAsLinkedListTestCase(TestBase): # There is no iterable item from empty_task_head.linked_list_iter(). for t in empty_task_head.linked_list_iter('next', eol): if self.TraceOn(): - print cvf.format(t) + print(cvf.format(t)) list.append(int(t.GetChildMemberWithName("id").GetValue())) self.assertTrue(len(list) == 0) @@ -124,7 +126,7 @@ class ValueAsLinkedListTestCase(TestBase): # There 3 iterable items from task_evil.linked_list_iter(). :-) for t in task_evil.linked_list_iter('next'): if self.TraceOn(): - print cvf.format(t) + print(cvf.format(t)) list.append(int(t.GetChildMemberWithName("id").GetValue())) self.assertTrue(len(list) == 3) diff --git a/lldb/test/python_api/value_var_update/TestValueVarUpdate.py b/lldb/test/python_api/value_var_update/TestValueVarUpdate.py index 9c0123ec2e1..87e0ccd6629 100644 --- a/lldb/test/python_api/value_var_update/TestValueVarUpdate.py +++ b/lldb/test/python_api/value_var_update/TestValueVarUpdate.py @@ -1,5 +1,7 @@ """Test SBValue::GetValueDidChange""" +from __future__ import print_function + import lldb_shared import os, sys, time diff --git a/lldb/test/python_api/watchpoint/TestSetWatchpoint.py b/lldb/test/python_api/watchpoint/TestSetWatchpoint.py index 242b199db7d..5554ff044d6 100644 --- a/lldb/test/python_api/watchpoint/TestSetWatchpoint.py +++ b/lldb/test/python_api/watchpoint/TestSetWatchpoint.py @@ -2,6 +2,8 @@ Use lldb Python SBValue API to create a watchpoint for read_write of 'globl' var. """ +from __future__ import print_function + import lldb_shared import os, time @@ -61,7 +63,7 @@ class SetWatchpointAPITestCase(TestBase): if not self.TraceOn(): self.HideStdout() - print watchpoint + print(watchpoint) # Continue. Expect the program to stop due to the variable being written to. process.Continue() diff --git a/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py b/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py index f8ae2a23966..95dad364de9 100644 --- a/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py +++ b/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py @@ -2,6 +2,8 @@ Use lldb Python SBWatchpoint API to set the ignore count. """ +from __future__ import print_function + import lldb_shared import os, time @@ -68,12 +70,12 @@ class WatchpointIgnoreCountTestCase(TestBase): self.assertTrue(watchpoint.GetIgnoreCount() == 0) watch_id = watchpoint.GetID() self.assertTrue(watch_id != 0) - print watchpoint + print(watchpoint) # Now immediately set the ignore count to 2. When we continue, expect the # inferior to run to its completion without stopping due to watchpoint. watchpoint.SetIgnoreCount(2) - print watchpoint + print(watchpoint) process.Continue() # At this point, the inferior process should have exited. @@ -83,4 +85,4 @@ class WatchpointIgnoreCountTestCase(TestBase): self.assertTrue(watchpoint) self.assertTrue(watchpoint.GetWatchSize() == 4) self.assertTrue(watchpoint.GetHitCount() == 2) - print watchpoint + print(watchpoint) diff --git a/lldb/test/python_api/watchpoint/TestWatchpointIter.py b/lldb/test/python_api/watchpoint/TestWatchpointIter.py index 0ba73c0500b..4ce2c0d79d8 100644 --- a/lldb/test/python_api/watchpoint/TestWatchpointIter.py +++ b/lldb/test/python_api/watchpoint/TestWatchpointIter.py @@ -2,6 +2,8 @@ Use lldb Python SBTarget API to iterate on the watchpoint(s) for the target. """ +from __future__ import print_function + import lldb_shared import os, time @@ -84,11 +86,11 @@ class WatchpointIteratorTestCase(TestBase): # We currently only support hardware watchpoint. Verify that we have a # meaningful hardware index at this point. Exercise the printed repr of # SBWatchpointLocation. - print watchpoint + print(watchpoint) self.assertTrue(watchpoint.GetHardwareIndex() != -1) # SBWatchpoint.GetDescription() takes a description level arg. - print lldbutil.get_description(watchpoint, lldb.eDescriptionLevelFull) + print(lldbutil.get_description(watchpoint, lldb.eDescriptionLevelFull)) # Now disable the 'rw' watchpoint. The program won't stop when it reads # 'global' next. @@ -108,4 +110,5 @@ class WatchpointIteratorTestCase(TestBase): self.assertTrue(watchpoint) self.assertTrue(watchpoint.GetWatchSize() == 4) self.assertTrue(watchpoint.GetHitCount() == 1) - print watchpoint + print(watchpoint) + diff --git a/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py b/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py index dd7c79971e8..582e60ebe2c 100644 --- a/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py +++ b/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py @@ -2,6 +2,8 @@ Test watchpoint condition API. """ +from __future__ import print_function + import lldb_shared import os, time @@ -71,7 +73,7 @@ class WatchpointConditionAPITestCase(TestBase): if not self.TraceOn(): self.HideStdout() - print watchpoint + print(watchpoint) # Continue. Expect the program to stop due to the variable being written to. process.Continue() diff --git a/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py b/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py index 51a8955b689..3ce2445f442 100644 --- a/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py +++ b/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py @@ -2,6 +2,8 @@ Use lldb Python SBValue.WatchPointee() API to create a watchpoint for write of '*g_char_ptr'. """ +from __future__ import print_function + import lldb_shared import os, time @@ -68,7 +70,7 @@ class SetWatchlocationAPITestCase(TestBase): if not self.TraceOn(): self.HideStdout() - print watchpoint + print(watchpoint) # Continue. Expect the program to stop due to the variable being written to. process.Continue() diff --git a/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py b/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py index d6a3ca60c87..884989f46de 100644 --- a/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py +++ b/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py @@ -2,6 +2,8 @@ Use lldb Python SBtarget.WatchAddress() API to create a watchpoint for write of '*g_char_ptr'. """ +from __future__ import print_function + import lldb_shared import os, time @@ -68,7 +70,7 @@ class TargetWatchAddressAPITestCase(TestBase): if not self.TraceOn(): self.HideStdout() - print watchpoint + print(watchpoint) # Continue. Expect the program to stop due to the variable being written to. process.Continue() diff --git a/lldb/test/redo.py b/lldb/test/redo.py index 65dcaa8d552..e4eba8b2786 100755 --- a/lldb/test/redo.py +++ b/lldb/test/redo.py @@ -90,7 +90,7 @@ def redo(suffix, dir, names): for name in names: if name.endswith(suffix): - #print "Find a log file:", name + #print("Find a log file:", name) if name.startswith("Error") or name.startswith("Failure"): if filename_components: if not all([comp in name for comp in filename_components]): @@ -166,7 +166,7 @@ def main(): print("No default session directory found, please specify it explicitly.") usage() - #print "The test directory:", test_dir + #print("The test directory:", test_dir) session_dir_path = where(session_dir, test_dir) print("Using session dir path:", session_dir_path) diff --git a/lldb/test/settings/TestSettings.py b/lldb/test/settings/TestSettings.py index a20a90383d2..c48ef7b01f4 100644 --- a/lldb/test/settings/TestSettings.py +++ b/lldb/test/settings/TestSettings.py @@ -2,6 +2,8 @@ Test lldb settings command. """ +from __future__ import print_function + import lldb_shared import os, time, re diff --git a/lldb/test/settings/quoting/TestQuoting.py b/lldb/test/settings/quoting/TestQuoting.py index 7ef861d2639..1c1bb8f5f46 100644 --- a/lldb/test/settings/quoting/TestQuoting.py +++ b/lldb/test/settings/quoting/TestQuoting.py @@ -2,6 +2,8 @@ Test quoting of arguments to lldb commands """ +from __future__ import print_function + import lldb_shared import os, time, re diff --git a/lldb/test/source-manager/TestSourceManager.py b/lldb/test/source-manager/TestSourceManager.py index ea6499ea669..9beaacefa62 100644 --- a/lldb/test/source-manager/TestSourceManager.py +++ b/lldb/test/source-manager/TestSourceManager.py @@ -9,6 +9,8 @@ o test_modify_source_file_while_debugging: Test the caching mechanism of the source manager. """ +from __future__ import print_function + import lldb_shared import lldb @@ -135,24 +137,24 @@ class SourceManagerTestCase(TestBase): with open('main.c', 'r') as f: original_content = f.read() if self.TraceOn(): - print "original content:", original_content + print("original content:", original_content) # Modify the in-memory copy of the original source code. new_content = original_content.replace('Hello world', 'Hello lldb', 1) # This is the function to restore the original content. def restore_file(): - #print "os.path.getmtime() before restore:", os.path.getmtime('main.c') + #print("os.path.getmtime() before restore:", os.path.getmtime('main.c')) time.sleep(1) with open('main.c', 'wb') as f: f.write(original_content) if self.TraceOn(): with open('main.c', 'r') as f: - print "content restored to:", f.read() + print("content restored to:", f.read()) # Touch the file just to be sure. os.utime('main.c', None) if self.TraceOn(): - print "os.path.getmtime() after restore:", os.path.getmtime('main.c') + print("os.path.getmtime() after restore:", os.path.getmtime('main.c')) @@ -161,8 +163,8 @@ class SourceManagerTestCase(TestBase): time.sleep(1) f.write(new_content) if self.TraceOn(): - print "new content:", new_content - print "os.path.getmtime() after writing new content:", os.path.getmtime('main.c') + print("new content:", new_content) + print("os.path.getmtime() after writing new content:", os.path.getmtime('main.c')) # Add teardown hook to restore the file to the original content. self.addTearDownHook(restore_file) diff --git a/lldb/test/terminal/TestSTTYBeforeAndAfter.py b/lldb/test/terminal/TestSTTYBeforeAndAfter.py index 49e91cf42a3..f477577f36a 100644 --- a/lldb/test/terminal/TestSTTYBeforeAndAfter.py +++ b/lldb/test/terminal/TestSTTYBeforeAndAfter.py @@ -2,6 +2,8 @@ Test that 'stty -a' displays the same output before and after running the lldb command. """ +from __future__ import print_function + import lldb_shared import os @@ -89,30 +91,30 @@ class CommandLineCompletionTestCase(TestBase): with open('child_send1.txt', 'r') as fs: if self.TraceOn(): - print "\n\nContents of child_send1.txt:" - print fs.read() + print("\n\nContents of child_send1.txt:") + print(fs.read()) with open('child_read1.txt', 'r') as fr: from_child1 = fr.read() if self.TraceOn(): - print "\n\nContents of child_read1.txt:" - print from_child1 + print("\n\nContents of child_read1.txt:") + print(from_child1) with open('child_send2.txt', 'r') as fs: if self.TraceOn(): - print "\n\nContents of child_send2.txt:" - print fs.read() + print("\n\nContents of child_send2.txt:") + print(fs.read()) with open('child_read2.txt', 'r') as fr: from_child2 = fr.read() if self.TraceOn(): - print "\n\nContents of child_read2.txt:" - print from_child2 + print("\n\nContents of child_read2.txt:") + print(from_child2) stty_output1_lines = from_child1.splitlines() stty_output2_lines = from_child2.splitlines() zipped = zip(stty_output1_lines, stty_output2_lines) for tuple in zipped: if self.TraceOn(): - print "tuple->%s" % str(tuple) + print("tuple->%s" % str(tuple)) # Every line should compare equal until the first blank line. if len(tuple[0]) == 0: break diff --git a/lldb/test/test_results.py b/lldb/test/test_results.py index e42496fd487..f35d34c9d03 100644 --- a/lldb/test/test_results.py +++ b/lldb/test/test_results.py @@ -8,6 +8,8 @@ Provides classes used by the test results reporting infrastructure within the LLDB test suite. """ +from __future__ import print_function + import lldb_shared import argparse diff --git a/lldb/test/test_runner/test/inferior.py b/lldb/test/test_runner/test/inferior.py index 925ad6da8d1..4207bac300f 100644 --- a/lldb/test/test_runner/test/inferior.py +++ b/lldb/test/test_runner/test/inferior.py @@ -1,5 +1,8 @@ #!/usr/bin/env python """Inferior program used by process control tests.""" + +from __future__ import print_function + import argparse import datetime import signal @@ -67,7 +70,7 @@ def handle_ignore_signals(options, signals): for signum in signals: if options.verbose: - print "disabling signum {}".format(signum) + print("disabling signum {}".format(signum)) signal.signal(signum, signal.SIG_IGN) @@ -88,7 +91,7 @@ def handle_sleep(options, sleep_seconds): end_time = datetime.datetime.now() + datetime.timedelta(0, sleep_seconds) if options.verbose: - print "sleep end time: {}".format(end_time) + print("sleep end time: {}".format(end_time)) # Do sleep in a loop: signals can interrupt. while datetime.datetime.now() < end_time: diff --git a/lldb/test/tools/lldb-mi/TestMiExit.py b/lldb/test/tools/lldb-mi/TestMiExit.py index 3d0463de86d..2df106f1032 100644 --- a/lldb/test/tools/lldb-mi/TestMiExit.py +++ b/lldb/test/tools/lldb-mi/TestMiExit.py @@ -2,6 +2,8 @@ Test that the lldb-mi driver exits properly. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/TestMiFile.py b/lldb/test/tools/lldb-mi/TestMiFile.py index 01f9dc643ea..f73ed269a28 100644 --- a/lldb/test/tools/lldb-mi/TestMiFile.py +++ b/lldb/test/tools/lldb-mi/TestMiFile.py @@ -2,6 +2,8 @@ Test lldb-mi -file-xxx commands. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/TestMiGdbSetShow.py b/lldb/test/tools/lldb-mi/TestMiGdbSetShow.py index 45aff71ae52..341ff8eabb5 100644 --- a/lldb/test/tools/lldb-mi/TestMiGdbSetShow.py +++ b/lldb/test/tools/lldb-mi/TestMiGdbSetShow.py @@ -2,6 +2,8 @@ Test lldb-mi -gdb-set and -gdb-show commands. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/tools/lldb-mi/TestMiLibraryLoaded.py b/lldb/test/tools/lldb-mi/TestMiLibraryLoaded.py index 841398618c9..03a3f34ef7d 100644 --- a/lldb/test/tools/lldb-mi/TestMiLibraryLoaded.py +++ b/lldb/test/tools/lldb-mi/TestMiLibraryLoaded.py @@ -2,6 +2,8 @@ Test lldb-mi =library-loaded notifications. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/TestMiPrompt.py b/lldb/test/tools/lldb-mi/TestMiPrompt.py index 6f4bb76ddc7..63eae646e50 100644 --- a/lldb/test/tools/lldb-mi/TestMiPrompt.py +++ b/lldb/test/tools/lldb-mi/TestMiPrompt.py @@ -2,6 +2,8 @@ Test that the lldb-mi driver prints prompt properly. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py b/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py index c08e92eba6a..f482f5a4d87 100644 --- a/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py +++ b/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py @@ -2,6 +2,8 @@ Test lldb-mi -break-xxx commands. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/tools/lldb-mi/control/TestMiExec.py b/lldb/test/tools/lldb-mi/control/TestMiExec.py index a17fd66eb6e..8b54ec75259 100644 --- a/lldb/test/tools/lldb-mi/control/TestMiExec.py +++ b/lldb/test/tools/lldb-mi/control/TestMiExec.py @@ -2,6 +2,8 @@ Test lldb-mi -exec-xxx commands. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/data/TestMiData.py b/lldb/test/tools/lldb-mi/data/TestMiData.py index 42efeed72a6..d6e440af8e6 100644 --- a/lldb/test/tools/lldb-mi/data/TestMiData.py +++ b/lldb/test/tools/lldb-mi/data/TestMiData.py @@ -2,6 +2,8 @@ Test lldb-mi -data-xxx commands. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/tools/lldb-mi/interpreter/TestMiCliSupport.py b/lldb/test/tools/lldb-mi/interpreter/TestMiCliSupport.py index b28c055afbe..6a4a6e8a08e 100644 --- a/lldb/test/tools/lldb-mi/interpreter/TestMiCliSupport.py +++ b/lldb/test/tools/lldb-mi/interpreter/TestMiCliSupport.py @@ -2,6 +2,8 @@ Test lldb-mi can interpret CLI commands directly. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py b/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py index 86eb8ffb3c4..45151ef077f 100644 --- a/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py +++ b/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py @@ -2,6 +2,8 @@ Test lldb-mi -interpreter-exec command. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/lldbmi_testcase.py b/lldb/test/tools/lldb-mi/lldbmi_testcase.py index e29864ac5df..82c49babfaa 100644 --- a/lldb/test/tools/lldb-mi/lldbmi_testcase.py +++ b/lldb/test/tools/lldb-mi/lldbmi_testcase.py @@ -2,6 +2,8 @@ Base class for lldb-mi test cases. """ +from __future__ import print_function + import lldb_shared from lldbtest import * @@ -24,9 +26,9 @@ class MiTestCaseBase(Base): def tearDown(self): if self.TraceOn(): - print "\n\nContents of %s:" % self.mylog + print("\n\nContents of %s:" % self.mylog) try: - print open(self.mylog, "r").read() + print(open(self.mylog, "r").read()) except IOError: pass Base.tearDown(self) diff --git a/lldb/test/tools/lldb-mi/signal/TestMiSignal.py b/lldb/test/tools/lldb-mi/signal/TestMiSignal.py index 22f05c31952..90cea88dcd1 100644 --- a/lldb/test/tools/lldb-mi/signal/TestMiSignal.py +++ b/lldb/test/tools/lldb-mi/signal/TestMiSignal.py @@ -2,6 +2,8 @@ Test that the lldb-mi handles signals properly. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/stack/TestMiStack.py b/lldb/test/tools/lldb-mi/stack/TestMiStack.py index f4ebf30141e..34dceb42a30 100644 --- a/lldb/test/tools/lldb-mi/stack/TestMiStack.py +++ b/lldb/test/tools/lldb-mi/stack/TestMiStack.py @@ -2,6 +2,8 @@ Test lldb-mi -stack-xxx commands. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py b/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py index 8f341197387..6137b5ce2d1 100644 --- a/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py +++ b/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py @@ -2,6 +2,8 @@ Test lldb-mi startup options. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py b/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py index 6b0fe28897d..47e4ace4470 100644 --- a/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py +++ b/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py @@ -2,6 +2,8 @@ Test lldb-mi -symbol-xxx commands. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py b/lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py index 96ff1076c2f..b3a501cf63f 100644 --- a/lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py +++ b/lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py @@ -2,6 +2,8 @@ Test that the lldb-mi driver understands MI command syntax. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/target/TestMiTarget.py b/lldb/test/tools/lldb-mi/target/TestMiTarget.py index 0166c8d674a..66b2c783a73 100644 --- a/lldb/test/tools/lldb-mi/target/TestMiTarget.py +++ b/lldb/test/tools/lldb-mi/target/TestMiTarget.py @@ -2,6 +2,8 @@ Test lldb-mi -target-xxx commands. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py b/lldb/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py index 177ddae8c73..59cb66d7267 100644 --- a/lldb/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py +++ b/lldb/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py @@ -3,6 +3,8 @@ Test lldb-mi -gdb-set and -gdb-show commands for 'print option-name'. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-mi/variable/TestMiVar.py b/lldb/test/tools/lldb-mi/variable/TestMiVar.py index d1d3bdc9a77..093b85cfbcc 100644 --- a/lldb/test/tools/lldb-mi/variable/TestMiVar.py +++ b/lldb/test/tools/lldb-mi/variable/TestMiVar.py @@ -2,6 +2,8 @@ Test lldb-mi -var-xxx commands. """ +from __future__ import print_function + import lldb_shared import lldbmi_testcase diff --git a/lldb/test/tools/lldb-server/TestGDBRemoteMemoryRead.py b/lldb/test/tools/lldb-server/TestGDBRemoteMemoryRead.py index 33a6832981e..0980b45a3fe 100644 --- a/lldb/test/tools/lldb-server/TestGDBRemoteMemoryRead.py +++ b/lldb/test/tools/lldb-server/TestGDBRemoteMemoryRead.py @@ -2,6 +2,8 @@ Tests the binary ($x) and hex ($m) memory read packets of the remote stub """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteAttach.py b/lldb/test/tools/lldb-server/TestGdbRemoteAttach.py index 797814b704a..b0e1e3fe3bf 100644 --- a/lldb/test/tools/lldb-server/TestGdbRemoteAttach.py +++ b/lldb/test/tools/lldb-server/TestGdbRemoteAttach.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py b/lldb/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py index 782a3d700f0..a552536c493 100644 --- a/lldb/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py +++ b/lldb/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase @@ -99,7 +101,7 @@ class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase): # Ensure auxv data is a multiple of 2*word_size (there should be two unsigned long fields per auxv entry). self.assertEquals(len(auxv_data) % (2*word_size), 0) - # print "auxv contains {} entries".format(len(auxv_data) / (2*word_size)) + # print("auxv contains {} entries".format(len(auxv_data) / (2*word_size))) @debugserver_test def test_auxv_data_is_correct_size_debugserver(self): @@ -137,7 +139,7 @@ class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase): for auxv_key in auxv_dict: self.assertTrue(auxv_key >= 1) self.assertTrue(auxv_key <= 1000) - # print "auxv dict: {}".format(auxv_dict) + # print("auxv dict: {}".format(auxv_dict)) @debugserver_test def test_auxv_keys_look_valid_debugserver(self): diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py b/lldb/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py index 9218dbfb134..f43b4a169e0 100644 --- a/lldb/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py +++ b/lldb/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase @@ -46,7 +48,7 @@ class TestGdbRemoteExpeditedRegisters(gdbremote_testcase.GdbRemoteTestCaseBase): # Ensure the expedited registers contained it. self.assertTrue(reg_info["lldb_register_index"] in expedited_registers) - # print "{} reg_info:{}".format(generic_register_name, reg_info) + # print("{} reg_info:{}".format(generic_register_name, reg_info)) def stop_notification_contains_any_registers(self): # Generate a stop reply, parse out expedited registers from stop notification. diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteKill.py b/lldb/test/tools/lldb-server/TestGdbRemoteKill.py index f4de5a0c9c8..2bfe3df9668 100644 --- a/lldb/test/tools/lldb-server/TestGdbRemoteKill.py +++ b/lldb/test/tools/lldb-server/TestGdbRemoteKill.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteProcessInfo.py b/lldb/test/tools/lldb-server/TestGdbRemoteProcessInfo.py index 3ef299eac99..baeb3af2189 100644 --- a/lldb/test/tools/lldb-server/TestGdbRemoteProcessInfo.py +++ b/lldb/test/tools/lldb-server/TestGdbRemoteProcessInfo.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteRegisterState.py b/lldb/test/tools/lldb-server/TestGdbRemoteRegisterState.py index f2d44cad93f..7bc328e1ba5 100644 --- a/lldb/test/tools/lldb-server/TestGdbRemoteRegisterState.py +++ b/lldb/test/tools/lldb-server/TestGdbRemoteRegisterState.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase @@ -50,7 +52,7 @@ class TestGdbRemoteRegisterState(gdbremote_testcase.GdbRemoteTestCaseBase): self.assertIsNotNone(threads) thread_id = threads[0] self.assertIsNotNone(thread_id) - # print "Running on thread: 0x{:x}".format(thread_id) + # print("Running on thread: 0x{:x}".format(thread_id)) else: thread_id = None @@ -64,19 +66,19 @@ class TestGdbRemoteRegisterState(gdbremote_testcase.GdbRemoteTestCaseBase): (success, state_id) = self.parse_QSaveRegisterState_response(context) self.assertTrue(success) self.assertIsNotNone(state_id) - # print "saved register state id: {}".format(state_id) + # print("saved register state id: {}".format(state_id)) # Remember initial register values. initial_reg_values = self.read_register_values(gpr_reg_infos, endian, thread_id=thread_id) - # print "initial_reg_values: {}".format(initial_reg_values) + # print("initial_reg_values: {}".format(initial_reg_values)) # Flip gpr register values. (successful_writes, failed_writes) = self.flip_all_bits_in_each_register_value(gpr_reg_infos, endian, thread_id=thread_id) - # print "successful writes: {}, failed writes: {}".format(successful_writes, failed_writes) + # print("successful writes: {}, failed writes: {}".format(successful_writes, failed_writes)) self.assertTrue(successful_writes > 0) flipped_reg_values = self.read_register_values(gpr_reg_infos, endian, thread_id=thread_id) - # print "flipped_reg_values: {}".format(flipped_reg_values) + # print("flipped_reg_values: {}".format(flipped_reg_values)) # Restore register values. self.reset_test_sequence() @@ -87,7 +89,7 @@ class TestGdbRemoteRegisterState(gdbremote_testcase.GdbRemoteTestCaseBase): # Verify registers match initial register values. final_reg_values = self.read_register_values(gpr_reg_infos, endian, thread_id=thread_id) - # print "final_reg_values: {}".format(final_reg_values) + # print("final_reg_values: {}".format(final_reg_values)) self.assertIsNotNone(final_reg_values) self.assertEquals(final_reg_values, initial_reg_values) diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteSingleStep.py b/lldb/test/tools/lldb-server/TestGdbRemoteSingleStep.py index 98ea7df55e8..355f0cb6e19 100644 --- a/lldb/test/tools/lldb-server/TestGdbRemoteSingleStep.py +++ b/lldb/test/tools/lldb-server/TestGdbRemoteSingleStep.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py b/lldb/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py index ab4f4571829..70548575b62 100644 --- a/lldb/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py +++ b/lldb/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase diff --git a/lldb/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py b/lldb/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py index d8abdfc4f1a..cf1099da4ea 100644 --- a/lldb/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py +++ b/lldb/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import sys diff --git a/lldb/test/tools/lldb-server/TestGdbRemote_vCont.py b/lldb/test/tools/lldb-server/TestGdbRemote_vCont.py index 370d9459306..48189b38a8f 100644 --- a/lldb/test/tools/lldb-server/TestGdbRemote_vCont.py +++ b/lldb/test/tools/lldb-server/TestGdbRemote_vCont.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase diff --git a/lldb/test/tools/lldb-server/TestLldbGdbServer.py b/lldb/test/tools/lldb-server/TestLldbGdbServer.py index 9d8f418b906..a314f163b50 100644 --- a/lldb/test/tools/lldb-server/TestLldbGdbServer.py +++ b/lldb/test/tools/lldb-server/TestLldbGdbServer.py @@ -10,6 +10,8 @@ gdb remote packet functional areas. For now it contains the initial set of tests implemented. """ +from __future__ import print_function + import lldb_shared import unittest2 @@ -1343,7 +1345,7 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase): # Write flipped bit pattern of existing value to each register. (successful_writes, failed_writes) = self.flip_all_bits_in_each_register_value(gpr_reg_infos, endian) - # print "successful writes: {}, failed writes: {}".format(successful_writes, failed_writes) + # print("successful writes: {}, failed writes: {}".format(successful_writes, failed_writes)) self.assertTrue(successful_writes > 0) # Note: as of this moment, a hefty number of the GPR writes are failing with E32 (everything except rax-rdx, rdi, rsi, rbp). diff --git a/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py b/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py index 34850c74868..f37da8f54f1 100644 --- a/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py +++ b/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import gdbremote_testcase import lldbgdbserverutils import re @@ -63,7 +65,7 @@ class TestStubReverseConnect(gdbremote_testcase.GdbRemoteTestCaseBase): (stub_socket, address) = self.listener_socket.accept() self.assertIsNotNone(stub_socket) self.assertIsNotNone(address) - print "connected to stub {} on {}".format(address, stub_socket.getsockname()) + print("connected to stub {} on {}".format(address, stub_socket.getsockname())) # Verify we can do the handshake. If that works, we'll call it good. self.do_handshake(stub_socket, timeout_seconds=self._DEFAULT_TIMEOUT) diff --git a/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py b/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py index 401206bca02..23dda3686ad 100644 --- a/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py +++ b/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase diff --git a/lldb/test/tools/lldb-server/gdbremote_testcase.py b/lldb/test/tools/lldb-server/gdbremote_testcase.py index 91f36c0111a..22e0bc87d4e 100644 --- a/lldb/test/tools/lldb-server/gdbremote_testcase.py +++ b/lldb/test/tools/lldb-server/gdbremote_testcase.py @@ -2,6 +2,8 @@ Base class for gdb-remote test cases. """ +from __future__ import print_function + import lldb_shared import errno @@ -98,21 +100,21 @@ class GdbRemoteTestCaseBase(TestBase): try: named_pipe.close() except: - print "failed to close named pipe" + print("failed to close named pipe") None # Delete the pipe. try: os.remove(named_pipe_path) except: - print "failed to delete named pipe: {}".format(named_pipe_path) + print("failed to delete named pipe: {}".format(named_pipe_path)) None # Delete the temp directory. try: os.rmdir(temp_dir) except: - print "failed to delete temp dir: {}, directory contents: '{}'".format(temp_dir, os.listdir(temp_dir)) + print("failed to delete temp dir: {}, directory contents: '{}'".format(temp_dir, os.listdir(temp_dir))) None # Add the shutdown hook to clean up the named pipe. @@ -1005,7 +1007,7 @@ class GdbRemoteTestCaseBase(TestBase): # Flip the value by xoring with all 1s all_one_bits_raw = "ff" * (int(reg_info["bitsize"]) / 8) flipped_bits_int = initial_reg_value ^ int(all_one_bits_raw, 16) - # print "reg (index={}, name={}): val={}, flipped bits (int={}, hex={:x})".format(reg_index, reg_info["name"], initial_reg_value, flipped_bits_int, flipped_bits_int) + # print("reg (index={}, name={}): val={}, flipped bits (int={}, hex={:x})".format(reg_index, reg_info["name"], initial_reg_value, flipped_bits_int, flipped_bits_int)) # Handle thread suffix for P. if thread_id: @@ -1031,7 +1033,7 @@ class GdbRemoteTestCaseBase(TestBase): successful_writes += 1 else: failed_writes += 1 - # print "reg (index={}, name={}) write FAILED (error: {})".format(reg_index, reg_info["name"], P_response) + # print("reg (index={}, name={}) write FAILED (error: {})".format(reg_index, reg_info["name"], P_response)) # Read back the register value, ensure it matches the flipped value. if P_response == "OK": @@ -1049,7 +1051,7 @@ class GdbRemoteTestCaseBase(TestBase): if verify_bits != flipped_bits_int: # Some registers, like mxcsrmask and others, will permute what's written. Adjust succeed/fail counts. - # print "reg (index={}, name={}): read verify FAILED: wrote {:x}, verify read back {:x}".format(reg_index, reg_info["name"], flipped_bits_int, verify_bits) + # print("reg (index={}, name={}): read verify FAILED: wrote {:x}, verify read back {:x}".format(reg_index, reg_info["name"], flipped_bits_int, verify_bits)) successful_writes -= 1 failed_writes +=1 @@ -1134,7 +1136,7 @@ class GdbRemoteTestCaseBase(TestBase): # Build the packet for the single step instruction. We replace {thread}, if present, with the thread_id. step_packet = "read packet: ${}#00".format(re.sub(r"{thread}", "{:x}".format(thread_id), step_instruction)) - # print "\nstep_packet created: {}\n".format(step_packet) + # print("\nstep_packet created: {}\n".format(step_packet)) # Single step. self.reset_test_sequence() diff --git a/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py b/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py index e07fe8bc096..b8a970a5c64 100644 --- a/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py +++ b/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase diff --git a/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py b/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py index 0c0bef457de..2fb609c01b1 100644 --- a/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py +++ b/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import gdbremote_testcase diff --git a/lldb/test/tools/lldb-server/lldbgdbserverutils.py b/lldb/test/tools/lldb-server/lldbgdbserverutils.py index 1d4f40dd4d6..eb388918879 100644 --- a/lldb/test/tools/lldb-server/lldbgdbserverutils.py +++ b/lldb/test/tools/lldb-server/lldbgdbserverutils.py @@ -1,6 +1,8 @@ """Module for supporting unit testing of the lldb-server debug monitor exe. """ +from __future__ import print_function + import lldb_shared import os @@ -701,12 +703,12 @@ class MatchRemoteOutputEntry(GdbRemoteEntryBase): # If we don't match, wait to try again after next $O content, or time out. if not match: - # print "re pattern \"{}\" did not match against \"{}\"".format(self._regex.pattern, accumulated_output) + # print("re pattern \"{}\" did not match against \"{}\"".format(self._regex.pattern, accumulated_output)) return context # We do match. self._matched = True - # print "re pattern \"{}\" matched against \"{}\"".format(self._regex.pattern, accumulated_output) + # print("re pattern \"{}\" matched against \"{}\"".format(self._regex.pattern, accumulated_output)) # Collect up any captures into the context. if self._capture: @@ -835,6 +837,6 @@ def process_is_running(pid, unknown_value=True): if __name__ == '__main__': EXE_PATH = get_lldb_server_exe() if EXE_PATH: - print "lldb-server path detected: {}".format(EXE_PATH) + print("lldb-server path detected: {}".format(EXE_PATH)) else: - print "lldb-server could not be found" + print("lldb-server could not be found") diff --git a/lldb/test/tools/lldb-server/socket_packet_pump.py b/lldb/test/tools/lldb-server/socket_packet_pump.py index 780ff09b7c5..a6f42edb398 100644 --- a/lldb/test/tools/lldb-server/socket_packet_pump.py +++ b/lldb/test/tools/lldb-server/socket_packet_pump.py @@ -1,4 +1,6 @@ +from __future__ import print_function + import lldb_shared import re @@ -21,8 +23,8 @@ def _handle_output_packet_string(packet_contents): def _dump_queue(the_queue): while not the_queue.empty(): - print codecs.encode(the_queue.get(True), "string_escape") - print "\n" + print(codecs.encode(the_queue.get(True), "string_escape")) + print("\n") class SocketPacketPump(object): """A threaded packet reader that partitions packets into two streams. @@ -67,15 +69,15 @@ class SocketPacketPump(object): # Warn if there is any content left in any of the queues. # That would represent unmatched packets. if not self.output_queue().empty(): - print "warning: output queue entries still exist:" + print("warning: output queue entries still exist:") _dump_queue(self.output_queue()) - print "from here:" + print("from here:") traceback.print_stack() if not self.packet_queue().empty(): - print "warning: packet queue entries still exist:" + print("warning: packet queue entries still exist:") _dump_queue(self.packet_queue()) - print "from here:" + print("from here:") traceback.print_stack() def start_pump_thread(self): diff --git a/lldb/test/tools/lldb-server/test/test_lldbgdbserverutils.py b/lldb/test/tools/lldb-server/test/test_lldbgdbserverutils.py index f5b4ba35a9a..29c2f549cf4 100644 --- a/lldb/test/tools/lldb-server/test/test_lldbgdbserverutils.py +++ b/lldb/test/tools/lldb-server/test/test_lldbgdbserverutils.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/types/AbstractBase.py b/lldb/test/types/AbstractBase.py index a4dc1a86004..7b78fd7561b 100644 --- a/lldb/test/types/AbstractBase.py +++ b/lldb/test/types/AbstractBase.py @@ -2,6 +2,8 @@ Abstract base class of basic types provides a generic type tester method. """ +from __future__ import print_function + import os, time import re import lldb @@ -33,7 +35,7 @@ class GenericTester(TestBase): def tearDown(self): """Cleanup the test byproducts.""" - #print "Removing golden-output.txt..." + #print("Removing golden-output.txt...") if os.path.exists(self.golden_filename): os.remove(self.golden_filename) TestBase.tearDown(self) @@ -117,7 +119,7 @@ class GenericTester(TestBase): if match: var, val = match.group(1), match.group(2) gl.append((var, val)) - #print "golden list:", gl + #print("golden list:", gl) # This test uses a #include of "basic_type.cpp" so we need to enable # always setting inlined breakpoints. @@ -201,7 +203,7 @@ class GenericTester(TestBase): if match: var, val = match.group(1), match.group(2) gl.append((var, val)) - #print "golden list:", gl + #print("golden list:", gl) # This test uses a #include of "basic_type.cpp" so we need to enable # always setting inlined breakpoints. diff --git a/lldb/test/types/HideTestFailures.py b/lldb/test/types/HideTestFailures.py index 1c2e6ca8108..e08172da537 100644 --- a/lldb/test/types/HideTestFailures.py +++ b/lldb/test/types/HideTestFailures.py @@ -2,6 +2,8 @@ Test that variables of integer basic types are displayed correctly. """ +from __future__ import print_function + import lldb_shared import AbstractBase diff --git a/lldb/test/types/TestFloatTypes.py b/lldb/test/types/TestFloatTypes.py index fcac507701d..6b519c18b37 100644 --- a/lldb/test/types/TestFloatTypes.py +++ b/lldb/test/types/TestFloatTypes.py @@ -2,6 +2,8 @@ Test that variables of floating point types are displayed correctly. """ +from __future__ import print_function + import lldb_shared import AbstractBase diff --git a/lldb/test/types/TestFloatTypesExpr.py b/lldb/test/types/TestFloatTypesExpr.py index 52ba347c075..5d74b42b471 100644 --- a/lldb/test/types/TestFloatTypesExpr.py +++ b/lldb/test/types/TestFloatTypesExpr.py @@ -2,6 +2,8 @@ Test that variable expressions of floating point types are evaluated correctly. """ +from __future__ import print_function + import lldb_shared import AbstractBase diff --git a/lldb/test/types/TestIntegerTypes.py b/lldb/test/types/TestIntegerTypes.py index d592f39d0e0..bb26e88e8c2 100644 --- a/lldb/test/types/TestIntegerTypes.py +++ b/lldb/test/types/TestIntegerTypes.py @@ -2,6 +2,8 @@ Test that variables of integer basic types are displayed correctly. """ +from __future__ import print_function + import lldb_shared import AbstractBase diff --git a/lldb/test/types/TestIntegerTypesExpr.py b/lldb/test/types/TestIntegerTypesExpr.py index a252ca816ff..5feb34de666 100644 --- a/lldb/test/types/TestIntegerTypesExpr.py +++ b/lldb/test/types/TestIntegerTypesExpr.py @@ -2,6 +2,8 @@ Test that variable expressions of integer basic types are evaluated correctly. """ +from __future__ import print_function + import lldb_shared import AbstractBase diff --git a/lldb/test/types/TestRecursiveTypes.py b/lldb/test/types/TestRecursiveTypes.py index f115c9bcc42..34846ba4250 100644 --- a/lldb/test/types/TestRecursiveTypes.py +++ b/lldb/test/types/TestRecursiveTypes.py @@ -2,6 +2,8 @@ Test that recursive types are handled correctly. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/warnings/uuid/TestAddDsymCommand.py b/lldb/test/warnings/uuid/TestAddDsymCommand.py index 7ea233ac924..b474b60ca90 100644 --- a/lldb/test/warnings/uuid/TestAddDsymCommand.py +++ b/lldb/test/warnings/uuid/TestAddDsymCommand.py @@ -1,5 +1,7 @@ """Test that the 'add-dsym', aka 'target symbols add', command informs the user about success or failure.""" +from __future__ import print_function + import lldb_shared import os, time |