diff options
| author | Johnny Chen <johnny.chen@apple.com> | 2011-05-25 20:48:29 +0000 |
|---|---|---|
| committer | Johnny Chen <johnny.chen@apple.com> | 2011-05-25 20:48:29 +0000 |
| commit | 9a26f0f260c1c12905358edb16661de21734dc0d (patch) | |
| tree | 835c93224cbc9d06a79f64213b69daa948f7d38e /lldb/examples/python | |
| parent | 26fc16b0326e236f72b9fa504a1ff1759773c280 (diff) | |
| download | bcm5719-llvm-9a26f0f260c1c12905358edb16661de21734dc0d.tar.gz bcm5719-llvm-9a26f0f260c1c12905358edb16661de21734dc0d.zip | |
Use built-in truth value testing.
llvm-svn: 132079
Diffstat (limited to 'lldb/examples/python')
| -rwxr-xr-x | lldb/examples/python/disasm.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/examples/python/disasm.py b/lldb/examples/python/disasm.py index 15f3d78dc55..8a7e5a10b5e 100755 --- a/lldb/examples/python/disasm.py +++ b/lldb/examples/python/disasm.py @@ -29,7 +29,7 @@ print "Creating a target for '%s'" % sys.argv[1] 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 @@ if target.IsValid(): 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 @@ if target.IsValid(): 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 |

