diff options
Diffstat (limited to 'lldb/examples/python/gdb_disassemble.py')
-rwxr-xr-x | lldb/examples/python/gdb_disassemble.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lldb/examples/python/gdb_disassemble.py b/lldb/examples/python/gdb_disassemble.py index d9a2f212fc9..2590aba8c85 100755 --- a/lldb/examples/python/gdb_disassemble.py +++ b/lldb/examples/python/gdb_disassemble.py @@ -1,5 +1,6 @@ import lldb + def disassemble(debugger, command, result, dict): if lldb.frame.function: instructions = lldb.frame.function.instructions @@ -9,7 +10,7 @@ def disassemble(debugger, command, result, dict): instructions = lldb.frame.symbol.instructions start_addr = lldb.frame.symbol.addr.load_addr name = lldb.frame.symbol.name - + for inst in instructions: inst_addr = inst.addr.load_addr inst_offset = inst_addr - start_addr @@ -18,7 +19,8 @@ def disassemble(debugger, command, result, dict): print "<%s + %-4u> 0x%x %8s %s ; %s" % (name, inst_offset, inst_addr, inst.mnemonic, inst.operands, comment) else: print "<%s + %-4u> 0x%x %8s %s" % (name, inst_offset, inst_addr, inst.mnemonic, inst.operands) - + # Install the command when the module gets imported -lldb.debugger.HandleCommand('command script add -f gdb_disassemble.disassemble gdb-disassemble') -print 'Installed "gdb-disassemble" command for disassembly'
\ No newline at end of file +lldb.debugger.HandleCommand( + 'command script add -f gdb_disassemble.disassemble gdb-disassemble') +print 'Installed "gdb-disassemble" command for disassembly' |