forked from snare/voltron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbgentry.py
37 lines (32 loc) · 1.03 KB
/
dbgentry.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import voltron
import voltron.cmd
import voltron.common
try:
import voltron.lldbcmd
in_lldb = True
except:
in_lldb = False
try:
import voltron.gdbcmd
in_gdb = True
except:
in_gdb = False
log = voltron.common.configure_logging()
if in_lldb:
# Called when the module is loaded into lldb and initialised
def __lldb_init_module(debugger, dict):
log.debug("Initialising LLDB command")
voltron.lldbcmd.inst = voltron.lldbcmd.VoltronLLDBCommand(debugger, dict)
voltron.cmd.inst = voltron.lldbcmd.inst
# Called when the command is invoked by lldb
def lldb_invoke(debugger, command, result, dict):
voltron.lldbcmd.inst.invoke(debugger, command, result, dict)
if in_gdb:
# Called when the module is loaded by gdb
if __name__ == "__main__":
log.debug('Initialising GDB command')
inst = voltron.gdbcmd.VoltronGDBCommand()
voltron.cmd.inst = inst
print("Voltron loaded.")
if not in_lldb and not in_gdb:
print("Something wicked this way comes")