Use built-in truth value testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@132079 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/examples/python/disasm.py b/examples/python/disasm.py
index 15f3d78..8a7e5a1 100755
--- a/examples/python/disasm.py
+++ b/examples/python/disasm.py
@@ -29,7 +29,7 @@
target = debugger.CreateTargetWithFileAndArch (sys.argv[1], lldb.LLDB_ARCH_DEFAULT)
-if target.IsValid():
+if target:
# If the target is valid set a breakpoint at main
main_bp = target.BreakpointCreateByName ("main", target.GetExecutable().GetFilename());
@@ -41,24 +41,24 @@
process = target.Launch (debugger.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
# Make sure the launch went ok
- if process.IsValid():
+ if process:
# Print some simple process info
state = process.GetState ()
print process
if state == lldb.eStateStopped:
# Get the first thread
thread = process.GetThreadAtIndex (0)
- if thread.IsValid():
+ if thread:
# Print some simple thread info
print thread
# Get the first frame
frame = thread.GetFrameAtIndex (0)
- if frame.IsValid():
+ if frame:
# Print some simple frame info
print frame
function = frame.GetFunction()
# See if we have debug info (a function)
- if function.IsValid():
+ if function:
# We do have a function, print some info for the function
print function
# Now get all instructions for this function and print them
@@ -67,7 +67,7 @@
else:
# See if we have a symbol in the symbol table for where we stopped
symbol = frame.GetSymbol();
- if symbol.IsValid():
+ if symbol:
# We do have a symbol, print some info for the symbol
print symbol
# Now get all instructions for this symbol and print them