diff options
Diffstat (limited to 'lldb/test/functionalities')
170 files changed, 427 insertions, 88 deletions
diff --git a/lldb/test/functionalities/abbreviation/TestAbbreviations.py b/lldb/test/functionalities/abbreviation/TestAbbreviations.py index 86268bba1a2..3a089a23c2e 100644 --- a/lldb/test/functionalities/abbreviation/TestAbbreviations.py +++ b/lldb/test/functionalities/abbreviation/TestAbbreviations.py @@ -2,6 +2,8 @@ Test some lldb command abbreviations and aliases for proper resolution. """ +from __future__ import print_function + import lldb_shared import os, time @@ -79,9 +81,9 @@ class AbbreviationsTestCase(TestBase): self.assertFalse(result.Succeeded()) # Check a command that wants the raw input. - command_interpreter.ResolveCommand(r'''sc print "\n\n\tHello!\n"''', result) + command_interpreter.ResolveCommand(r'''sc print("\n\n\tHello!\n")''', result) self.assertTrue(result.Succeeded()) - self.assertEqual(r'''script print "\n\n\tHello!\n"''', result.GetOutput()) + self.assertEqual(r'''script print("\n\n\tHello!\n")''', result.GetOutput()) # Prompt changing stuff should be tested, but this doesn't seem like the # right test to do it in. It has nothing to do with aliases or abbreviations. diff --git a/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py b/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py index d184edc6572..3772e63d085 100644 --- a/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py +++ b/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py @@ -3,6 +3,8 @@ Test some lldb command abbreviations to make sure the common short spellings of many commands remain available even after we add/delete commands in the future. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/archives/TestBSDArchives.py b/lldb/test/functionalities/archives/TestBSDArchives.py index 9246c5eaf58..a2071d3bad4 100644 --- a/lldb/test/functionalities/archives/TestBSDArchives.py +++ b/lldb/test/functionalities/archives/TestBSDArchives.py @@ -1,5 +1,7 @@ """Test breaking inside functions defined within a BSD archive file libfoo.a.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/asan/TestMemoryHistory.py b/lldb/test/functionalities/asan/TestMemoryHistory.py index d9334d5f2a2..a0d853345cc 100644 --- a/lldb/test/functionalities/asan/TestMemoryHistory.py +++ b/lldb/test/functionalities/asan/TestMemoryHistory.py @@ -2,6 +2,8 @@ Test that ASan memory history provider returns correct stack traces """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/asan/TestReportData.py b/lldb/test/functionalities/asan/TestReportData.py index 19e0b61498a..462fc015179 100644 --- a/lldb/test/functionalities/asan/TestReportData.py +++ b/lldb/test/functionalities/asan/TestReportData.py @@ -2,6 +2,8 @@ Test the AddressSanitizer runtime support for report breakpoint and data extraction. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/attach_resume/TestAttachResume.py b/lldb/test/functionalities/attach_resume/TestAttachResume.py index 0a5e7f20eab..5565ad60bd3 100644 --- a/lldb/test/functionalities/attach_resume/TestAttachResume.py +++ b/lldb/test/functionalities/attach_resume/TestAttachResume.py @@ -2,6 +2,8 @@ Test process attach/resume. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py b/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py index abceb6a3ca4..27ec6829aaf 100644 --- a/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py +++ b/lldb/test/functionalities/avoids-fd-leak/TestFdLeak.py @@ -2,6 +2,8 @@ Test whether a process started by lldb has no extra file descriptors open. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py b/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py index d2a6e5ce87e..18c03f9725c 100644 --- a/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py +++ b/lldb/test/functionalities/backticks/TestBackticksWithoutATarget.py @@ -2,6 +2,8 @@ Test that backticks without a target should work (not infinite looping). """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py index 660f463ee90..051063bf4ec 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py @@ -2,6 +2,8 @@ Test lldb breakpoint command add/list/delete. """ +from __future__ import print_function + import lldb_shared import os, time @@ -50,7 +52,7 @@ class BreakpointCommandTestCase(TestBase): # Now add callbacks for the breakpoints just created. self.runCmd("breakpoint command add -s command -o 'frame variable --show-types --scope' 1 4") - self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print >> here, \"lldb\"; here.close()' 2") + self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print(\"lldb\", file=here); here.close()' 2") self.runCmd("breakpoint command add --python-function bktptcmd.function 3") # Check that the breakpoint commands are correctly set. @@ -72,7 +74,7 @@ class BreakpointCommandTestCase(TestBase): self.expect("breakpoint command list 2", "Breakpoint 2 command ok", substrs = ["Breakpoint commands:", "here = open", - "print >> here", + "print(file=here)", "here.close()"]) self.expect("breakpoint command list 3", "Breakpoint 3 command ok", substrs = ["Breakpoint commands:", @@ -176,7 +178,7 @@ class BreakpointCommandTestCase(TestBase): lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True) # Now add callbacks for the breakpoints just created. - self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print >> here, frame; print >> here, bp_loc; here.close()' 1") + self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print(frame, file=here); print(bp_loc, file=here); here.close()' 1") # Remove 'output-2.txt' if it already exists. diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py index 0058bff9d80..f9eb809ec80 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py @@ -2,6 +2,8 @@ Test that you can set breakpoint commands successfully with the Python API's: """ +from __future__ import print_function + import lldb_shared import os @@ -49,7 +51,7 @@ class PythonBreakpointCommandSettingTestCase(TestBase): got_one_in_B = False for idx in range(0, num_locations): comp_unit = no_files_bkpt.GetLocationAtIndex(idx).GetAddress().GetSymbolContext(lldb.eSymbolContextCompUnit).GetCompileUnit().GetFileSpec() - print "Got comp unit: ", comp_unit.GetFilename() + print("Got comp unit: ", comp_unit.GetFilename()) if comp_unit.GetFilename() == "a.c": got_one_in_A = True elif comp_unit.GetFilename() == "b.c": @@ -64,7 +66,7 @@ class PythonBreakpointCommandSettingTestCase(TestBase): error = body_bkpt.SetScriptCallbackBody("\ import TestBreakpointCommandsFromPython\n\ TestBreakpointCommandsFromPython.PythonBreakpointCommandSettingTestCase.my_var = 20\n\ -print 'Hit breakpoint'") +print('Hit breakpoint')") self.assertTrue (error.Success(), "Failed to set the script callback body: %s."%(error.GetCString())) self.dbg.HandleCommand("command script import --allow-reload ./bktptcmd.py") diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py b/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py index 2e2eac98aa4..afc9f91eb30 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py @@ -2,6 +2,8 @@ Test _regexp-break command which uses regular expression matching to dispatch to other built in breakpoint commands. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py b/lldb/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py index 30186641c64..4bbb0327eac 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py @@ -1,4 +1,6 @@ +from __future__ import print_function + def function(frame, bp_loc, dict): there = open("output2.txt", "w"); - print >> there, "lldb"; + print("lldb", file=there) there.close() diff --git a/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py index 2c3090436e3..d69637e90e3 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py @@ -2,6 +2,8 @@ Test breakpoint conditions with 'breakpoint modify -c <expr> id'. """ +from __future__ import print_function + import lldb_shared import os, time @@ -126,7 +128,7 @@ class BreakpointConditionsTestCase(TestBase): # Now create a breakpoint on main.c by name 'c'. breakpoint = target.BreakpointCreateByName('c', 'a.out') - #print "breakpoint:", breakpoint + #print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) diff --git a/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py b/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py index effd1ef2231..3fe89f32813 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py @@ -2,6 +2,8 @@ Test lldb breakpoint ids. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py b/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py index 690d35da424..c012bb2234d 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py @@ -2,6 +2,8 @@ Test breakpoint ignore count features. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py b/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py index e992df3dcd5..3f9a630945e 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py @@ -2,6 +2,8 @@ Test breakpoint commands for a breakpoint ID with multiple locations. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py b/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py index a2545adebb5..3e03a40e46b 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py @@ -2,6 +2,8 @@ Test breakpoint command for different options. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py b/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py index 809a7944503..c290bcb785b 100644 --- a/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py +++ b/lldb/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py @@ -1,6 +1,8 @@ """ Test breakpoint command with AT_comp_dir set to symbolic link. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py b/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py index 103b38c7624..e4ef5154a48 100644 --- a/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py +++ b/lldb/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py @@ -2,6 +2,8 @@ Test continue from a breakpoint when there is a breakpoint on the next instruction also. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py b/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py index fb27df1a11a..febd6190d86 100644 --- a/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py +++ b/lldb/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py @@ -2,6 +2,8 @@ Test lldb breakpoint ids. """ +from __future__ import print_function + import lldb_shared import os, time @@ -32,7 +34,7 @@ class TestCPPBreakpointLocations(TestBase): for name in names: found = name in bp_loc_names if not found: - print "Didn't find '%s' in: %s" % (name, bp_loc_names) + print("Didn't find '%s' in: %s" % (name, bp_loc_names)) self.assertTrue (found, "Make sure we find all required locations") def breakpoint_id_tests (self): diff --git a/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py b/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py index e01bdb4828d..7db738969c2 100644 --- a/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py +++ b/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py @@ -2,6 +2,8 @@ Test that you can set breakpoint and hit the C++ language exception breakpoint """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py b/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py index da62c9dc754..65e7f1d50e4 100644 --- a/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py +++ b/lldb/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py @@ -2,6 +2,8 @@ Test breakpoint commands set before we have a target """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py b/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py index d12b39d1cb7..73014c026ac 100644 --- a/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py +++ b/lldb/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py @@ -3,6 +3,8 @@ Test that inlined breakpoints (breakpoint set on a file/line included from another source file) works correctly. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py b/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py index b61132d5e32..5cb91239925 100644 --- a/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py +++ b/lldb/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py @@ -3,6 +3,8 @@ Test that objective-c constant strings are generated correctly by the expression parser. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/command_history/TestCommandHistory.py b/lldb/test/functionalities/command_history/TestCommandHistory.py index 3022433a594..bb7d78fb4ac 100644 --- a/lldb/test/functionalities/command_history/TestCommandHistory.py +++ b/lldb/test/functionalities/command_history/TestCommandHistory.py @@ -2,6 +2,8 @@ Test the command history mechanism """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/command_regex/TestCommandRegex.py b/lldb/test/functionalities/command_regex/TestCommandRegex.py index 5400b547fce..128473a36bd 100644 --- a/lldb/test/functionalities/command_regex/TestCommandRegex.py +++ b/lldb/test/functionalities/command_regex/TestCommandRegex.py @@ -2,6 +2,8 @@ Test lldb 'commands regex' command which allows the user to create a regular expression command. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/command_script/TestCommandScript.py b/lldb/test/functionalities/command_script/TestCommandScript.py index b8a891630c3..ba47ed8d959 100644 --- a/lldb/test/functionalities/command_script/TestCommandScript.py +++ b/lldb/test/functionalities/command_script/TestCommandScript.py @@ -2,6 +2,8 @@ Test lldb Python commands. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/command_script/import/TestImport.py b/lldb/test/functionalities/command_script/import/TestImport.py index f413bdc4baa..9a6937b99c3 100644 --- a/lldb/test/functionalities/command_script/import/TestImport.py +++ b/lldb/test/functionalities/command_script/import/TestImport.py @@ -1,5 +1,7 @@ """Test custom import command to import files by path.""" +from __future__ import print_function + import lldb_shared import os, sys, time diff --git a/lldb/test/functionalities/command_script/import/bar/bar.py b/lldb/test/functionalities/command_script/import/bar/bar.py index 28a4488fa70..bbc41f3b217 100644 --- a/lldb/test/functionalities/command_script/import/bar/bar.py +++ b/lldb/test/functionalities/command_script/import/bar/bar.py @@ -1,6 +1,8 @@ +from __future__ import print_function + def bar_function(debugger, args, result, dict): global UtilityModule - print >>result, (UtilityModule.barutil_function("bar told me " + args)) + print(UtilityModule.barutil_function("bar told me " + args), file=result) return None def __lldb_init_module(debugger, session_dict): diff --git a/lldb/test/functionalities/command_script/import/foo/bar/foobar.py b/lldb/test/functionalities/command_script/import/foo/bar/foobar.py index 212fea3251b..659ded22c90 100644 --- a/lldb/test/functionalities/command_script/import/foo/bar/foobar.py +++ b/lldb/test/functionalities/command_script/import/foo/bar/foobar.py @@ -1,3 +1,5 @@ +from __future__ import print_function + def foo_function(debugger, args, result, dict): - print >>result, ("foobar says " + args) + print("foobar says " + args, file=result) return None diff --git a/lldb/test/functionalities/command_script/import/foo/foo.py b/lldb/test/functionalities/command_script/import/foo/foo.py index f528e9846ad..51cc0c3bab1 100644 --- a/lldb/test/functionalities/command_script/import/foo/foo.py +++ b/lldb/test/functionalities/command_script/import/foo/foo.py @@ -1,3 +1,5 @@ +from __future__ import print_function + def foo_function(debugger, args, result, dict): - print >>result, ("foo says " + args) + print("foo says " + args, file=result) return None diff --git a/lldb/test/functionalities/command_script/import/foo/foo2.py b/lldb/test/functionalities/command_script/import/foo/foo2.py index 44e39cbac52..6863454ca6e 100644 --- a/lldb/test/functionalities/command_script/import/foo/foo2.py +++ b/lldb/test/functionalities/command_script/import/foo/foo2.py @@ -1,5 +1,7 @@ +from __future__ import print_function + def foo2_function(debugger, args, result, dict): - print >>result, ("foo2 says " + args) + print("foo2 says " + args, file=result) return None def __lldb_init_module(debugger, session_dict): diff --git a/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py b/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py index 4b19386379b..b5209d4a3a4 100644 --- a/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py +++ b/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py @@ -1,5 +1,7 @@ """Check that we handle an ImportError in a special way when command script importing files.""" +from __future__ import print_function + import lldb_shared import os, sys, time diff --git a/lldb/test/functionalities/command_script/mysto.py b/lldb/test/functionalities/command_script/mysto.py index 7191914731c..656cd150293 100644 --- a/lldb/test/functionalities/command_script/mysto.py +++ b/lldb/test/functionalities/command_script/mysto.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import lldb import sys import os @@ -8,11 +10,11 @@ def StepOver(debugger, args, result, dict): Step over a given number of times instead of only just once """ arg_split = args.split(" ") - print type(arg_split) + print(type(arg_split)) count = int(arg_split[0]) for i in range(0,count): debugger.GetSelectedTarget().GetProcess().GetSelectedThread().StepOver(lldb.eOnlyThisThread) - print "step<%d>"%i + print("step<%d>"%i) def __lldb_init_module(debugger, session_dict): # by default, --synchronicity is set to synchronous diff --git a/lldb/test/functionalities/command_script/welcome.py b/lldb/test/functionalities/command_script/welcome.py index c6d4ddcfd40..5dbf09fbbec 100644 --- a/lldb/test/functionalities/command_script/welcome.py +++ b/lldb/test/functionalities/command_script/welcome.py @@ -1,3 +1,4 @@ +from __future__ import print_function import lldb, sys class WelcomeCommand(object): @@ -8,7 +9,7 @@ class WelcomeCommand(object): return "Just a docstring for welcome_impl\nA command that says hello to LLDB users" def __call__(self, debugger, args, exe_ctx, result): - print >>result, ('Hello ' + args + ', welcome to LLDB'); + print('Hello ' + args + ', welcome to LLDB', file=result); return None; class TargetnameCommand(object): @@ -18,7 +19,7 @@ class TargetnameCommand(object): def __call__(self, debugger, args, exe_ctx, result): target = debugger.GetSelectedTarget() file = target.GetExecutable() - print >>result, ('Current target ' + file.GetFilename()) + print('Current target ' + file.GetFilename(), file=result) if args == 'fail': result.SetError('a test for error in command') @@ -27,19 +28,19 @@ class TargetnameCommand(object): def print_wait_impl(debugger, args, result, dict): result.SetImmediateOutputFile(sys.stdout) - print >>result, ('Trying to do long task..') + print('Trying to do long task..', file=result) import time time.sleep(1) - print >>result, ('Still doing long task..') + print('Still doing long task..', file=result) time.sleep(1) - print >>result, ('Done; if you saw the delays I am doing OK') + print('Done; if you saw the delays I am doing OK', file=result) def check_for_synchro(debugger, args, result, dict): if debugger.GetAsync() == True: - print >>result, ('I am running async') + print('I am running async', file=result) if debugger.GetAsync() == False: - print >>result, ('I am running sync') + print('I am running sync', file=result) def takes_exe_ctx(debugger, args, exe_ctx, result, dict): - print >>result, str(exe_ctx.GetTarget()) + print(str(exe_ctx.GetTarget()), file=result) diff --git a/lldb/test/functionalities/command_source/TestCommandSource.py b/lldb/test/functionalities/command_source/TestCommandSource.py index 22f8ff74798..31862ac9bf5 100644 --- a/lldb/test/functionalities/command_source/TestCommandSource.py +++ b/lldb/test/functionalities/command_source/TestCommandSource.py @@ -4,6 +4,8 @@ Test that lldb command "command source" works correctly. See also http://llvm.org/viewvc/llvm-project?view=rev&revision=109673. """ +from __future__ import print_function + import lldb_shared import os, sys diff --git a/lldb/test/functionalities/command_source/my.py b/lldb/test/functionalities/command_source/my.py index 86ce5026163..cb2fd012e4b 100644 --- a/lldb/test/functionalities/command_source/my.py +++ b/lldb/test/functionalities/command_source/my.py @@ -1,4 +1,6 @@ +from __future__ import print_function + def date(): import datetime today = datetime.date.today() - print today + print(today) diff --git a/lldb/test/functionalities/completion/TestCompletion.py b/lldb/test/functionalities/completion/TestCompletion.py index f2c5302a7d4..097c9f572f7 100644 --- a/lldb/test/functionalities/completion/TestCompletion.py +++ b/lldb/test/functionalities/completion/TestCompletion.py @@ -2,6 +2,8 @@ Test the lldb command line completion mechanism. """ +from __future__ import print_function + import lldb_shared import os @@ -301,13 +303,13 @@ class CommandLineCompletionTestCase(TestBase): with open('child_send.txt', 'r') as fs: if self.TraceOn(): - print "\n\nContents of child_send.txt:" - print fs.read() + print("\n\nContents of child_send.txt:") + print(fs.read()) with open('child_read.txt', 'r') as fr: from_child = fr.read() if self.TraceOn(): - print "\n\nContents of child_read.txt:" - print from_child + print("\n\nContents of child_read.txt:") + print(from_child) # The matching could be verbatim or using generic re pattern. for p in patterns: diff --git a/lldb/test/functionalities/conditional_break/TestConditionalBreak.py b/lldb/test/functionalities/conditional_break/TestConditionalBreak.py index f077bcdc919..b51393f5dd1 100644 --- a/lldb/test/functionalities/conditional_break/TestConditionalBreak.py +++ b/lldb/test/functionalities/conditional_break/TestConditionalBreak.py @@ -2,6 +2,8 @@ Test conditionally break on a function and inspect its variables. """ +from __future__ import print_function + import lldb_shared import os, time @@ -61,7 +63,7 @@ class ConditionalBreakTestCase(TestBase): # like to try for at most 10 times. for j in range(10): if self.TraceOn(): - print "j is: ", j + print("j is: ", j) thread = process.GetThreadAtIndex(0) if thread.GetNumFrames() >= 2: @@ -94,7 +96,7 @@ class ConditionalBreakTestCase(TestBase): # breakpoint such that lldb only stops when the caller of c() is a(). # the "my" package that defines the date() function. if self.TraceOn(): - print "About to source .lldb" + print("About to source .lldb") if not self.TraceOn(): self.HideStdout() @@ -107,13 +109,13 @@ class ConditionalBreakTestCase(TestBase): self.runCmd ("break list") if self.TraceOn(): - print "About to run." + print("About to run.") self.runCmd("run", RUN_SUCCEEDED) self.runCmd ("break list") if self.TraceOn(): - print "Done running" + print("Done running") # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, diff --git a/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py b/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py index ed73ccc0537..0d97a407213 100644 --- a/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py +++ b/lldb/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py b/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py index 9fd66a0148d..64c09e1fdbc 100644 --- a/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py +++ b/lldb/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py index f645febe751..0cf33efffb8 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py b/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py index a367e391a6e..791cc267a46 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py index f2911eccd34..441463636a1 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py b/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py index 7be7276a918..cb1163a405c 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py b/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py index e004e59ca1b..0e6a58a25a6 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py b/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py index d81891c4ff2..7310f8599d0 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py b/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py index 516c54e593f..3ef22dad37d 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py b/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py index c7ee9f6bf2e..1a4a7f39671 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py @@ -3,6 +3,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py b/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py index 2778035d149..0600861334c 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py @@ -3,6 +3,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py b/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py index 30d13231883..957c8dbe057 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py b/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py index 84cb74bcee1..1347c43de68 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py b/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py index 39e363a986d..771e87c2f2b 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time @@ -225,7 +227,7 @@ class PythonSynthDataFormatterTestCase(TestBase): str_cast = str(test_cast) if self.TraceOn(): - print str_cast + print(str_cast) self.assertTrue(str_cast.find('A') != -1, 'could not find A in output') self.assertTrue(str_cast.find('B') != -1, 'could not find B in output') @@ -238,7 +240,7 @@ class PythonSynthDataFormatterTestCase(TestBase): str_cast = str(test_cast) if self.TraceOn(): - print str_cast + print(str_cast) # we detect that all the values of the child objects have changed - but the counter-generated item # is still fixed at 0 because it is cached - this would fail if update(self): in ftsp returned False diff --git a/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py b/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py index b025ba0dbd8..41d080d6b80 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py b/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py index 03e713e5569..327a121a4ae 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time @@ -131,13 +133,13 @@ class SkipSummaryDataFormatterTestCase(TestBase): if self.getCompiler().endswith('gcc') and not self.getCompiler().endswith('llvm-gcc'): import re gcc_version_output = system([[lldbutil.which(self.getCompiler()), "-v"]])[1] - #print "my output:", gcc_version_output + #print("my output:", gcc_version_output) for line in gcc_version_output.split(os.linesep): m = re.search('\(Apple Inc\. build ([0-9]+)\)', line) - #print "line:", line + #print("line:", line) if m: gcc_build = int(m.group(1)) - #print "gcc build:", gcc_build + #print("gcc build:", gcc_build) if gcc_build >= 5666: # rdar://problem/9804600" self.skipTest("rdar://problem/9804600 wrong namespace for std::string in debug info") diff --git a/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py b/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py index bb0e4e571ae..2ced549edb5 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py index af7430807ec..6626539504f 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py index 03bbf3c3c05..6ef51493543 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py index af705998d31..226cfb94edb 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time, re diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py index 1681e32a4ff..1ff25a1bc9e 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py @@ -3,6 +3,8 @@ Test that the debugger handles loops in std::list (which can appear as a result corruption). """ +from __future__ import print_function + import lldb_shared import os, time, re diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py index b5ce17d6434..5ea67b273e3 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py index 30a3a3f13bc..231ff85ab1c 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py index 9c82d023169..c341ce027b3 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py index 27d72ab457f..2c1b90b69a2 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py index 4e59e052d7b..0cb33b92f67 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py @@ -3,6 +3,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py index b24c911266a..e307af7f63f 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py index e4e65ed50d4..057a8f606d9 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py index 086972da7ba..ac5518a6a01 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py index 08a89d89333..ec31cd789c8 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py index 5f8468b1f5d..65d09e01103 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py index 89be9575beb..0f1fde45148 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py index 7f071875cb6..3a6145b11ba 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py @@ -3,6 +3,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py index 71434eff620..0aba73faa8e 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py index 30ded55f901..22128e16907 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py b/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py index f6bdacc98f1..694ebbe17f0 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py b/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py index 418083dc939..71296ecf459 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time @@ -58,7 +60,7 @@ class DataFormatterSynthValueTestCase(TestBase): z_val = z.GetValueAsUnsigned if self.TraceOn(): - print "x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val()) + print("x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val())) self.assertFalse(x_val() == 3, "x == 3 before synthetics") self.assertFalse(y_val() == 4, "y == 4 before synthetics") @@ -70,7 +72,7 @@ class DataFormatterSynthValueTestCase(TestBase): self.runCmd("type synth add -l myArraySynthProvider myArray") if self.TraceOn(): - print "x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val()) + print("x_val = %s; y_val = %s; z_val = %s" % (x_val(),y_val(),z_val())) self.assertTrue(x_val() == 3, "x != 3 after synthetics") self.assertTrue(y_val() == 4, "y != 4 after synthetics") diff --git a/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py b/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py index 471086b9a2f..063fe382d9e 100644 --- a/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py +++ b/lldb/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py @@ -2,6 +2,8 @@ Check if changing Format on an SBValue correctly propagates that new format to children as it should """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py b/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py index ad5ee5ade7c..5726b3fd0ee 100644 --- a/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py +++ b/lldb/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py @@ -2,6 +2,8 @@ Test that the user can input a format but it will not prevail over summary format's choices. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py b/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py index 909c00f2b9f..77836ee1113 100644 --- a/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py +++ b/lldb/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py b/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py index 30846038285..a0154a45251 100644 --- a/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py +++ b/lldb/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py b/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py index 54442f2b32a..b9afb60a90a 100644 --- a/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py +++ b/lldb/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py b/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py index 41f7049882f..c5700a43985 100644 --- a/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py +++ b/lldb/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py b/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py index b044fc7f172..1fe3a600f93 100644 --- a/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py +++ b/lldb/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py b/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py index 88e345c6fce..ef9417282ab 100644 --- a/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py +++ b/lldb/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py b/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py index 0869ea9e74b..ebb34744ae1 100644 --- a/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py +++ b/lldb/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py @@ -2,6 +2,8 @@ Test that ValueObjectPrinter does not cause an infinite loop when a reference to a struct that contains a pointer to itself is printed. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py b/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py index 4b0ed7384ed..08aaea41725 100644 --- a/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py +++ b/lldb/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py index a4f50cbbbf9..f60fd4bd1d4 100644 --- a/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py +++ b/lldb/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py @@ -2,6 +2,8 @@ Check for an issue where capping does not work because the Target pointer appears to be changing behind our backs """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py b/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py index 80224ccf6aa..794fd76bb9c 100644 --- a/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py +++ b/lldb/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py b/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py index 8842896684a..c79cec39233 100644 --- a/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py +++ b/lldb/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py @@ -2,6 +2,8 @@ Test that the user can input a format but it will not prevail over summary format's choices. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py b/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py index 55c6c308f00..cb3927b6b51 100644 --- a/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py +++ b/lldb/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py b/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py index 4de0325ea4e..c4ce58d6f35 100644 --- a/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py +++ b/lldb/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py b/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py index 6235e61c712..b69fe2e450c 100644 --- a/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py +++ b/lldb/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py @@ -2,6 +2,8 @@ Check that vector types format properly """ +from __future__ import print_function + import lldb_shared import os, time @@ -49,7 +51,7 @@ class VectorTypesFormattingTestCase(TestBase): v.SetPreferSyntheticValue(True) v.SetFormat(lldb.eFormatVectorOfFloat32) - if self.TraceOn(): print v + if self.TraceOn(): print(v) self.assertTrue(v.GetNumChildren() == 4, "v as float32[] has 4 children") self.assertTrue(v.GetChildAtIndex(0).GetData().float[0] == 1.25, "child 0 == 1.25") diff --git a/lldb/test/functionalities/dead-strip/TestDeadStrip.py b/lldb/test/functionalities/dead-strip/TestDeadStrip.py index e61476139de..61e181c4ea4 100644 --- a/lldb/test/functionalities/dead-strip/TestDeadStrip.py +++ b/lldb/test/functionalities/dead-strip/TestDeadStrip.py @@ -2,6 +2,8 @@ Test that breakpoint works correctly in the presence of dead-code stripping. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py b/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py index e9ddf122f02..006832d8e87 100644 --- a/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py +++ b/lldb/test/functionalities/disassembly/TestDisassembleBreakpoint.py @@ -2,6 +2,8 @@ Test some lldb command abbreviations. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py b/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py index 67c4d971233..6b31ebc26dc 100644 --- a/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py +++ b/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py @@ -2,6 +2,8 @@ Test that dynamic values update their child count correctly """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py b/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py index c07628b7abe..542748e1b5c 100644 --- a/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py +++ b/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py @@ -1,5 +1,7 @@ """Test convenience variables when you drop in from lldb prompt into an embedded interpreter.""" +from __future__ import print_function + import lldb_shared import os @@ -50,28 +52,28 @@ class ConvenienceVariablesCase(TestBase): # Python interpreter, then the lldb interpreter. self.child_in_script_interpreter = True - child.sendline('print lldb.debugger') + child.sendline('print(lldb.debugger)') child.expect_exact(python_prompt) self.expect(child.before, exe=False, patterns = ['Debugger \(instance: .*, id: \d\)']) - child.sendline('print lldb.target') + child.sendline('print(lldb.target)') child.expect_exact(python_prompt) self.expect(child.before, exe=False, substrs = ['a.out']) - child.sendline('print lldb.process') + child.sendline('print(lldb.process)') child.expect_exact(python_prompt) self.expect(child.before, exe=False, patterns = ['SBProcess: pid = \d+, state = stopped, threads = \d, executable = a.out']) - child.sendline('print lldb.thread') + child.sendline('print(lldb.thread)') child.expect_exact(python_prompt) # Linux outputs decimal tid and 'name' instead of 'queue' self.expect(child.before, exe=False, patterns = ['thread #1: tid = (0x[0-9a-f]+|[0-9]+), 0x[0-9a-f]+ a\.out`main\(argc=1, argv=0x[0-9a-f]+\) \+ \d+ at main\.c:%d, (name|queue) = \'.+\', stop reason = breakpoint 1\.1' % self.line]) - child.sendline('print lldb.frame') + child.sendline('print(lldb.frame)') child.expect_exact(python_prompt) self.expect(child.before, exe=False, patterns = ['frame #0: 0x[0-9a-f]+ a\.out`main\(argc=1, argv=0x[0-9a-f]+\) \+ \d+ at main\.c:%d' % self.line]) diff --git a/lldb/test/functionalities/exec/TestExec.py b/lldb/test/functionalities/exec/TestExec.py index 7b6ce977669..f7a519124a9 100644 --- a/lldb/test/functionalities/exec/TestExec.py +++ b/lldb/test/functionalities/exec/TestExec.py @@ -1,6 +1,8 @@ """ Test some lldb command abbreviations. """ +from __future__ import print_function + import lldb_shared import commands @@ -11,11 +13,11 @@ from lldbtest import * import lldbutil def execute_command (command): - #print '%% %s' % (command) + #print('%% %s' % (command)) (exit_status, output) = commands.getstatusoutput (command) #if output: - # print output - #print 'status = %u' % (exit_status) + # print(output) + #print('status = %u' % (exit_status)) return exit_status class ExecTestCase(TestBase): diff --git a/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py b/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py index 89d7f721905..377c7e753f3 100644 --- a/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py +++ b/lldb/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py @@ -2,6 +2,8 @@ Test that expr will time out and allow other threads to run if it blocks. """ +from __future__ import print_function + import lldb_shared import os, time @@ -33,7 +35,7 @@ class ExprDoesntDeadlockTestCase(TestBase): main_file_spec = lldb.SBFileSpec ("locking.c") breakpoint = target.BreakpointCreateBySourceRegex('Break here', main_file_spec) if self.TraceOn(): - print "breakpoint:", breakpoint + print("breakpoint:", breakpoint) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) diff --git a/lldb/test/functionalities/fat_archives/TestFatArchives.py b/lldb/test/functionalities/fat_archives/TestFatArchives.py index f6d06949b91..40b8f257709 100644 --- a/lldb/test/functionalities/fat_archives/TestFatArchives.py +++ b/lldb/test/functionalities/fat_archives/TestFatArchives.py @@ -1,6 +1,8 @@ """ Test some lldb command abbreviations. """ +from __future__ import print_function + import lldb_shared import commands @@ -11,11 +13,11 @@ from lldbtest import * import lldbutil def execute_command (command): - # print '%% %s' % (command) + # print('%% %s' % (command)) (exit_status, output) = commands.getstatusoutput (command) # if output: - # print output - # print 'status = %u' % (exit_status) + # print(output) + # print('status = %u' % (exit_status)) return exit_status class FatArchiveTestCase(TestBase): diff --git a/lldb/test/functionalities/format/TestFormats.py b/lldb/test/functionalities/format/TestFormats.py index 84566ea2fc9..d4123efb36e 100644 --- a/lldb/test/functionalities/format/TestFormats.py +++ b/lldb/test/functionalities/format/TestFormats.py @@ -2,6 +2,8 @@ Test the command history mechanism """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py index 37e88c7bc45..b307abaaf69 100644 --- a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py +++ b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py @@ -1,5 +1,7 @@ """Test that lldb functions correctly after the inferior has asserted.""" +from __future__ import print_function + import lldb_shared import os, time @@ -167,7 +169,7 @@ class AssertingInferiorTestCase(TestBase): frame = thread.GetFrameAtIndex(i) self.assertTrue(frame.IsValid(), "current frame is valid") if self.TraceOn(): - print "Checking if function %s is main" % frame.GetFunctionName() + print("Checking if function %s is main" % frame.GetFunctionName()) if 'main' == frame.GetFunctionName(): frame_id = frame.GetFrameID() diff --git a/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py b/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py index 9fce54c3c67..7caa6cc6676 100644 --- a/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py +++ b/lldb/test/functionalities/inferior-changed/TestInferiorChanged.py @@ -1,5 +1,7 @@ """Test lldb reloads the inferior after it was changed during the session.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py index cd4ba304019..ee41cd5f9c2 100644 --- a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py +++ b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py @@ -1,5 +1,7 @@ """Test that lldb functions correctly after the inferior has crashed.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py b/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py index 61eea6e4b82..53ca4ffbcfb 100644 --- a/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py +++ b/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py @@ -1,5 +1,7 @@ """Test that lldb functions correctly after the inferior has crashed while in a recursive routine.""" +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/inline-stepping/TestInlineStepping.py b/lldb/test/functionalities/inline-stepping/TestInlineStepping.py index b0d620e7443..aa9fcaed703 100644 --- a/lldb/test/functionalities/inline-stepping/TestInlineStepping.py +++ b/lldb/test/functionalities/inline-stepping/TestInlineStepping.py @@ -1,5 +1,7 @@ """Test stepping over and into inlined functions.""" +from __future__ import print_function + import lldb_shared import os, time, sys diff --git a/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py b/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py index 5b8b11d578e..8ed08fc4c86 100644 --- a/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py +++ b/lldb/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py @@ -1,5 +1,7 @@ """Test for the JITLoaderGDB interface""" +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py b/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py index 609a1b937a7..90e40ce8a63 100644 --- a/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py +++ b/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py @@ -1,6 +1,8 @@ """ Test that argdumper is a viable launching strategy. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/load_unload/TestLoadUnload.py b/lldb/test/functionalities/load_unload/TestLoadUnload.py index 7122cdc3c60..7f67fb539fc 100644 --- a/lldb/test/functionalities/load_unload/TestLoadUnload.py +++ b/lldb/test/functionalities/load_unload/TestLoadUnload.py @@ -2,6 +2,8 @@ Test that breakpoint by symbol name works correctly with dynamic libs. """ +from __future__ import print_function + import lldb_shared import os, time @@ -110,7 +112,7 @@ class LoadUnloadTestCase(TestBase): # Inform (DY)LD_LIBRARY_PATH of the new path, too. env_cmd_string = "settings set target.env-vars " + self.dylibPath + "=" + new_dir if self.TraceOn(): - print "Set environment to: ", env_cmd_string + print("Set environment to: ", env_cmd_string) self.runCmd(env_cmd_string) self.runCmd("settings show target.env-vars") @@ -224,7 +226,7 @@ class LoadUnloadTestCase(TestBase): output = self.res.GetOutput() pattern = re.compile("Image ([0-9]+) loaded") for l in output.split(os.linesep): - #print "l:", l + #print("l:", l) match = pattern.search(l) if match: break diff --git a/lldb/test/functionalities/longjmp/TestLongjmp.py b/lldb/test/functionalities/longjmp/TestLongjmp.py index 8cb51e68db8..b7294ed042c 100644 --- a/lldb/test/functionalities/longjmp/TestLongjmp.py +++ b/lldb/test/functionalities/longjmp/TestLongjmp.py @@ -2,6 +2,8 @@ Test the use of setjmp/longjmp for non-local goto operations in a single-threaded inferior. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/memory/read/TestMemoryRead.py b/lldb/test/functionalities/memory/read/TestMemoryRead.py index c6430aae91d..9fbb56fc6e2 100644 --- a/lldb/test/functionalities/memory/read/TestMemoryRead.py +++ b/lldb/test/functionalities/memory/read/TestMemoryRead.py @@ -2,6 +2,8 @@ Test the 'memory read' command. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py b/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py index 7835a3733be..3e1f21cdd34 100644 --- a/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py +++ b/lldb/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py @@ -1,6 +1,8 @@ """Test evaluating expressions which ref. index variable 'i' which just goes from out of scope to in scope when stopped at the breakpoint.""" +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/nosucharch/TestNoSuchArch.py b/lldb/test/functionalities/nosucharch/TestNoSuchArch.py index bf29645062c..9e5bd719acf 100644 --- a/lldb/test/functionalities/nosucharch/TestNoSuchArch.py +++ b/lldb/test/functionalities/nosucharch/TestNoSuchArch.py @@ -1,6 +1,8 @@ """ Test that using a non-existent architecture name does not crash LLDB. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py b/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py index 54c1d21c766..ea851c7c8cd 100644 --- a/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py +++ b/lldb/test/functionalities/object-file/TestImageListMultiArchitecture.py @@ -4,6 +4,8 @@ This exercises classes like ObjectFileELF and their support for opening foreign-architecture object files. """ +from __future__ import print_function + import lldb_shared import os.path diff --git a/lldb/test/functionalities/paths/TestPaths.py b/lldb/test/functionalities/paths/TestPaths.py index 35769206565..3376fabe0fd 100644 --- a/lldb/test/functionalities/paths/TestPaths.py +++ b/lldb/test/functionalities/paths/TestPaths.py @@ -1,6 +1,8 @@ """ Test some lldb command abbreviations. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/platform/TestPlatformCommand.py b/lldb/test/functionalities/platform/TestPlatformCommand.py index 97908269da8..c049356d630 100644 --- a/lldb/test/functionalities/platform/TestPlatformCommand.py +++ b/lldb/test/functionalities/platform/TestPlatformCommand.py @@ -2,6 +2,8 @@ Test some lldb platform commands. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/plugins/commands/TestPluginCommands.py b/lldb/test/functionalities/plugins/commands/TestPluginCommands.py index 4053fe336c1..50146c9d006 100644 --- a/lldb/test/functionalities/plugins/commands/TestPluginCommands.py +++ b/lldb/test/functionalities/plugins/commands/TestPluginCommands.py @@ -2,6 +2,8 @@ Test that plugins that load commands work correctly. """ +from __future__ import print_function + import lldb_shared import os, time @@ -47,7 +49,7 @@ class PluginCommandTestCase(TestBase): retval = debugger.GetCommandInterpreter().HandleCommand("plugin_loaded_command child abc def ghi",retobj) if self.TraceOn(): - print retobj.GetOutput() + print(retobj.GetOutput()) self.expect(retobj,substrs = ['abc def ghi'], exe=False) @@ -57,6 +59,6 @@ class PluginCommandTestCase(TestBase): retval = debugger.GetCommandInterpreter().HandleCommand("plugin_loaded_ ch abc def ghi",retobj) if self.TraceOn(): - print retobj.GetOutput() + print(retobj.GetOutput()) self.expect(retobj,substrs = ['abc def ghi'], exe=False) diff --git a/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py b/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py index 749916fefd7..a1d61766ee5 100644 --- a/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py +++ b/lldb/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py @@ -2,6 +2,8 @@ Test that the Python operating system plugin works correctly """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py b/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py index bbacc19846c..379b27b4ce0 100644 --- a/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py +++ b/lldb/test/functionalities/postmortem/minidump/TestMiniDump.py @@ -2,6 +2,8 @@ Test basics of mini dump debugging. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/process_attach/TestProcessAttach.py b/lldb/test/functionalities/process_attach/TestProcessAttach.py index ed11a486181..023da1373ba 100644 --- a/lldb/test/functionalities/process_attach/TestProcessAttach.py +++ b/lldb/test/functionalities/process_attach/TestProcessAttach.py @@ -2,6 +2,8 @@ Test process attach. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py b/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py index 74013faacfb..bc0b850ea36 100644 --- a/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py +++ b/lldb/test/functionalities/process_attach/attach_denied/TestAttachDenied.py @@ -2,6 +2,8 @@ Test denied process attach. """ +from __future__ import print_function + import lldb_shared import os @@ -42,7 +44,7 @@ class AttachDeniedTestCase(TestBase): if err.Success() and retcode == 0: break else: - print msg + print(msg) if i < max_attempts: # Exponential backoff! time.sleep(pow(2, i) * 0.25) diff --git a/lldb/test/functionalities/process_group/TestChangeProcessGroup.py b/lldb/test/functionalities/process_group/TestChangeProcessGroup.py index 6864c475953..c31d8173fe4 100644 --- a/lldb/test/functionalities/process_group/TestChangeProcessGroup.py +++ b/lldb/test/functionalities/process_group/TestChangeProcessGroup.py @@ -1,5 +1,7 @@ """Test that we handle inferiors which change their process group""" +from __future__ import print_function + import lldb_shared import os @@ -39,7 +41,7 @@ class ChangeProcessGroupTestCase(TestBase): if err.Success() and retcode == 0: break else: - print msg + print(msg) if i < max_attempts: # Exponential backoff! time.sleep(pow(2, i) * 0.25) diff --git a/lldb/test/functionalities/process_launch/TestProcessLaunch.py b/lldb/test/functionalities/process_launch/TestProcessLaunch.py index 50e219f4dcb..75b3a2584a3 100644 --- a/lldb/test/functionalities/process_launch/TestProcessLaunch.py +++ b/lldb/test/functionalities/process_launch/TestProcessLaunch.py @@ -2,6 +2,8 @@ Test lldb process launch flags. """ +from __future__ import print_function + import lldb_shared import os, time @@ -160,7 +162,7 @@ class ProcessLaunchTestCase(TestBase): # Check to see if the 'stdout' file contains the right output line = out_f.readline(); if self.TraceOn(): - print "line:", line + print("line:", line) if not re.search(mywd, line): success = False err_msg = err_msg + "The current working directory was not set correctly.\n" diff --git a/lldb/test/functionalities/recursion/TestValueObjectRecursion.py b/lldb/test/functionalities/recursion/TestValueObjectRecursion.py index fa9000410e0..778d880a093 100644 --- a/lldb/test/functionalities/recursion/TestValueObjectRecursion.py +++ b/lldb/test/functionalities/recursion/TestValueObjectRecursion.py @@ -2,6 +2,8 @@ Test lldb data formatter subsystem. """ +from __future__ import print_function + import lldb_shared import os, time @@ -45,12 +47,12 @@ class ValueObjectRecursionTestCase(TestBase): root = self.frame().FindVariable("root") child = root.GetChildAtIndex(1) if self.TraceOn(): - print root - print child + print(root) + print(child) for i in range(0,24500): child = child.GetChildAtIndex(1) if self.TraceOn(): - print child + print(child) self.assertTrue(child.IsValid(),"could not retrieve the deep ValueObject") self.assertTrue(child.GetChildAtIndex(0).IsValid(),"the deep ValueObject has no value") self.assertTrue(child.GetChildAtIndex(0).GetValueAsUnsigned() != 0,"the deep ValueObject has a zero value") diff --git a/lldb/test/functionalities/register/TestRegisters.py b/lldb/test/functionalities/register/TestRegisters.py index efdbaaf8e47..b77ade7b08c 100755 --- a/lldb/test/functionalities/register/TestRegisters.py +++ b/lldb/test/functionalities/register/TestRegisters.py @@ -2,6 +2,8 @@ Test the 'register' command. """ +from __future__ import print_function + import lldb_shared import os, sys, time @@ -176,8 +178,8 @@ class RegisterCommandsTestCase(TestBase): for str1 in substrs: matched = output.find(str1) != -1 with recording(self, False) as sbuf: - print >> sbuf, "%s sub string: %s" % ('Expecting', str1) - print >> sbuf, "Matched" if matched else "Not Matched" + print("%s sub string: %s" % ('Expecting', str1), file=sbuf) + print("Matched" if matched else "Not Matched", file=sbuf) if matched: break self.assertTrue(matched, STOPPED_DUE_TO_SIGNAL) @@ -339,7 +341,7 @@ class RegisterCommandsTestCase(TestBase): self.addTearDownHook(self.cleanupSubprocesses) if self.TraceOn(): - print "pid of spawned process: %d" % pid + print("pid of spawned process: %d" % pid) self.runCmd("process attach -p %d" % pid) diff --git a/lldb/test/functionalities/rerun/TestRerun.py b/lldb/test/functionalities/rerun/TestRerun.py index 7d5972bb9b5..63b92c9752e 100644 --- a/lldb/test/functionalities/rerun/TestRerun.py +++ b/lldb/test/functionalities/rerun/TestRerun.py @@ -1,6 +1,8 @@ """ Test that argdumper is a viable launching strategy. """ +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/return-value/TestReturnValue.py b/lldb/test/functionalities/return-value/TestReturnValue.py index 9f7c07a3653..9ced2682118 100644 --- a/lldb/test/functionalities/return-value/TestReturnValue.py +++ b/lldb/test/functionalities/return-value/TestReturnValue.py @@ -2,6 +2,8 @@ Test getting return-values correctly when stepping out """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/set-data/TestSetData.py b/lldb/test/functionalities/set-data/TestSetData.py index f260bbdd9ef..c8b388f5b72 100644 --- a/lldb/test/functionalities/set-data/TestSetData.py +++ b/lldb/test/functionalities/set-data/TestSetData.py @@ -2,6 +2,8 @@ Set the contents of variables and registers using raw data """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/signal/TestSendSignal.py b/lldb/test/functionalities/signal/TestSendSignal.py index 71b96b76c11..0e3c10b21a5 100644 --- a/lldb/test/functionalities/signal/TestSendSignal.py +++ b/lldb/test/functionalities/signal/TestSendSignal.py @@ -1,5 +1,7 @@ """Test that lldb command 'process signal SIGUSR1' to send a signal to the inferior works.""" +from __future__ import print_function + import lldb_shared import os, time, signal diff --git a/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py b/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py index 70b8cf2498e..b9380034d18 100644 --- a/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py +++ b/lldb/test/functionalities/signal/handle-segv/TestHandleSegv.py @@ -1,5 +1,7 @@ """Test that we can debug inferiors that handle SIGSEGV by themselves""" +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/signal/raise/TestRaise.py b/lldb/test/functionalities/signal/raise/TestRaise.py index 6705bfd5ff3..8a976b6c4b0 100644 --- a/lldb/test/functionalities/signal/raise/TestRaise.py +++ b/lldb/test/functionalities/signal/raise/TestRaise.py @@ -1,5 +1,7 @@ """Test that we handle inferiors that send signals to themselves""" +from __future__ import print_function + import lldb_shared import os @@ -184,7 +186,7 @@ class RaiseTestCase(TestBase): # The last WaitForEvent call will time out after 2 seconds. while listener.WaitForEvent(2, event): if self.TraceOn(): - print "Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event)) + print("Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event))) # now the process should be stopped self.assertEqual(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED) @@ -204,7 +206,7 @@ class RaiseTestCase(TestBase): # Clear the events again while listener.WaitForEvent(2, event): if self.TraceOn(): - print "Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event)) + print("Process changing state to:", self.dbg.StateAsCString(process.GetStateFromEvent(event))) # The process should be stopped due to a signal self.assertEqual(process.GetState(), lldb.eStateStopped) diff --git a/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py b/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py index 17af6cb8c5e..111940ea857 100644 --- a/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py +++ b/lldb/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py @@ -2,6 +2,8 @@ Test the lldb command line takes a filename with single quote chars. """ +from __future__ import print_function + import lldb_shared import os @@ -57,13 +59,13 @@ class SingleQuoteInCommandLineTestCase(TestBase): with open('child_send.txt', 'r') as fs: if self.TraceOn(): - print "\n\nContents of child_send.txt:" - print fs.read() + print("\n\nContents of child_send.txt:") + print(fs.read()) with open('child_read.txt', 'r') as fr: from_child = fr.read() if self.TraceOn(): - print "\n\nContents of child_read.txt:" - print from_child + print("\n\nContents of child_read.txt:") + print(from_child) self.expect(from_child, exe=False, substrs = ["Current executable set to"]) diff --git a/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py b/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py index 3585b2f531a..3427ec16d52 100644 --- a/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py +++ b/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py @@ -2,6 +2,8 @@ Test thread step-in, step-over and step-out work with the "Avoid no debug" option. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/stop-hook/TestStopHookCmd.py b/lldb/test/functionalities/stop-hook/TestStopHookCmd.py index 9158412fc5a..916faee7253 100644 --- a/lldb/test/functionalities/stop-hook/TestStopHookCmd.py +++ b/lldb/test/functionalities/stop-hook/TestStopHookCmd.py @@ -2,6 +2,8 @@ Test lldb target stop-hook command. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py b/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py index 211c3f97cb2..cba672e0811 100644 --- a/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py +++ b/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py @@ -2,6 +2,8 @@ Test lldb target stop-hook mechanism to see whether it fires off correctly . """ +from __future__ import print_function + import lldb_shared import os @@ -83,7 +85,7 @@ class StopHookMechanismTestCase(TestBase): # make up a whole nother test case for it. child.sendline('frame info') at_line = 'at main.cpp:%d' % (self.correct_step_line) - print 'expecting "%s"' % at_line + print('expecting "%s"' % at_line) child.expect_exact(at_line) # Now continue the inferior, we'll stop at another breakpoint which is outside the stop-hook range. diff --git a/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py b/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py index 49da3fae154..a929ac6d110 100644 --- a/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py +++ b/lldb/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py @@ -2,6 +2,8 @@ Test that lldb stop-hook works for multiple threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/target_command/TestTargetCommand.py b/lldb/test/functionalities/target_command/TestTargetCommand.py index 28dcd1c8a45..bf1d1855c69 100644 --- a/lldb/test/functionalities/target_command/TestTargetCommand.py +++ b/lldb/test/functionalities/target_command/TestTargetCommand.py @@ -2,6 +2,8 @@ Test some target commands: create, list, select, variable. """ +from __future__ import print_function + import lldb_shared import lldb @@ -76,7 +78,7 @@ class targetCommandTestCase(TestBase): if match: # We will start from (index + 1) .... base = int(match.group(1), 10) + 1 - #print "base is:", base + #print("base is:", base) break; self.runCmd("target create " + exe_a, CURRENT_EXECUTABLE_SET) diff --git a/lldb/test/functionalities/thread/TestNumThreads.py b/lldb/test/functionalities/thread/TestNumThreads.py index 8a2ad59e258..4ba3ed50d82 100644 --- a/lldb/test/functionalities/thread/TestNumThreads.py +++ b/lldb/test/functionalities/thread/TestNumThreads.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py b/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py index 462314b735d..3ea2b5c6907 100644 --- a/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py +++ b/lldb/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py b/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py index 3fa1b4968bc..af86dbf3378 100644 --- a/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py +++ b/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py @@ -10,6 +10,8 @@ until exit or a crash takes place, and the number of events seen by LLDB is verified to match the expected number of events. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py b/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py index 89eccfdccf7..81b3beb4783 100644 --- a/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py +++ b/lldb/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py @@ -2,6 +2,8 @@ Test that step-inst over a crash behaves correctly. """ +from __future__ import print_function + import lldb_shared import os diff --git a/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py b/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py index d91f8d5d4eb..344483ba603 100644 --- a/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py +++ b/lldb/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py @@ -2,6 +2,8 @@ Test thread creation after process attach. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py b/lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py index a5ceae3dacd..cee27354e10 100644 --- a/lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py +++ b/lldb/test/functionalities/thread/create_during_step/TestCreateDuringStep.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py b/lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py index dc1d4dca9b0..760b950651f 100644 --- a/lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py +++ b/lldb/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py b/lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py index 30ca8fe9025..1f764af68e7 100644 --- a/lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py +++ b/lldb/test/functionalities/thread/exit_during_step/TestExitDuringStep.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/jump/TestThreadJump.py b/lldb/test/functionalities/thread/jump/TestThreadJump.py index a9b06863a72..4a55aff1714 100644 --- a/lldb/test/functionalities/thread/jump/TestThreadJump.py +++ b/lldb/test/functionalities/thread/jump/TestThreadJump.py @@ -2,6 +2,8 @@ Test jumping to different places. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py b/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py index 3afd6a22475..59fa0817368 100644 --- a/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py +++ b/lldb/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/state/TestThreadStates.py b/lldb/test/functionalities/thread/state/TestThreadStates.py index 06225f1eefc..0a434bf26c3 100644 --- a/lldb/test/functionalities/thread/state/TestThreadStates.py +++ b/lldb/test/functionalities/thread/state/TestThreadStates.py @@ -2,6 +2,8 @@ Test thread states. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/thread/step_out/TestThreadStepOut.py b/lldb/test/functionalities/thread/step_out/TestThreadStepOut.py index 3100b361d16..aa5d09e44c1 100644 --- a/lldb/test/functionalities/thread/step_out/TestThreadStepOut.py +++ b/lldb/test/functionalities/thread/step_out/TestThreadStepOut.py @@ -2,6 +2,8 @@ Test stepping out from a function in a multi-threaded program. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/thread_exit/TestThreadExit.py b/lldb/test/functionalities/thread/thread_exit/TestThreadExit.py index 39797651e79..facf1aa0d3d 100644 --- a/lldb/test/functionalities/thread/thread_exit/TestThreadExit.py +++ b/lldb/test/functionalities/thread/thread_exit/TestThreadExit.py @@ -2,6 +2,8 @@ Test number of threads. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py b/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py index 0c2c884cf6c..ab68309af93 100644 --- a/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py +++ b/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py @@ -2,6 +2,8 @@ Test that we obey thread conditioned breakpoints. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/tty/TestTerminal.py b/lldb/test/functionalities/tty/TestTerminal.py index 79cc264ab15..8706a46736c 100644 --- a/lldb/test/functionalities/tty/TestTerminal.py +++ b/lldb/test/functionalities/tty/TestTerminal.py @@ -2,6 +2,8 @@ Test lldb command aliases. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/type_completion/TestTypeCompletion.py b/lldb/test/functionalities/type_completion/TestTypeCompletion.py index 57952182a26..f5e6e941b56 100644 --- a/lldb/test/functionalities/type_completion/TestTypeCompletion.py +++ b/lldb/test/functionalities/type_completion/TestTypeCompletion.py @@ -2,6 +2,8 @@ Check that types only get completed when necessary. """ +from __future__ import print_function + import lldb_shared import os, time @@ -72,11 +74,11 @@ class TypeCompletionTestCase(TestBase): self.assertTrue(name_address_type.IsTypeComplete(), 'NameAndAddress should now be complete') field0 = name_address_type.GetFieldAtIndex(0) if self.TraceOn(): - print 'field0: ' + str(field0) + print('field0: ' + str(field0)) self.assertTrue(field0.IsValid(), 'NameAndAddress::m_name should be valid') string = field0.GetType().GetPointeeType() if self.TraceOn(): - print 'string: ' + str(string) + print('string: ' + str(string)) self.assertTrue(string.IsValid(), 'std::string should be valid') self.assertFalse(string.IsTypeComplete(), 'std::string complete but it should not be') @@ -90,11 +92,11 @@ class TypeCompletionTestCase(TestBase): self.assertTrue(name_address_type.IsTypeComplete(), 'NameAndAddress should now be complete') field0 = name_address_type.GetFieldAtIndex(0) if self.TraceOn(): - print 'field0: ' + str(field0) + print('field0: ' + str(field0)) self.assertTrue(field0.IsValid(), 'NameAndAddress::m_name should be valid') string = field0.GetType().GetPointeeType() if self.TraceOn(): - print 'string: ' + str(string) + print('string: ' + str(string)) self.assertTrue(string.IsValid(), 'std::string should be valid') self.assertFalse(string.IsTypeComplete(), 'std::string complete but it should not be') diff --git a/lldb/test/functionalities/type_lookup/TestTypeLookup.py b/lldb/test/functionalities/type_lookup/TestTypeLookup.py index 4e27a02d4e5..26e56c9b901 100644 --- a/lldb/test/functionalities/type_lookup/TestTypeLookup.py +++ b/lldb/test/functionalities/type_lookup/TestTypeLookup.py @@ -2,6 +2,8 @@ Test type lookup command. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py b/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py index 2d557f1b9d0..7b0fa135012 100644 --- a/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py +++ b/lldb/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py @@ -2,6 +2,8 @@ Test that we can backtrace correctly with 'noreturn' functions on the stack """ +from __future__ import print_function + import lldb_shared import os, time @@ -42,9 +44,9 @@ class NoreturnUnwind(TestBase): abort_frame_number = abort_frame_number + 1 if self.TraceOn(): - print "Backtrace once we're stopped:" + print("Backtrace once we're stopped:") for f in thread.frames: - print " %d %s" % (f.GetFrameID(), f.GetFunctionName()) + print(" %d %s" % (f.GetFrameID(), f.GetFunctionName())) # I'm going to assume that abort() ends up calling/invoking another # function before halting the process. In which case if abort_frame_number diff --git a/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py b/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py index fe375b422ec..a4d25fa1223 100644 --- a/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py +++ b/lldb/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py @@ -2,6 +2,8 @@ Test that we can backtrace correctly with 'sigtramp' functions on the stack """ +from __future__ import print_function + import lldb_shared import os, time @@ -62,9 +64,9 @@ class SigtrampUnwind(TestBase): found_main = True if self.TraceOn(): - print "Backtrace once we're stopped:" + print("Backtrace once we're stopped:") for f in thread.frames: - print " %d %s" % (f.GetFrameID(), f.GetFunctionName()) + print(" %d %s" % (f.GetFrameID(), f.GetFunctionName())) if found_handler == False: self.fail("Unable to find handler() in backtrace.") diff --git a/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py b/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py index 58f7db04be1..bba6a71a3e9 100644 --- a/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py +++ b/lldb/test/functionalities/unwind/standard/TestStandardUnwind.py @@ -10,6 +10,8 @@ file up and generate a test case from it in run time (with name test_standard_un after escaping some special characters). """ +from __future__ import print_function + import lldb_shared import unittest2 @@ -84,9 +86,9 @@ class StandardUnwindTest(TestBase): thread = process.GetThreadAtIndex(0) if self.TraceOn(): - print "INDEX: %u" % index + print("INDEX: %u" % index) for f in thread.frames: - print f + print(f) if thread.GetFrameAtIndex(0).GetFunctionName() is not None: found_main = False @@ -131,7 +133,7 @@ for f in test_source_files: self.setTearDownCleanup(d) except: if self.TraceOn(): - print sys.exc_info()[0] + print(sys.exc_info()[0]) self.skipTest("Inferior not supported") self.standard_unwind_tests() diff --git a/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py b/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py index 9a51c5875a6..01914a35161 100644 --- a/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py +++ b/lldb/test/functionalities/value_md5_crash/TestValueMD5Crash.py @@ -2,6 +2,8 @@ Verify that the hash computing logic for ValueObject's values can't crash us. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py b/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py index d784faa24c7..da487572754 100644 --- a/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py +++ b/lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py @@ -2,6 +2,8 @@ Test lldb watchpoint that uses '-s size' to watch a pointed location with size. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py b/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py index ee92815f77a..cfdcd727d2c 100644 --- a/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py +++ b/lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py @@ -2,6 +2,8 @@ Test my first lldb watchpoint. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py b/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py index 024791ae76d..48e5e98aca7 100644 --- a/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py +++ b/lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py @@ -2,6 +2,8 @@ Test that lldb watchpoint works for multiple threads. """ +from __future__ import print_function + import lldb_shared import os, time @@ -126,7 +128,7 @@ class WatchpointForMultipleThreadsTestCase(TestBase): self.fail("Watchpoint hits not supposed to exceed 1 by design!") # Good, we verified that the watchpoint works! Now delete the watchpoint. if self.TraceOn(): - print "watchpoint_stops=%d at the moment we delete the watchpoint" % watchpoint_stops + print("watchpoint_stops=%d at the moment we delete the watchpoint" % watchpoint_stops) self.runCmd("watchpoint delete 1") self.expect("watchpoint list -v", substrs = ['No watchpoints currently set.']) diff --git a/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py b/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py index 3401976d797..d64924e1981 100644 --- a/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py +++ b/lldb/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py @@ -1,5 +1,7 @@ """Test stepping over watchpoints.""" +from __future__ import print_function + import lldb_shared import lldb diff --git a/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py b/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py index b2161369ded..681d420fec8 100644 --- a/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py +++ b/lldb/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py @@ -2,6 +2,8 @@ Test that a variable watchpoint should only hit when in scope. """ +from __future__ import print_function + import lldb_shared import unittest2 diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py index cfa6a10bc25..24808f3214c 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py @@ -2,6 +2,8 @@ Test watchpoint list, enable, disable, and delete commands. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py index a7b9d4c0ea8..f89f76b0c0b 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py @@ -2,6 +2,8 @@ Test 'watchpoint command'. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py index 6bd8b93343e..1960c76df9b 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py @@ -2,6 +2,8 @@ Test 'watchpoint command'. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py b/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py index 5b66e653bcb..919a8a44687 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py @@ -2,6 +2,8 @@ Test watchpoint modify command to set condition on a watchpoint. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py b/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py index 821062d939a..6483f879c73 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py @@ -1,5 +1,7 @@ """Test that adding, deleting and modifying watchpoints sends the appropriate events.""" +from __future__ import print_function + import lldb_shared import os, time @@ -82,6 +84,6 @@ class TestWatchpointEvents (TestBase): # There shouldn't be another event waiting around: found_event = self.listener.PeekAtNextEventForBroadcasterWithType (self.target_bcast, lldb.SBTarget.eBroadcastBitBreakpointChanged, event) if found_event: - print "Found an event I didn't expect: ", event + print("Found an event I didn't expect: ", event) self.assertTrue (not found_event, "Only one event per change.") diff --git a/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py b/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py index 2a340dad255..a594bbda8c8 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py @@ -2,6 +2,8 @@ Test displayed value of a vector variable while doing watchpoint operations """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py index cdfd435b2ad..7763e78f39a 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py @@ -2,6 +2,8 @@ Test lldb watchpoint that uses 'watchpoint set -w write -s size' to watch a pointed location with size. """ +from __future__ import print_function + import lldb_shared import os, time diff --git a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py index f7e7bcff702..b6f80910287 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py @@ -2,6 +2,8 @@ Test error cases for the 'watchpoint set' command to make sure it errors out when necessary. """ +from __future__ import print_function + import lldb_shared import os, time |