summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/frame
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-10-23 17:04:29 +0000
committerZachary Turner <zturner@google.com>2015-10-23 17:04:29 +0000
commit35d017f0fc38b53e31f1a44d07c3c142f5d3620b (patch)
tree9bb8d7e92d30ed6ea5387993d53a07e8f16a155c /lldb/test/python_api/frame
parentd43fe0bd39ab70b739123853ebd0c2991512b9d7 (diff)
downloadbcm5719-llvm-35d017f0fc38b53e31f1a44d07c3c142f5d3620b.tar.gz
bcm5719-llvm-35d017f0fc38b53e31f1a44d07c3c142f5d3620b.zip
Add from __future__ import print_function everywhere.
Apparently there were tons of instances I missed last time, I guess I accidentally ran 2to3 non-recursively. This should be every occurrence of a print statement fixed to use a print function as well as from __future__ import print_function being added to every file. After this patch print statements will stop working everywhere in the test suite, and the print function should be used instead. llvm-svn: 251121
Diffstat (limited to 'lldb/test/python_api/frame')
-rw-r--r--lldb/test/python_api/frame/TestFrames.py30
-rw-r--r--lldb/test/python_api/frame/inlines/TestInlinedFrame.py12
2 files changed, 23 insertions, 19 deletions
diff --git a/lldb/test/python_api/frame/TestFrames.py b/lldb/test/python_api/frame/TestFrames.py
index b13edd09396..d8cccc6fea0 100644
--- a/lldb/test/python_api/frame/TestFrames.py
+++ b/lldb/test/python_api/frame/TestFrames.py
@@ -3,6 +3,8 @@ Use lldb Python SBFrame API to get the argument values of the call stacks.
And other SBFrame API tests.
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
@@ -27,7 +29,7 @@ class FrameAPITestCase(TestBase):
# Now create a breakpoint on main.c by name 'c'.
breakpoint = target.BreakpointCreateByName('c', 'a.out')
- #print "breakpoint:", breakpoint
+ #print("breakpoint:", breakpoint)
self.assertTrue(breakpoint and
breakpoint.GetNumLocations() == 1,
VALID_BREAKPOINT)
@@ -52,7 +54,7 @@ class FrameAPITestCase(TestBase):
for i in range(numFrames):
frame = thread.GetFrameAtIndex(i)
if self.TraceOn():
- print "frame:", frame
+ print("frame:", frame)
name = frame.GetFunction().GetName()
if name == 'a':
@@ -70,7 +72,7 @@ class FrameAPITestCase(TestBase):
argList.append("(%s)%s=%s" % (val.GetTypeName(),
val.GetName(),
val.GetValue()))
- print >> session, "%s(%s)" % (name, ", ".join(argList))
+ print("%s(%s)" % (name, ", ".join(argList)), file=session)
# Also check the generic pc & stack pointer. We can't test their absolute values,
# but they should be valid. Uses get_GPRs() from the lldbutil module.
@@ -84,7 +86,7 @@ class FrameAPITestCase(TestBase):
self.assertTrue (sp_value, "We should have a valid Stack Pointer.")
self.assertTrue (int(sp_value.GetValue(), 0) == frame.GetSP(), "SP gotten as a value should equal frame's GetSP")
- print >> session, "---"
+ print("---", file=session)
process.Continue()
# At this point, the inferior process should have exited.
@@ -97,8 +99,8 @@ class FrameAPITestCase(TestBase):
# o a((int)val=1, (char)ch='A')
# o a((int)val=3, (char)ch='A')
if self.TraceOn():
- print "Full stack traces when stopped on the breakpoint 'c':"
- print session.getvalue()
+ print("Full stack traces when stopped on the breakpoint 'c':")
+ print(session.getvalue())
self.expect(session.getvalue(), "Argugment values displayed correctly",
exe=False,
substrs = ["a((int)val=1, (char)ch='A')",
@@ -116,7 +118,7 @@ class FrameAPITestCase(TestBase):
# Now create a breakpoint on main.c by name 'c'.
breakpoint = target.BreakpointCreateByName('c', 'a.out')
- #print "breakpoint:", breakpoint
+ #print("breakpoint:", breakpoint)
self.assertTrue(breakpoint and
breakpoint.GetNumLocations() == 1,
VALID_BREAKPOINT)
@@ -131,15 +133,15 @@ class FrameAPITestCase(TestBase):
thread = process.GetThreadAtIndex(0)
frame = thread.GetFrameAtIndex(0)
if self.TraceOn():
- print "frame:", frame
+ print("frame:", frame)
# Boundary condition testings.
val1 = frame.FindVariable(None, True)
val2 = frame.FindVariable(None, False)
val3 = frame.FindValue(None, lldb.eValueTypeVariableGlobal)
if self.TraceOn():
- print "val1:", val1
- print "val2:", val2
+ print("val1:", val1)
+ print("val2:", val2)
frame.EvaluateExpression(None)
@@ -155,7 +157,7 @@ class FrameAPITestCase(TestBase):
# Now create a breakpoint on main.c by name 'c'.
breakpoint = target.BreakpointCreateByName('c', 'a.out')
- #print "breakpoint:", breakpoint
+ #print("breakpoint:", breakpoint)
self.assertTrue(breakpoint and
breakpoint.GetNumLocations() == 1,
VALID_BREAKPOINT)
@@ -172,7 +174,7 @@ class FrameAPITestCase(TestBase):
frameEntered = thread.GetFrameAtIndex(0)
if self.TraceOn():
- print frameEntered
+ print(frameEntered)
lldbutil.print_stacktrace(thread)
self.assertTrue(frameEntered)
@@ -182,7 +184,7 @@ class FrameAPITestCase(TestBase):
self.assertTrue(thread)
frameNow = thread.GetFrameAtIndex(0)
if self.TraceOn():
- print frameNow
+ print(frameNow)
lldbutil.print_stacktrace(thread)
self.assertTrue(frameNow)
@@ -193,7 +195,7 @@ class FrameAPITestCase(TestBase):
thread.StepOutOfFrame(frameNow)
frameOutOfC = thread.GetFrameAtIndex(0)
if self.TraceOn():
- print frameOutOfC
+ print(frameOutOfC)
lldbutil.print_stacktrace(thread)
self.assertTrue(frameOutOfC)
diff --git a/lldb/test/python_api/frame/inlines/TestInlinedFrame.py b/lldb/test/python_api/frame/inlines/TestInlinedFrame.py
index e5e53918190..1fc86064fb7 100644
--- a/lldb/test/python_api/frame/inlines/TestInlinedFrame.py
+++ b/lldb/test/python_api/frame/inlines/TestInlinedFrame.py
@@ -2,6 +2,8 @@
Testlldb Python SBFrame APIs IsInlined() and GetFunctionName().
"""
+from __future__ import print_function
+
import lldb_shared
import os, time
@@ -33,7 +35,7 @@ class InlinedFrameAPITestCase(TestBase):
# Now create a breakpoint on main.c by the name of 'inner_inline'.
breakpoint = target.BreakpointCreateByName('inner_inline', 'a.out')
- #print "breakpoint:", breakpoint
+ #print("breakpoint:", breakpoint)
self.assertTrue(breakpoint and
breakpoint.GetNumLocations() > 1,
VALID_BREAKPOINT)
@@ -48,8 +50,8 @@ class InlinedFrameAPITestCase(TestBase):
import lldbutil
stack_traces1 = lldbutil.print_stacktraces(process, string_buffer=True)
if self.TraceOn():
- print "Full stack traces when first stopped on the breakpoint 'inner_inline':"
- print stack_traces1
+ print("Full stack traces when first stopped on the breakpoint 'inner_inline':")
+ print(stack_traces1)
# The first breakpoint should correspond to an inlined call frame.
# If it's an inlined call frame, expect to find, in the stack trace,
@@ -70,7 +72,7 @@ class InlinedFrameAPITestCase(TestBase):
PROCESS_STOPPED)
stack_traces2 = lldbutil.print_stacktraces(process, string_buffer=True)
if self.TraceOn():
- print "Full stack traces when stopped on the breakpoint 'inner_inline' for the second time:"
- print stack_traces2
+ print("Full stack traces when stopped on the breakpoint 'inner_inline' for the second time:")
+ print(stack_traces2)
self.expect(stack_traces2, "Second stop at %s:%d" % (self.source, self.second_stop), exe=False,
substrs = ['%s:%d' % (self.source, self.second_stop)])
OpenPOWER on IntegriCloud