This test is incorrect as functions that return lldb.SBThread objects never return None, they just return lldb.SBThread objects that contain invalid opaque classes.
llvm-svn: 177416
# Frame #0 should be on self.line1 and the break condition should hold.
from lldbutil import get_stopped_thread
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
var = frame0.FindValue('val', lldb.eValueTypeVariableArgument)
self.assertTrue(frame0.GetLineEntry().GetLine() == self.line1 and
#lldbutil.print_stacktraces(process)
from lldbutil import get_stopped_thread
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint")
frame0 = thread.GetFrameAtIndex(0)
frame1 = thread.GetFrameAtIndex(1)
frame2 = thread.GetFrameAtIndex(2)
# Frame #0 should be on self.line1 and the break condition should hold.
from lldbutil import get_stopped_thread
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
# Get Frame #0.
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
# Get the type for variable 'associative_array'.
...
from lldbutil import get_stopped_thread
thread = get_stopped_thread(process, lldb.eStopReasonPlanComplete)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
...
2. Get the thread stopped due to a breakpoint
...
from lldbutil import get_stopped_thread
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint")
...
"""
# Frame #0 should be on self.line1.
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
lineEntry = frame0.GetLineEntry()
self.assertTrue(lineEntry.GetLine() == self.line1)
process.Continue()
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
lineEntry = frame0.GetLineEntry()
self.assertTrue(lineEntry.GetLine() == self.line2)
# Frame #0 should be on self.line1.
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
symbol_line1 = frame0.GetSymbol()
# We should have a symbol type of code.
process.Continue()
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
symbol_line2 = frame0.GetSymbol()
# We should have a symbol type of code.
process = target.LaunchSimple(None, None, os.getcwd())
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint")
frame = thread.GetFrameAtIndex(0)
# Get the SBValue for the global variable 'my_char'.
process = target.LaunchSimple(None, None, os.getcwd())
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint")
frame = thread.GetFrameAtIndex(0)
# Get the SBValue for the global variable 'my_char'.
process = target.LaunchSimple(None, None, os.getcwd())
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint")
frame = thread.GetFrameAtIndex(0)
# Get the SBValue for the global variable 'my_int'.
# Frame #0 should be on self.line.
from lldbutil import get_stopped_thread
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint")
frame0 = thread.GetFrameAtIndex(0)
self.assertTrue(frame0.GetLineEntry().GetLine() == self.line)
# Frame #0 should be on self.line1.
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
#self.runCmd("process status")
frame0 = thread.GetFrameAtIndex(0)
lineEntry = frame0.GetLineEntry()
process.Continue()
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
#self.runCmd("process status")
frame0 = thread.GetFrameAtIndex(0)
lineEntry = frame0.GetLineEntry()
process = target.LaunchSimple(None, None, os.getcwd())
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint")
self.runCmd("process status")
proc_of_thread = thread.GetProcess()
process = target.LaunchSimple(None, None, os.getcwd())
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint")
#self.runCmd("process status")
# Due to the typemap magic (see lldb.swig), we pass in an (int)length to GetStopDescription
while True:
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint")
caller_symbol = get_caller_symbol(thread)
#print "caller symbol of malloc:", caller_symbol
if not caller_symbol:
# Frame #0 should be on self.step_out_of_malloc.
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
self.runCmd("thread backtrace")
frame0 = thread.GetFrameAtIndex(0)
lineEntry = frame0.GetLineEntry()
# Frame #0 should be on self.step_out_of_malloc.
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
self.runCmd("thread backtrace")
frame0 = thread.GetFrameAtIndex(0)
lineEntry = frame0.GetLineEntry()
# Get Frame #0.
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
# Get the type 'Task'.
# Get Frame #0.
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
# Get global variable 'days_of_week'.
# Get Frame #0.
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
self.assertTrue (frame0.IsValid(), "Got a valid frame.")
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
expected_value = "Val - 12345 Mine - 55, 98765, 55555555. Ptr - 66, 98765, 66666666"
stdout = process.GetSTDOUT(1000)
# Get Frame #0.
self.assertTrue(process.GetState() == lldb.eStateStopped)
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
- self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
+ self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
# Get variable 'task_head'.