diff options
Diffstat (limited to 'lldb/test/functionalities/breakpoint')
16 files changed, 40 insertions, 8 deletions
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 |