X-Git-Url: http://id.pley.net/dotfiles.git/blobdiff_plain/4ff2c1b8d4fca75078da7e36f7ec1421749b43cb..2ea666b3ad4c9f6a2e58c969385e8e391e325ae9:/lldb/kdpReboot.py diff --git a/lldb/kdpReboot.py b/lldb/kdpReboot.py new file mode 100644 index 0000000..13e6d62 --- /dev/null +++ b/lldb/kdpReboot.py @@ -0,0 +1,14 @@ +import lldb + +def kdpReboot(debugger, command, result, internal_dict): + if not "kdp" in debugger.GetSelectedTarget().GetProcess().GetPluginName().lower(): + print "Target is not connected over kdp. Connect to a remote machine with `kdp-remote [:]`." + return False + + print "Rebooting the remote machine." + debugger.HandleCommand('process plugin packet send --command 0x13') + debugger.HandleCommand('detach') + return True + +def __lldb_init_module(debugger, internal_dict): + debugger.HandleCommand('command script add -f kdpReboot.kdpReboot kdp-reboot')