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
diff --git a/lldb/test/android/platform/TestDefaultCacheLineSize.py b/lldb/test/android/platform/TestDefaultCacheLineSize.py
index 2cc209b..d559dab 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 95f4bc9..3ba97e8 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 @@
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 d25ee10..143ea43 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 @@
# 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 2731a49..9ac25df 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 @@
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 ec37760..f4427cf 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 @@
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 3f05fbe..34a6ed1 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 @@
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 @@
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 @@
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 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 83674c6..8599124 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 @@
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 b514819..522be3a 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 @@
@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 @@
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 @@
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 a93a406..c8a28b8 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 @@
@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 @@
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 @@
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 393119e..913f9c0 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 @@
@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 @@
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 aa7b03f..b6c9d91 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 @@
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 9efbec6..f2c26b1 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 @@
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 @@
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 @@
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 ff55ecd..67d48f0 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 @@
@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 b921906..217e98d 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 @@
@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 71017eb..3fbc787 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 @@
@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 553933f..3fa01ae 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 @@
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 c359ab2..a1342bd 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 @@
@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 89d28dd..f2a60c6 100644
--- a/lldb/test/curses_results.py
+++ b/lldb/test/curses_results.py
@@ -130,7 +130,7 @@
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 d1ce34b..dcd4c79 100755
--- a/lldb/test/dotest.py
+++ b/lldb/test/dotest.py
@@ -902,7 +902,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
# 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 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 6b6f0be..111e628 100644
--- a/lldb/test/dotest_channels.py
+++ b/lldb/test/dotest_channels.py
@@ -14,6 +14,8 @@
framework.
"""
+from __future__ import print_function
+
import lldb_shared
import asyncore
@@ -121,7 +123,7 @@
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 @@
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 @@
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 bd0f3fa..f88591a 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 736af5b..ef04bdb 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 10a4c21..cc66dd0 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 c9a1db2..f851779 100644
--- a/lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py
+++ b/lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py
@@ -7,6 +7,8 @@
"""
+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 f5480c2..e3d368c 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 e5ac994..85774cd 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 c574518..0e6478a 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 4d1ba4b..83c98af 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 a86961a..c8bb284 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 d1793c3..53b7fc9 100644
--- a/lldb/test/expression_command/issue_11588/Test11588.py
+++ b/lldb/test/expression_command/issue_11588/Test11588.py
@@ -4,6 +4,8 @@
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 18394ef..846f676 100644
--- a/lldb/test/expression_command/options/TestExprOptions.py
+++ b/lldb/test/expression_command/options/TestExprOptions.py
@@ -7,6 +7,8 @@
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 a179205..b11ea8a 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 312d9de..4c10e2a 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 4fd3483..7e474c8 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 0ced770..3ed0384 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 3a10a98..c6f270f 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 829b35d..9603bb5 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 2cff7fe..a8ba021 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 31d120f..41e3cf8 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 c412bce..8538bb3 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 12bdfa2..8851733 100644
--- a/lldb/test/expression_command/test/TestExprs.py
+++ b/lldb/test/expression_command/test/TestExprs.py
@@ -11,6 +11,8 @@
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 a2dd98c..b835c08 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 e63cebe..59a1be6 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 93c8218..6edf8be 100644
--- a/lldb/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
+++ b/lldb/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
@@ -4,6 +4,8 @@
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 86268bb..3a089a2 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 @@
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 d184edc..3772e63 100644
--- a/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py
+++ b/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py
@@ -3,6 +3,8 @@
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 9246c5e..a2071d3 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 d9334d5..a0d8533 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 19e0b61..462fc01 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 0a5e7f2..5565ad6 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 abceb6a..27ec682 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 d2a6e5c..18c03f9 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 660f463..051063b 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 @@
# 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 @@
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 @@
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 0058bff..f9eb809 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 @@
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 @@
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 2e2eac9..afc9f91 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 3018664..4bbb032 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 2c30904..d69637e 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 @@
# 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 effd1ef..3fe89f3 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 690d35d..c012bb2 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 e992df3..3f9a630 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 a2545ad..3e03a40 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 809a794..c290bcb 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 103b38c..e4ef515 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 fb27df1..febd619 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 @@
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 e01bdb4..7db7389 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 da62c9d..65e7f1d 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 d12b39d..73014c0 100644
--- a/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
+++ b/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
@@ -3,6 +3,8 @@
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 b61132d..5cb9123 100644
--- a/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
+++ b/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
@@ -3,6 +3,8 @@
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 3022433..bb7d78f 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 5400b54..128473a 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 b8a8916..ba47ed8 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 f413bdc..9a6937b 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 28a4488..bbc41f3 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 212fea32..659ded2 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 f528e98..51cc0c3 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 44e39cb..6863454 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 4b19386..b5209d4a 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 7191914..656cd15 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 @@
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 c6d4ddc..5dbf09f 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 @@
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 @@
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 @@
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 22f8ff7..31862ac 100644
--- a/lldb/test/functionalities/command_source/TestCommandSource.py
+++ b/lldb/test/functionalities/command_source/TestCommandSource.py
@@ -4,6 +4,8 @@
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 86ce502..cb2fd01 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 f2c5302..097c9f5 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 @@
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 f077bcd..b51393f 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 @@
# 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 @@
# 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 @@
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 ed73ccc..0d97a40 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 9fd66a0..64c09e1 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 f645feb..0cf33ef 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 a367e39..791cc26 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 f2911ec..4414636 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 7be7276..cb1163a 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 e004e59..0e6a58a 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 d81891c..7310f85 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 516c54e..3ef22da 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 c7ee9f6..1a4a7f3 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 2778035..0600861 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 30d1323..957c8db 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 84cb74b..1347c43 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 39e363a..771e87c 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 @@
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 @@
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 b025ba0..41d080d 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 03e713e..327a121 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 @@
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 bb0e4e5..2ced549 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 af74308..6626539 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 03bbf3c..6ef5149 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 af70599..226cfb9 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 1681e32..1ff25a1 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 @@
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 b5ce17d..5ea67b2 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 30a3a3f..231ff85 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 9c82d02..c341ce0 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 27d72ab..2c1b90b 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 4e59e05..0cb33b9 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 b24c911..e307af7 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 e4e65ed..057a8f6 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 086972d..ac5518a 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 08a89d8..ec31cd7 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 5f8468b..65d09e0 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 89be957..0f1fde4 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 7f07187..3a6145b 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 71434ef..0aba73f 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 30ded55..22128e1 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 f6bdacc..694ebbe 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 418083d..71296ec 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 @@
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 @@
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 471086b..063fe38 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 ad5ee5a..5726b3f 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 909c00f..77836ee 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 3084603..a0154a4 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 54442f2..b9afb60 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 41f7049..c5700a4 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 b044fc7..1fe3a60 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 88e345c..ef94172 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 0869ea9..ebb3474 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 4b0ed73..08aaea4 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 a4f50cb..f60fd4b 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 80224cc..794fd76 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 8842896..c79cec3 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 55c6c30..cb3927b 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 4de0325..c4ce58d6 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 6235e61..b69fe2e 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 @@
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 e614761..61e181c 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 e9ddf12..006832d 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 67c4d97..6b31ebc 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 c07628b..542748e 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 @@
# 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 7b6ce97..f7a5191 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 @@
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 89d7f72..377c7e7 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 @@
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 f6d0694..40b8f25 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 @@
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 84566ea..d4123ef 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 37e88c7..b307aba 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 @@
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 9fce54c..7caa6cc 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 cd4ba30..ee41cd5 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 61eea6e..53ca4ff 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 b0d620e..aa9fcae 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 5b8b11d..8ed08fc 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 609a1b9..90e40ce 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 7122cdc..7f67fb5 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 @@
# 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 @@
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 8cb51e6..b7294ed 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 c6430aa..9fbb56f 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 7835a37..3e1f21c 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 bf29645..9e5bd71 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 54c1d21..ea851c7 100644
--- a/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ b/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -4,6 +4,8 @@
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 3576920..3376fab 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 9790826..c049356 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 4053fe3..50146c9 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 @@
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 @@
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 749916f..a1d6176 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 bbacc19..379b27b 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 ed11a48..023da13 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 74013fa..bc0b850 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 @@
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 6864c47..c31d817 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 @@
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 50e219f..75b3a25 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 @@
# 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 fa90004..778d880 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 @@
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 efdbaaf..b77ade7 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 @@
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 @@
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 7d5972b..63b92c9 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 9f7c07a..9ced268 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 f260bbd..c8b388f 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 71b96b7..0e3c10b 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 70b8cf2..b938003 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 6705bfd..8a976b6 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 @@
# 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 @@
# 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 17af6cb..111940e 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 @@
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 3585b2f..3427ec1 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 9158412..916faee 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 211c3f9..cba672e 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 @@
# 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 49da3fa..a929ac6 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 28dcd1c..bf1d185 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 @@
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 8a2ad59..4ba3ed5 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 462314b..3ea2b5c 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 3fa1b49..af86dbf 100644
--- a/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
+++ b/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
@@ -10,6 +10,8 @@
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 89eccfd..81b3beb 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 d91f8d5..344483b 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 a5ceae3..cee2735 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 dc1d4dc..760b950 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 30ca8fe..1f764af 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 a9b0686..4a55aff 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 3afd6a2..59fa081 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 06225f1..0a434bf 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 3100b36..aa5d09e 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 3979765..facf1aa 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 0c2c884..ab68309 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 79cc264..8706a46 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 5795218..f5e6e94 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 @@
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 @@
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 4e27a02..26e56c9 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 2d557f1..7b0fa13 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 @@
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 fe375b4..a4d25fa 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 @@
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 58f7db0..bba6a71 100644
--- a/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py
+++ b/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py
@@ -10,6 +10,8 @@
after escaping some special characters).
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
@@ -84,9 +86,9 @@
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 @@
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 9a51c58..01914a3 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 d784faa..da48757 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 ee92815..cfdcd72 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 024791a..48e5e98 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 @@
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 3401976..d64924e 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 b216136..681d420 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 cfa6a10..24808f3 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 a7b9d4c..f89f76b 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 6bd8b93..1960c76 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 5b66e65..919a8a4 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 821062d..6483f87 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 @@
# 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 2a340da..a594bbd 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 cdfd435..7763e78 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 f7e7bcf..b6f8091 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 2c665e1..b25666c 100644
--- a/lldb/test/help/TestHelp.py
+++ b/lldb/test/help/TestHelp.py
@@ -4,6 +4,8 @@
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 1899384..3f79233 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 98e839c..85b4ede 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 024af2d..5f53437 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 783401e..5ad48ec 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 30fc91a..2f3a763 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 6f1c52d..a8af960 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 6db0b30..430f20b 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 fb46ea8..ab5d1bc 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 7d9c0dd..92f2526 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 5875c77..c35a687 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 a73bc26..343dcc8 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 ae70f77..c568517 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 dd09527..0d47806 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 611a361..e4dac28 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 ed50926..170a02b 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 e02551b..db8a726 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 305ff39..0959154 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 5c2882b..fc8a5a6 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 867bfed..72c01ad 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 7392f79..0e55bab 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 c9182fe..ba770af 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 6d737e0..9a46f5d 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 031c2b3..f9e0f5f 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 @@
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 @@
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 @@
# 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 f46bad7..4d620a9 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 @@
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 @@
# 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 @@
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 @@
# 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 3ef4193..7095e42 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 c0fb310..a31519f 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 51135c7..babe4f2 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 08825c4..40f1298 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 4ac48e1..df1b5ac 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 8ae2e22..5bac76e 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 f221a1a..aaf16d3 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 e326526..66a8dce 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 dad5bf2..1ffb765 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 @@
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 a1c9f25..9ac570e 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 a2c8ff7..9154cc6 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 0904cfc..6863c07 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 @@
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 d2b3ab9..70cc028 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 6c26a3a..a5726c4 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 457b6d3..2f52563 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 @@
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 1fbf118..e791686 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 a629dcf..5e9d55a 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 @@
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 6c2f109..49c2995 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 772f5d7..11726c9 100644
--- a/lldb/test/lang/objc/foundation/TestConstStrings.py
+++ b/lldb/test/lang/objc/foundation/TestConstStrings.py
@@ -3,6 +3,8 @@
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 cd03e76..6488b98 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 @@
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 @@
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 @@
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 1417d01..ee5fab5 100644
--- a/lldb/test/lang/objc/foundation/TestObjCMethods.py
+++ b/lldb/test/lang/objc/foundation/TestObjCMethods.py
@@ -3,6 +3,8 @@
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 @@
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 9c6ce04..ccc93ca 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 6dd9b90..f0b1d0d 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 @@
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 @@
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 a302fcc..357346b 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 3b1d820..378147e 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 @@
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 a36ba61..5b06ea2 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 2ccd8bc..a0c208b 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 @@
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 a836cda..c00d0d1 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 0db2a11..12d4e37 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 b322cf0..22d0909 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 aa3351a..f8ed11a 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 2c5b320..b553035 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 da4b146..d7cdda1 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 eeedc9b..95a54144 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 15820b6..b3c4443 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 70cb513..a22a2c0 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 9e4a7e2..f6a7b74 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 bd0bbea..7c2b7dc 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 26e09da..c53d84c 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 dd4620f..de529e8 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 66dc4d5..afdbc61 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 a2769e2..28712b9 100644
--- a/lldb/test/lang/objc/objc-optimized/TestObjcOptimized.py
+++ b/lldb/test/lang/objc/objc-optimized/TestObjcOptimized.py
@@ -7,6 +7,8 @@
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 f21ab34..0806776 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 a071987..6d230f2 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 443c4c5..290d29e 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 015992c..2f51a9a 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 @@
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 @@
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 be6e87b..1b4388f 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 d6fafd7..6045568 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 4aba9e9..051cb25 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 b1205cf..440f0c4 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 @@
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 @@
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 726ec82..dd8e967 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 be9b6cf..1b087c6 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 3523695..b36b82f 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 54fa80c..81ec1a8 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 04e4986..8a87e09 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 3f7641b..635aa85 100644
--- a/lldb/test/linux/builtin_trap/TestBuiltinTrap.py
+++ b/lldb/test/linux/builtin_trap/TestBuiltinTrap.py
@@ -3,6 +3,8 @@
'__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 8bcf39e..fdc9b1e 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 @@
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 9048541..0f0351c 100644
--- a/lldb/test/lldbcurses.py
+++ b/lldb/test/lldbcurses.py
@@ -115,22 +115,22 @@
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 f25534e..6110b32 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 29404a8..b8e29a7 100644
--- a/lldb/test/lldbtest.py
+++ b/lldb/test/lldbtest.py
@@ -1584,7 +1584,7 @@
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 8c23637..c824990 100644
--- a/lldb/test/lldbutil.py
+++ b/lldb/test/lldbutil.py
@@ -796,7 +796,7 @@
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 @@
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 @@
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 @@
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 ae8398f..346b660 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 5dae2a0..e5d4202 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 6e739f5..bd25db6 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 @@
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 7f1fabc..3985358 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 b0d9fd9..fee48e0 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 82149e3..77b1b6b 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 6e77790..e0e7b74 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 9628c53..efe49a1 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 ac5d8aa..3e69995 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 9c29e6c..245c142 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 @@
# 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 90e79dc..6ead0af 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 e7b141e..fb8961d 100644
--- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
+++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
@@ -11,6 +11,8 @@
after default construction.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
@@ -27,7 +29,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
"""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 @@
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 @@
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 @@
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 @@
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 @@
# 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 @@
# 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
"""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 @@
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 @@
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 @@
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 @@
"""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 @@
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 @@
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 @@
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 @@
"""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 @@
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 @@
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 @@
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 e16c6f0..a6a1657 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 @@
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 d25dabc..6e326b8 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 @@
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 @@
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 f2d5257..6fcb67f 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 @@
# 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 @@
# 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 @@
# 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 @@
# 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 @@
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 @@
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 @@
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 c5bdcb8..6a3be36 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 b6d693f..7f3075f 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 @@
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 b13edd0..d8cccc6 100644
--- a/lldb/test/python_api/frame/TestFrames.py
+++ b/lldb/test/python_api/frame/TestFrames.py
@@ -3,6 +3,8 @@
And other SBFrame API tests.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
@@ -27,7 +29,7 @@
# 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 @@
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 @@
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 @@
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 @@
# 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 @@
# 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 @@
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 @@
# 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 @@
frameEntered = thread.GetFrameAtIndex(0)
if self.TraceOn():
- print frameEntered
+ print(frameEntered)
lldbutil.print_stacktrace(thread)
self.assertTrue(frameEntered)
@@ -182,7 +184,7 @@
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 @@
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 e5e5391..1fc8606 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 @@
# 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 @@
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 @@
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 4018b52..7f0dce1 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 @@
# 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 @@
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 @@
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 1d7a428..bb0a78a 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 @@
# 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 @@
# 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 1800dd0..5e8343e 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 1f5171d..74baf11 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 @@
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 2812136..90ceed2 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 @@
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 c8ee37c..c8ab813 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 @@
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 @@
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 @@
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 0a49bc2..43b5d9d 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 @@
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 7319ce3..859cbdc 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 d1a69f9..c89ff22 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 @@
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 @@
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 @@
# 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 @@
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 ed34d43..d856463 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 15a70d1..e75b78c 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
# 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 @@
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 @@
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 1fce478..162003f 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 @@
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 @@
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 @@
# 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 1880dc2..5122a14 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 beb9fd5..1e8f0e3 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 @@
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 @@
data = star_foobar.GetData()
if self.TraceOn():
- print data
+ print(data)
offset = 0
self.assert_data(data.GetUnsignedInt32, offset, 1)
@@ -114,12 +116,12 @@
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 @@
data = new_foobar.GetData()
if self.TraceOn():
- print data
+ print(data)
offset = 0
self.assert_data(data.GetUnsignedInt32, offset, 8)
@@ -155,10 +157,10 @@
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 @@
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 @@
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 eca6f41..903eb8b 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 7a6bc3ac..8d7aef4 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 7bea793..8ddbdf3 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 5bca394..01509a9 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 @@
# 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 @@
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 e61d82d..eadae1d 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 @@
# 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 @@
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 2fea893..4d8e9b4 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 @@
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 @@
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 4be01a2..27683c1 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 @@
# 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 e6d8825..2681350 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 @@
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 0b326b9..452cc63 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 8270ed8..4c3a9b0 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 @@
supports iteration till the end of list is reached.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
@@ -63,12 +65,12 @@
# 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 @@
# 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 @@
# 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 @@
# 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 9c0123e..87e0ccd 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 242b199..5554ff0 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 @@
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 f8ae2a2..95dad36 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 @@
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 @@
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 0ba73c0..4ce2c0d 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 @@
# 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 @@
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 dd7c799..582e60e 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 @@
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 51a8955..3ce2445 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 @@
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 d6a3ca6..884989f 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 @@
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 65dcaa8..e4eba8b2 100755
--- a/lldb/test/redo.py
+++ b/lldb/test/redo.py
@@ -90,7 +90,7 @@
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 @@
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 a20a903..c48ef7b 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 7ef861d..1c1bb8f 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 ea6499e..9beaace 100644
--- a/lldb/test/source-manager/TestSourceManager.py
+++ b/lldb/test/source-manager/TestSourceManager.py
@@ -9,6 +9,8 @@
Test the caching mechanism of the source manager.
"""
+from __future__ import print_function
+
import lldb_shared
import lldb
@@ -135,24 +137,24 @@
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 @@
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 49e91cf..f477577 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 @@
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 e42496f..f35d34c 100644
--- a/lldb/test/test_results.py
+++ b/lldb/test/test_results.py
@@ -8,6 +8,8 @@
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 925ad6d..4207bac 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 @@
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 @@
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 3d0463d..2df106f 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 01f9dc6..f73ed26 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 45aff71..341ff8e 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 8413986..03a3f34 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 6f4bb76..63eae64 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 c08e92e..f482f5a 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 a17fd66..8b54ec7 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 42efeed..d6e440a 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 b28c055..6a4a6e8 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 86eb8ff..45151ef 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 e29864a..82c49ba 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 @@
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 22f05c3..90cea88 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 f4ebf30..34dceb4 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 8f34119..6137b5c 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 6b0fe28..47e4ace 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 96ff107..b3a501c 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 0166c8d..66b2c78 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 177ddae..59cb66d 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 d1d3bdc..093b85c 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 33a6832..0980b45 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 797814b..b0e1e3f 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 782a3d7..a552536 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 @@
# 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 @@
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 9218dbf..f43b4a1 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 @@
# 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 f4de5a0..2bfe3df 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 3ef299e..baeb3af 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 f2d44cad..7bc328e 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 @@
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 @@
(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 @@
# 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 98ea7df..355f0cb 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 ab4f457..70548575 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 d8abdfc..cf1099d 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 370d945..48189b3 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 9d8f418..a314f16 100644
--- a/lldb/test/tools/lldb-server/TestLldbGdbServer.py
+++ b/lldb/test/tools/lldb-server/TestLldbGdbServer.py
@@ -10,6 +10,8 @@
the initial set of tests implemented.
"""
+from __future__ import print_function
+
import lldb_shared
import unittest2
@@ -1343,7 +1345,7 @@
# 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 34850c7..f37da8f 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 @@
(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 401206b..23dda36 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 91f36c0..22e0bc8 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 @@
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 @@
# 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 @@
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 @@
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 @@
# 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 e07fe8b..b8a970a 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 0c0bef4..2fb609c 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 1d4f40d..eb38891 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 @@
# 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 @@
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 780ff09..a6f42ed 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 _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 @@
# 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 f5b4ba3..29c2f54 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 a4dc1a8..7b78fd7 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 @@
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 @@
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 @@
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 1c2e6ca..e08172d 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 fcac507..6b519c1 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 52ba347..5d74b42 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 d592f39..bb26e88 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 a252ca8..5feb34d 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 f115c9b..34846ba 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 7ea233a..b474b60 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