summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-08-03 22:57:10 +0000
committerGreg Clayton <gclayton@apple.com>2011-08-03 22:57:10 +0000
commitfe42ac4d0a4836829616d054c524e8cc10b25b88 (patch)
treebf0d085081bec250842526fb9342d48dcbae138b /lldb/test/python_api
parent3ef20e35f9181c28650f60c3845c4b1c737853fb (diff)
downloadbcm5719-llvm-fe42ac4d0a4836829616d054c524e8cc10b25b88.tar.gz
bcm5719-llvm-fe42ac4d0a4836829616d054c524e8cc10b25b88.zip
Cleaned up the SBType.h file to not include internal headers and reorganized
the SBType implementation classes. Fixed LLDB core and the test suite to not use deprecated SBValue APIs. Added a few new APIs to SBValue: int64_t SBValue::GetValueAsSigned(int64_t fail_value=0); uint64_t SBValue::GetValueAsUnsigned(uint64_t fail_value=0) llvm-svn: 136829
Diffstat (limited to 'lldb/test/python_api')
-rw-r--r--lldb/test/python_api/frame/TestFrames.py6
-rw-r--r--lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py6
-rw-r--r--lldb/test/python_api/process/TestProcessAPI.py16
3 files changed, 14 insertions, 14 deletions
diff --git a/lldb/test/python_api/frame/TestFrames.py b/lldb/test/python_api/frame/TestFrames.py
index e9b1ed199e8..5872e63f270 100644
--- a/lldb/test/python_api/frame/TestFrames.py
+++ b/lldb/test/python_api/frame/TestFrames.py
@@ -77,7 +77,7 @@ class FrameAPITestCase(TestBase):
for val in valList:
argList.append("(%s)%s=%s" % (val.GetTypeName(),
val.GetName(),
- val.GetValue(frame)))
+ val.GetValue()))
print >> session, "%s(%s)" % (name, ", ".join(argList))
# Also check the generic pc & stack pointer. We can't test their absolute values,
@@ -85,10 +85,10 @@ class FrameAPITestCase(TestBase):
gpr_reg_set = lldbutil.get_GPRs(frame)
pc_value = gpr_reg_set.GetChildMemberWithName("pc")
self.assertTrue (pc_value, "We should have a valid PC.")
- self.assertTrue (int(pc_value.GetValue(frame), 0) == frame.GetPC(), "PC gotten as a value should equal frame's GetPC")
+ self.assertTrue (int(pc_value.GetValue(), 0) == frame.GetPC(), "PC gotten as a value should equal frame's GetPC")
sp_value = gpr_reg_set.GetChildMemberWithName("sp")
self.assertTrue (sp_value, "We should have a valid Stack Pointer.")
- self.assertTrue (int(sp_value.GetValue(frame), 0) == frame.GetSP(), "SP gotten as a value should equal frame's GetSP")
+ self.assertTrue (int(sp_value.GetValue(), 0) == frame.GetSP(), "SP gotten as a value should equal frame's GetSP")
print >> session, "---"
process.Continue()
diff --git a/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py b/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py
index a869d5bcc7e..069243b85e2 100644
--- a/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py
+++ b/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py
@@ -54,7 +54,7 @@ class RegistersIteratorTestCase(TestBase):
for reg in REGs:
self.assertTrue(reg)
if self.TraceOn():
- print "%s => %s" % (reg.GetName(), reg.GetValue(frame))
+ print "%s => %s" % (reg.GetName(), reg.GetValue())
REGs = lldbutil.get_FPRs(frame)
num = len(REGs)
@@ -63,7 +63,7 @@ class RegistersIteratorTestCase(TestBase):
for reg in REGs:
self.assertTrue(reg)
if self.TraceOn():
- print "%s => %s" % (reg.GetName(), reg.GetValue(frame))
+ print "%s => %s" % (reg.GetName(), reg.GetValue())
REGs = lldbutil.get_ESRs(frame)
num = len(REGs)
@@ -72,7 +72,7 @@ class RegistersIteratorTestCase(TestBase):
for reg in REGs:
self.assertTrue(reg)
if self.TraceOn():
- print "%s => %s" % (reg.GetName(), reg.GetValue(frame))
+ print "%s => %s" % (reg.GetName(), reg.GetValue())
# And these should also work.
for kind in ["General Purpose Registers",
diff --git a/lldb/test/python_api/process/TestProcessAPI.py b/lldb/test/python_api/process/TestProcessAPI.py
index a423bfeb4ba..2d68d85030e 100644
--- a/lldb/test/python_api/process/TestProcessAPI.py
+++ b/lldb/test/python_api/process/TestProcessAPI.py
@@ -86,11 +86,11 @@ class ProcessAPITestCase(TestBase):
self.DebugSBValue(val)
# If the variable does not have a load address, there's no sense continuing.
- if not val.GetLocation(frame).startswith("0x"):
+ if not val.GetLocation().startswith("0x"):
return
# OK, let's get the hex location of the variable.
- location = int(val.GetLocation(frame), 16)
+ location = int(val.GetLocation(), 16)
# Due to the typemap magic (see lldb.swig), we pass in 1 to ReadMemory and
# expect to get a Python string as the result object!
@@ -128,11 +128,11 @@ class ProcessAPITestCase(TestBase):
self.DebugSBValue(val)
# If the variable does not have a load address, there's no sense continuing.
- if not val.GetLocation(frame).startswith("0x"):
+ if not val.GetLocation().startswith("0x"):
return
# OK, let's get the hex location of the variable.
- location = int(val.GetLocation(frame), 16)
+ location = int(val.GetLocation(), 16)
# The program logic makes the 'my_char' variable to have memory content as 'x'.
# But we want to use the WriteMemory() API to assign 'a' to the variable.
@@ -179,11 +179,11 @@ class ProcessAPITestCase(TestBase):
self.DebugSBValue(val)
# If the variable does not have a load address, there's no sense continuing.
- if not val.GetLocation(frame).startswith("0x"):
+ if not val.GetLocation().startswith("0x"):
return
# OK, let's get the hex location of the variable.
- location = int(val.GetLocation(frame), 16)
+ location = int(val.GetLocation(), 16)
# Note that the canonical from of the bytearray is little endian.
from lldbutil import int_to_bytearray, bytearray_to_int
@@ -212,14 +212,14 @@ class ProcessAPITestCase(TestBase):
self.fail("SBProcess.WriteMemory() failed")
# Make sure that the val we got originally updates itself to notice the change:
- self.expect(val.GetValue(frame),
+ self.expect(val.GetValue(),
"SBProcess.ReadMemory() successfully writes (int)256 to the memory location for 'my_int'",
exe=False,
startstr = '256')
# And for grins, get the SBValue for the global variable 'my_int' again, to make sure that also tracks the new value:
val = frame.FindValue("my_int", lldb.eValueTypeVariableGlobal)
- self.expect(val.GetValue(frame),
+ self.expect(val.GetValue(),
"SBProcess.ReadMemory() successfully writes (int)256 to the memory location for 'my_int'",
exe=False,
startstr = '256')
OpenPOWER on IntegriCloud