summaryrefslogtreecommitdiff
path: root/examples/python/gdb_disassemble.py
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-08-20 18:01:57 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-08-20 18:01:57 +0000
commit88c643b6fec27eec436c8d138fee6346e92337d6 (patch)
tree82cd13b2f3cde1c9e5f79689ba4e6ba67694843f /examples/python/gdb_disassemble.py
parent94994d372d014ce4c8758b9605d63fae651bd8aa (diff)
Notes
Diffstat (limited to 'examples/python/gdb_disassemble.py')
-rwxr-xr-xexamples/python/gdb_disassemble.py26
1 files changed, 0 insertions, 26 deletions
diff --git a/examples/python/gdb_disassemble.py b/examples/python/gdb_disassemble.py
deleted file mode 100755
index 2590aba8c85c..000000000000
--- a/examples/python/gdb_disassemble.py
+++ /dev/null
@@ -1,26 +0,0 @@
-import lldb
-
-
-def disassemble(debugger, command, result, dict):
- if lldb.frame.function:
- instructions = lldb.frame.function.instructions
- start_addr = lldb.frame.function.addr.load_addr
- name = lldb.frame.function.name
- elif lldb.frame.symbol:
- 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
- comment = inst.comment
- if comment:
- 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'